Compare commits
7 Commits
c99f64054c
...
439e76e9b0
| Author | SHA1 | Date |
|---|---|---|
|
|
439e76e9b0 | |
|
|
1888920a8b | |
|
|
876a525342 | |
|
|
d0841c0a56 | |
|
|
49c7689ece | |
|
|
4b4f45f63f | |
|
|
fc0b725bc1 |
|
|
@ -22,10 +22,10 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
using AyCode.Database;
|
using AyCode.Database;
|
||||||
using AyCode.Database.DbContexts.Loggers;
|
using AyCode.Database.DbContexts.Loggers;
|
||||||
using AyCode.Entities.LogItems;
|
|
||||||
using AyCode.Entities.Server.LogItems;
|
using AyCode.Entities.Server.LogItems;
|
||||||
|
|
||||||
namespace TIAM.Database;
|
namespace TIAM.Database;
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.5" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,12 @@ namespace TIAM.Entities.Transfers
|
||||||
{
|
{
|
||||||
Description = description;
|
Description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"{nameof(Id)}: {Id}; {nameof(AddressId)}: {AddressId}; {nameof(Name)}: {Name}; {nameof(Description)}: {Description}; {nameof(Price)}: {Price}; " +
|
||||||
|
$"{nameof(Price2)}: {Price2}; {nameof(Price3)}: {Price3}; {nameof(ProductCommis)}: {ProductCommis}; {nameof(ExtraPrice)}: {ExtraPrice}; {nameof(AddressString)}: {AddressString};";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
||||||
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
|
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
|
||||||
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
|
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.5" />
|
||||||
<PackageReference Include="SendGrid" Version="9.29.3" />
|
<PackageReference Include="SendGrid" Version="9.29.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ using TIAMWebApp.Shared.Application.Utility;
|
||||||
using TIAMWebApp.Shared.Application.Services;
|
using TIAMWebApp.Shared.Application.Services;
|
||||||
using BlazorAnimation;
|
using BlazorAnimation;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
|
|
||||||
namespace TIAMMobileApp
|
namespace TIAMMobileApp
|
||||||
{
|
{
|
||||||
|
|
@ -47,7 +48,9 @@ namespace TIAMMobileApp
|
||||||
|
|
||||||
builder.Services.AddScoped<IWeatherForecastService, WeatherForecastService>();
|
builder.Services.AddScoped<IWeatherForecastService, WeatherForecastService>();
|
||||||
builder.Services.AddScoped<ITransferDataService, TransferDataService>();
|
builder.Services.AddScoped<ITransferDataService, TransferDataService>();
|
||||||
builder.Services.AddScoped<IAcLogWriterBase, BrowserConsoleLogWriter>();
|
//builder.Services.AddScoped<IAcLogWriterBase, BrowserConsoleLogWriter>();
|
||||||
|
builder.Services.AddSingleton<IAcLogWriterClientBase, BrowserConsoleLogWriter>();
|
||||||
|
builder.Services.AddSingleton<IAcLogWriterClientBase, HttpClientLogItemWriter>();
|
||||||
builder.Services.AddScoped<IPopulationStructureDataProvider, PopulationStructureDataProvider>();
|
builder.Services.AddScoped<IPopulationStructureDataProvider, PopulationStructureDataProvider>();
|
||||||
builder.Services.AddScoped<ISupplierService, SupplierService>();
|
builder.Services.AddScoped<ISupplierService, SupplierService>();
|
||||||
builder.Services.AddScoped<IUserDataService, UserDataServiceMobile>();
|
builder.Services.AddScoped<IUserDataService, UserDataServiceMobile>();
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,8 @@
|
||||||
<ProjectReference Include="..\..\Aycode.Blazor\AyCode.Maui.Core\AyCode.Maui.Core.csproj" />
|
<ProjectReference Include="..\..\Aycode.Blazor\AyCode.Maui.Core\AyCode.Maui.Core.csproj" />
|
||||||
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
<ProjectReference Include="..\TIAM.Core\TIAM.Core.csproj" />
|
||||||
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
<ProjectReference Include="..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||||
|
<ProjectReference Include="..\TIAM.Models\TIAM.Models.csproj" />
|
||||||
|
<ProjectReference Include="..\TIAM.Services\TIAM.Services.csproj" />
|
||||||
<ProjectReference Include="..\TIAMSharedUI\TIAMSharedUI.csproj" />
|
<ProjectReference Include="..\TIAMSharedUI\TIAMSharedUI.csproj" />
|
||||||
<ProjectReference Include="..\TIAMWebApp\Shared\TIAMWebApp.Shared.Application.csproj" />
|
<ProjectReference Include="..\TIAMWebApp\Shared\TIAMWebApp.Shared.Application.csproj" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" Version="8.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="7.0.1" Version="8.0.1" />
|
||||||
|
|
@ -80,21 +82,21 @@
|
||||||
<Reference Include="AyCode.Models">
|
<Reference Include="AyCode.Models">
|
||||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.dll</HintPath>
|
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Models.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="AyCode.Utils">
|
<Reference Include="AyCode.Services">
|
||||||
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Utils.dll</HintPath>
|
<HintPath>..\..\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Services.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Update="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.20" />
|
<PackageReference Update="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.40" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.20" />
|
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.40" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.20" />
|
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,11 @@
|
||||||
@using System.Globalization;
|
@using System.Globalization;
|
||||||
@using AyCode.Core.Enums
|
@using AyCode.Core.Enums
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@using TIAM.Core.Loggers
|
@using TIAM.Core.Loggers
|
||||||
@inject NavigationManager NavManager
|
@inject NavigationManager NavManager
|
||||||
@inject IJSRuntime JSRuntime
|
@inject IJSRuntime JSRuntime
|
||||||
@inject IEnumerable<IAcLogWriterBase> LogWriters
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
@inject IUserDataService UserDataService
|
@inject IUserDataService UserDataService
|
||||||
@inject ISecureStorageHandler SecureStorageHandler
|
@inject ISecureStorageHandler SecureStorageHandler
|
||||||
@inject ISessionService sessionService;
|
@inject ISessionService sessionService;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,22 @@
|
||||||
using Microsoft.AspNetCore.Components;
|
using AyCode.Services.Loggers;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using TIAM.Core.Loggers;
|
||||||
using TIAMSharedUI.Shared.Components;
|
using TIAMSharedUI.Shared.Components;
|
||||||
using TIAMWebApp.Shared.Application.Interfaces;
|
using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
|
using TIAMWebApp.Shared.Application.Utility;
|
||||||
|
|
||||||
namespace TIAMSharedUI.Pages.Components
|
namespace TIAMSharedUI.Pages.Components
|
||||||
{
|
{
|
||||||
public partial class AuthComponent : ComponentBase
|
public partial class AuthComponent : ComponentBase
|
||||||
{
|
{
|
||||||
|
[Inject]
|
||||||
|
public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
public ISessionService sessionService { get; set; }
|
public ISessionService sessionService { get; set; }
|
||||||
public bool IsLoggedIn = false;
|
public bool IsLoggedIn = false;
|
||||||
|
|
@ -21,10 +27,13 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
private PopupMessageBox PopupMessageBox { get; set; } = default!;
|
private PopupMessageBox PopupMessageBox { get; set; } = default!;
|
||||||
|
|
||||||
public bool IsVisible = false;
|
public bool IsVisible = false;
|
||||||
|
private ILogger _logger;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
_logger = new LoggerClient<AuthComponent>(LogWriters.ToArray());
|
||||||
|
_logger.Debug("OnInitializedAsync");
|
||||||
|
|
||||||
IsLoggedIn = sessionService.IsAuthenticated;
|
IsLoggedIn = sessionService.IsAuthenticated;
|
||||||
if(IsLoggedIn)
|
if(IsLoggedIn)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,21 +5,16 @@ using Microsoft.AspNetCore.Components.Web;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using TIAMWebApp.Shared.Application.Utility;
|
using TIAMWebApp.Shared.Application.Utility;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels;
|
|
||||||
using TIAMWebApp.Shared.Application.Models.PageModels;
|
|
||||||
using DevExpress.Pdf.Native.BouncyCastle.Asn1.X509.Qualified;
|
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using TIAM.Resources;
|
using TIAM.Resources;
|
||||||
using TIAMWebApp.Shared.Application.Interfaces;
|
using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using TIAMWebApp.Shared.Application.Models;
|
using TIAMWebApp.Shared.Application.Models;
|
||||||
using DevExpress.XtraPrinting;
|
|
||||||
using TIAMSharedUI.Shared;
|
using TIAMSharedUI.Shared;
|
||||||
using DevExpress.Pdf.Native.BouncyCastle.Asn1.Cms;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using AyCode.Core.Consts;
|
using AyCode.Core.Consts;
|
||||||
using AyCode.Core.Loggers;
|
|
||||||
using TIAM.Core.Loggers;
|
using TIAM.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
|
|
||||||
|
|
||||||
namespace TIAMSharedUI.Pages.Components
|
namespace TIAMSharedUI.Pages.Components
|
||||||
|
|
@ -27,7 +22,7 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
public partial class InputWizard : ComponentBase
|
public partial class InputWizard : ComponentBase
|
||||||
{
|
{
|
||||||
[Inject]
|
[Inject]
|
||||||
public required IEnumerable<IAcLogWriterBase> LogWriters { get; set; }
|
public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
IStringLocalizer<TIAMResources> localizer { get; set; }
|
IStringLocalizer<TIAMResources> localizer { get; set; }
|
||||||
|
|
@ -77,14 +72,14 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
_spinnerClass = "spinner-border spinner-border-sm";
|
_spinnerClass = "spinner-border spinner-border-sm";
|
||||||
await Task.Delay(500);
|
await Task.Delay(500);
|
||||||
|
|
||||||
string debugString = "Success: ";
|
var debugString = "Success: ";
|
||||||
|
|
||||||
Type myType = Data.GetType();
|
var myType = Data.GetType();
|
||||||
IList<PropertyInfo> props = new List<PropertyInfo>(myType.GetProperties());
|
IList<PropertyInfo> props = new List<PropertyInfo>(myType.GetProperties());
|
||||||
|
|
||||||
foreach (PropertyInfo prop in props)
|
foreach (var prop in props)
|
||||||
{
|
{
|
||||||
object propValue = prop.GetValue(Data, null);
|
var propValue = prop.GetValue(Data, null);
|
||||||
|
|
||||||
// Do something with propValue
|
// Do something with propValue
|
||||||
debugString += $"{prop.Name} = {propValue}\n";
|
debugString += $"{prop.Name} = {propValue}\n";
|
||||||
|
|
@ -115,22 +110,23 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
|
|
||||||
public RenderFragment CreateEditFormFields() => formLayoutBuilder =>
|
public RenderFragment CreateEditFormFields() => formLayoutBuilder =>
|
||||||
{
|
{
|
||||||
|
var type = Data.GetType();
|
||||||
|
|
||||||
var _type = Data.GetType();
|
//for (var i = 0; i < 1000; i++)
|
||||||
_logger.Info("Hellooooo " + _type.AssemblyQualifiedName);
|
_logger.Info("Hellooooo " + type.AssemblyQualifiedName);
|
||||||
|
|
||||||
var propertyList = _type.GetProperties();
|
var propertyList = type.GetProperties();
|
||||||
var _length = propertyList.Length - IgnoreReflection.Count;
|
var length = propertyList.Length - IgnoreReflection.Count;
|
||||||
//var propertyList = typeof(TestUserData).GetProperties();
|
//var propertyList = typeof(TestUserData).GetProperties();
|
||||||
formLayoutBuilder.OpenComponent<DxFormLayout>(0);
|
formLayoutBuilder.OpenComponent<DxFormLayout>(0);
|
||||||
|
|
||||||
formLayoutBuilder.AddAttribute(1, "ChildContent", (RenderFragment)((layoutItemBuilder) =>
|
formLayoutBuilder.AddAttribute(1, "ChildContent", (RenderFragment)((layoutItemBuilder) =>
|
||||||
{
|
{
|
||||||
int i = 0;
|
var i = 0;
|
||||||
int k = 0;
|
var k = 0;
|
||||||
foreach (var property in propertyList)
|
foreach (var property in propertyList)
|
||||||
{
|
{
|
||||||
bool isActive = k == CurrentStep;
|
var isActive = k == CurrentStep;
|
||||||
//if (property.Name == "Id" || property.Name == "Latitude" || property.Name == "Longitude" || property.Name == "Created" || property.Name == "Modified")
|
//if (property.Name == "Id" || property.Name == "Latitude" || property.Name == "Longitude" || property.Name == "Created" || property.Name == "Modified")
|
||||||
//if (property.Name == "Id" || property.Name == "Created" || property.Name == "Modified")
|
//if (property.Name == "Id" || property.Name == "Created" || property.Name == "Modified")
|
||||||
if (IgnoreReflection.Contains(property.Name))
|
if (IgnoreReflection.Contains(property.Name))
|
||||||
|
|
@ -138,17 +134,17 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Guid _stepID = Guid.Empty;
|
Guid stepId;
|
||||||
|
|
||||||
if (!FormSteps.ContainsKey(k))
|
if (!FormSteps.ContainsKey(k))
|
||||||
{
|
{
|
||||||
_stepID = Guid.NewGuid();
|
stepId = Guid.NewGuid();
|
||||||
_logger.Detail($"Adding step {k}, {_stepID}, for {property.Name}");
|
_logger.Detail($"Adding step {k}, {stepId}, for {property.Name}");
|
||||||
FormSteps.Add(k, _stepID);
|
FormSteps.Add(k, stepId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_stepID = FormSteps[k];
|
stepId = FormSteps[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
//the following line creates an expression that accesses the property value by name
|
//the following line creates an expression that accesses the property value by name
|
||||||
|
|
@ -159,8 +155,10 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
_logger.Detail($"{property.Name}, {property.GetType().FullName}");
|
_logger.Detail($"{property.Name}, {property.GetType().FullName}");
|
||||||
_logger.Detail(lambda.ToString());
|
_logger.Detail(lambda.ToString());
|
||||||
|
|
||||||
|
_logger.Detail($"lambda: {lambda.ToString()}");
|
||||||
|
|
||||||
layoutItemBuilder.OpenElement(i++, "div");//open div
|
layoutItemBuilder.OpenElement(i++, "div");//open div
|
||||||
layoutItemBuilder.AddAttribute(i++, "id", _stepID.ToString());
|
layoutItemBuilder.AddAttribute(i++, "id", stepId.ToString());
|
||||||
layoutItemBuilder.AddAttribute(i++, "class", "disply-flex align-items-center "+CssClass);
|
layoutItemBuilder.AddAttribute(i++, "class", "disply-flex align-items-center "+CssClass);
|
||||||
layoutItemBuilder.AddAttribute(i++, "style", "width: 100%;");
|
layoutItemBuilder.AddAttribute(i++, "style", "width: 100%;");
|
||||||
if (k != CurrentStep)
|
if (k != CurrentStep)
|
||||||
|
|
@ -174,8 +172,8 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DataTypeAttribute attrList = (DataTypeAttribute)property.GetCustomAttributes(typeof(DataTypeAttribute), false).First();
|
var attrList = (DataTypeAttribute)property.GetCustomAttributes(typeof(DataTypeAttribute), false).First();
|
||||||
DisplayAttribute displayLabel = (DisplayAttribute)property.GetCustomAttributes(typeof(DisplayAttribute), false).First();
|
var displayLabel = (DisplayAttribute)property.GetCustomAttributes(typeof(DisplayAttribute), false).First();
|
||||||
layoutItemBuilder.OpenComponent<DxFormLayoutItem>(i++); //open dxformlayoutitem
|
layoutItemBuilder.OpenComponent<DxFormLayoutItem>(i++); //open dxformlayoutitem
|
||||||
layoutItemBuilder.AddAttribute(i++, "Caption", localizer.GetString(displayLabel.Name));
|
layoutItemBuilder.AddAttribute(i++, "Caption", localizer.GetString(displayLabel.Name));
|
||||||
layoutItemBuilder.AddAttribute(i++, "ColSpanMd", 12);
|
layoutItemBuilder.AddAttribute(i++, "ColSpanMd", 12);
|
||||||
|
|
@ -361,7 +359,7 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
{
|
{
|
||||||
|
|
||||||
editor.OpenComponent<SliderItemSelector>(j);
|
editor.OpenComponent<SliderItemSelector>(j);
|
||||||
editor.AddAttribute(j++, "OwlId", "owlSelector" + _stepID);
|
editor.AddAttribute(j++, "OwlId", "owlSelector" + stepId);
|
||||||
editor.AddAttribute(j++, "TextValue", property.GetValue(Data));
|
editor.AddAttribute(j++, "TextValue", property.GetValue(Data));
|
||||||
//editor.AddAttribute(j++, "TExpression", lambda);
|
//editor.AddAttribute(j++, "TExpression", lambda);
|
||||||
editor.AddAttribute(j++, "OnSliderChanged", EventCallback.Factory.Create<string>(this, result =>
|
editor.AddAttribute(j++, "OnSliderChanged", EventCallback.Factory.Create<string>(this, result =>
|
||||||
|
|
@ -398,16 +396,16 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
_logger.Detail($"FirstName changed to {result}");
|
_logger.Detail($"FirstName changed to {result}");
|
||||||
|
|
||||||
//find property with name FirstName
|
//find property with name FirstName
|
||||||
PropertyInfo firstNameProperty = propertyList.FirstOrDefault(p => p.Name == "FirstName");
|
var firstNameProperty = propertyList.FirstOrDefault(p => p.Name == "FirstName");
|
||||||
firstNameProperty.SetValue(Data, result);
|
firstNameProperty.SetValue(Data, result);
|
||||||
//find property with name LastName
|
//find property with name LastName
|
||||||
PropertyInfo lastNameProperty = propertyList.FirstOrDefault(p => p.Name == "LastName");
|
var lastNameProperty = propertyList.FirstOrDefault(p => p.Name == "LastName");
|
||||||
//combine the two values, if they are not null
|
//combine the two values, if they are not null
|
||||||
if (firstNameProperty != null && lastNameProperty != null)
|
if (firstNameProperty != null && lastNameProperty != null)
|
||||||
{
|
{
|
||||||
string firstName = result;
|
var firstName = result;
|
||||||
string lastName = (string)lastNameProperty.GetValue(Data);
|
var lastName = (string)lastNameProperty.GetValue(Data);
|
||||||
string fullName = $"{firstName} {lastName}";
|
var fullName = $"{firstName} {lastName}";
|
||||||
property.SetValue(Data, fullName);
|
property.SetValue(Data, fullName);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
@ -417,16 +415,16 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
_logger.Detail($"LastName changed to {result}");
|
_logger.Detail($"LastName changed to {result}");
|
||||||
|
|
||||||
//find property with name FirstName
|
//find property with name FirstName
|
||||||
PropertyInfo firstNameProperty = propertyList.FirstOrDefault(p => p.Name == "FirstName");
|
var firstNameProperty = propertyList.FirstOrDefault(p => p.Name == "FirstName");
|
||||||
//find property with name LastName
|
//find property with name LastName
|
||||||
PropertyInfo lastNameProperty = propertyList.FirstOrDefault(p => p.Name == "LastName");
|
var lastNameProperty = propertyList.FirstOrDefault(p => p.Name == "LastName");
|
||||||
lastNameProperty.SetValue(Data, result);
|
lastNameProperty.SetValue(Data, result);
|
||||||
//combine the two values, if they are not null
|
//combine the two values, if they are not null
|
||||||
if (firstNameProperty != null && lastNameProperty != null)
|
if (firstNameProperty != null && lastNameProperty != null)
|
||||||
{
|
{
|
||||||
string firstName = (string)firstNameProperty.GetValue(Data);
|
var firstName = (string)firstNameProperty.GetValue(Data);
|
||||||
string lastName = result;
|
var lastName = result;
|
||||||
string fullName = $"{firstName} {lastName}";
|
var fullName = $"{firstName} {lastName}";
|
||||||
property.SetValue(Data, fullName);
|
property.SetValue(Data, fullName);
|
||||||
}
|
}
|
||||||
_logger.Detail($"bleh: {property.Name} = {property.GetValue(Data)}");
|
_logger.Detail($"bleh: {property.Name} = {property.GetValue(Data)}");
|
||||||
|
|
@ -488,7 +486,7 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
layoutItemBuilder.AddAttribute(i++, "Click", EventCallback.Factory.Create<MouseEventArgs>(this, OnNext));
|
layoutItemBuilder.AddAttribute(i++, "Click", EventCallback.Factory.Create<MouseEventArgs>(this, OnNext));
|
||||||
layoutItemBuilder.AddAttribute(i++, "SubmitFormOnClick", false);
|
layoutItemBuilder.AddAttribute(i++, "SubmitFormOnClick", false);
|
||||||
layoutItemBuilder.AddAttribute(i++, "CssClass", "btn btn-primary mt-3");
|
layoutItemBuilder.AddAttribute(i++, "CssClass", "btn btn-primary mt-3");
|
||||||
if (!(k < _length - 1))
|
if (!(k < length - 1))
|
||||||
{
|
{
|
||||||
layoutItemBuilder.AddAttribute(i++, "disabled", "true");
|
layoutItemBuilder.AddAttribute(i++, "disabled", "true");
|
||||||
|
|
||||||
|
|
@ -509,7 +507,7 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
layoutItemBuilder.CloseElement();
|
layoutItemBuilder.CloseElement();
|
||||||
|
|
||||||
|
|
||||||
_logger.Detail($"loop {k}, length: {_length}, formSteps: {FormSteps.Count} ");
|
_logger.Detail($"loop {k}, length: {length}, formSteps: {FormSteps.Count} ");
|
||||||
k++;
|
k++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -524,7 +522,7 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
editor.AddAttribute(i++, "type", "submit");
|
editor.AddAttribute(i++, "type", "submit");
|
||||||
editor.AddAttribute(i++, "class", "btn btn-primary mt-3 w-100");
|
editor.AddAttribute(i++, "class", "btn btn-primary mt-3 w-100");
|
||||||
editor.AddAttribute(i++, "style", "margin: 0 auto");
|
editor.AddAttribute(i++, "style", "margin: 0 auto");
|
||||||
if (CurrentStep < _length - 1)
|
if (CurrentStep < length - 1)
|
||||||
{
|
{
|
||||||
editor.AddAttribute(i++, "disabled", "true");
|
editor.AddAttribute(i++, "disabled", "true");
|
||||||
|
|
||||||
|
|
@ -569,7 +567,8 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
|
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
|
||||||
public class MinPasswordLengthAttribute : ValidationAttribute
|
public class MinPasswordLengthAttribute : ValidationAttribute
|
||||||
{
|
{
|
||||||
int MinLength { get; }
|
private int MinLength { get; }
|
||||||
|
|
||||||
public MinPasswordLengthAttribute(int minLength, string errorMsg) : base(errorMsg)
|
public MinPasswordLengthAttribute(int minLength, string errorMsg) : base(errorMsg)
|
||||||
{
|
{
|
||||||
MinLength = minLength;
|
MinLength = minLength;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
using TIAMSharedUI.Resources;
|
using TIAMSharedUI.Resources;
|
||||||
using TIAMWebApp.Shared.Application.Interfaces;
|
using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
using TIAMWebApp.Shared.Application.Models;
|
using TIAMWebApp.Shared.Application.Models;
|
||||||
|
|
@ -29,7 +30,7 @@ namespace TIAMSharedUI.Pages.Components
|
||||||
[Inject]
|
[Inject]
|
||||||
public NavigationManager navigationManager { get; set; }
|
public NavigationManager navigationManager { get; set; }
|
||||||
[Inject]
|
[Inject]
|
||||||
public IAcLogWriterBase BrowserConsoleLogWriter { get; set; }
|
public IAcLogWriterClientBase BrowserConsoleLogWriter { get; set; }
|
||||||
[Inject]
|
[Inject]
|
||||||
public IComponentUpdateService componentUpdateService { get; set; }
|
public IComponentUpdateService componentUpdateService { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace TIAMSharedUI.Pages.Components;
|
||||||
|
|
||||||
|
public partial class TiamComponentBase : ComponentBase
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
@using TIAMWebApp.Shared.Application.Utility;
|
@using TIAMWebApp.Shared.Application.Utility;
|
||||||
@using System.IdentityModel.Tokens.Jwt;
|
@using System.IdentityModel.Tokens.Jwt;
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@using TIAMSharedUI.Pages.Components;
|
@using TIAMSharedUI.Pages.Components;
|
||||||
@using TIAMSharedUI.Shared
|
@using TIAMSharedUI.Shared
|
||||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
|
|
@ -23,7 +24,7 @@
|
||||||
@inject ISessionService sessionService;
|
@inject ISessionService sessionService;
|
||||||
@inject IStringLocalizer<MyResources> localizer;
|
@inject IStringLocalizer<MyResources> localizer;
|
||||||
@inject NavigationManager navManager
|
@inject NavigationManager navManager
|
||||||
@inject IAcLogWriterBase BrowserConsoleLogWriter
|
@inject IAcLogWriterClientBase BrowserConsoleLogWriter
|
||||||
|
|
||||||
@inject ITransferDataService transferDataService
|
@inject ITransferDataService transferDataService
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
@using TIAMWebApp.Shared.Application.Utility;
|
@using TIAMWebApp.Shared.Application.Utility;
|
||||||
@using System.IdentityModel.Tokens.Jwt;
|
@using System.IdentityModel.Tokens.Jwt;
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@using TIAMSharedUI.Pages.Components;
|
@using TIAMSharedUI.Pages.Components;
|
||||||
@using TIAMSharedUI.Shared
|
@using TIAMSharedUI.Shared
|
||||||
@using TIAM.Resources;
|
@using TIAM.Resources;
|
||||||
|
|
@ -21,7 +22,7 @@
|
||||||
@inject ISessionService sessionService;
|
@inject ISessionService sessionService;
|
||||||
@inject IStringLocalizer<TIAMResources> localizer;
|
@inject IStringLocalizer<TIAMResources> localizer;
|
||||||
@inject NavigationManager navManager
|
@inject NavigationManager navManager
|
||||||
@inject IAcLogWriterBase BrowserConsoleLogWriter
|
@inject IAcLogWriterClientBase BrowserConsoleLogWriter
|
||||||
@inject IWizardProcessor WizardProcessor
|
@inject IWizardProcessor WizardProcessor
|
||||||
|
|
||||||
<PageTitle>Index</PageTitle>
|
<PageTitle>Index</PageTitle>
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,14 @@
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
@using TIAMWebApp.Shared.Application.Models.ClientSide
|
@using TIAMWebApp.Shared.Application.Models.ClientSide
|
||||||
@using AyCode.Interfaces.StorageHandlers;
|
@using AyCode.Interfaces.StorageHandlers;
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@using TIAM.Core.Loggers
|
@using TIAM.Core.Loggers
|
||||||
@inject NavigationManager NavManager
|
@inject NavigationManager NavManager
|
||||||
@inject IJSRuntime JSRuntime
|
@inject IJSRuntime JSRuntime
|
||||||
@inject IUserDataService UserDataService
|
@inject IUserDataService UserDataService
|
||||||
@inject ISecureStorageHandler SecureStorageHandler
|
@inject ISecureStorageHandler SecureStorageHandler
|
||||||
@inject HttpClient http;
|
@inject HttpClient http;
|
||||||
@inject IEnumerable<IAcLogWriterBase> LogWriters
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
<h3>AppLaunch</h3>
|
<h3>AppLaunch</h3>
|
||||||
|
|
||||||
Loading....
|
Loading....
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ using System.Resources;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using AyCode.Blazor.Components;
|
using AyCode.Blazor.Components;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
using Azure.Core;
|
using Azure.Core;
|
||||||
|
|
||||||
namespace TIAMSharedUI.Pages
|
namespace TIAMSharedUI.Pages
|
||||||
|
|
@ -25,7 +26,7 @@ namespace TIAMSharedUI.Pages
|
||||||
[Inject]
|
[Inject]
|
||||||
public IUserDataService userDataService { get; set; }
|
public IUserDataService userDataService { get; set; }
|
||||||
[Inject]
|
[Inject]
|
||||||
public IAcLogWriterBase BrowserConsoleLogWriter { get; set; }
|
public IAcLogWriterClientBase BrowserConsoleLogWriter { get; set; }
|
||||||
[Inject]
|
[Inject]
|
||||||
public IJSRuntime jsRuntime { get; set; }
|
public IJSRuntime jsRuntime { get; set; }
|
||||||
[Inject]
|
[Inject]
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@using TIAM.Entities.Transfers
|
@using TIAM.Entities.Transfers
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
@inject IAcLogWriterBase BrowserConsoleLogWriter
|
@using AyCode.Services.Loggers
|
||||||
|
@inject IAcLogWriterClientBase BrowserConsoleLogWriter
|
||||||
@inject IWizardProcessor WizardProcessor
|
@inject IWizardProcessor WizardProcessor
|
||||||
<h3>TestPage</h3>
|
<h3>TestPage</h3>
|
||||||
<div class="container mt-3">
|
<div class="container mt-3">
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,9 @@
|
||||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@inject NavigationManager navManager
|
@inject NavigationManager navManager
|
||||||
@inject IAcLogWriterBase BrowserConsoleLogWriter
|
@inject IAcLogWriterClientBase BrowserConsoleLogWriter
|
||||||
@inject IWizardProcessor WizardProcessor
|
@inject IWizardProcessor WizardProcessor
|
||||||
<PageTitle>Transfer</PageTitle>
|
<PageTitle>Transfer</PageTitle>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
@page "/user/media"
|
@page "/user/media"
|
||||||
@using System.Net.Http.Headers
|
@using System.Net.Http.Headers
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@using TIAMSharedUI.Shared
|
@using TIAMSharedUI.Shared
|
||||||
@using TIAMWebApp.Shared.Application.Interfaces
|
@using TIAMWebApp.Shared.Application.Interfaces
|
||||||
@using TIAMWebApp.Shared.Application.Models
|
@using TIAMWebApp.Shared.Application.Models
|
||||||
|
|
@ -44,7 +45,7 @@
|
||||||
@layout AdminLayout
|
@layout AdminLayout
|
||||||
@inject IJSRuntime JSRuntime;
|
@inject IJSRuntime JSRuntime;
|
||||||
@inject IImageDataService imageDataService;
|
@inject IImageDataService imageDataService;
|
||||||
@inject IAcLogWriterBase BrowserConsoleLogWriter;
|
@inject IAcLogWriterClientBase BrowserConsoleLogWriter;
|
||||||
@implements IAsyncDisposable
|
@implements IAsyncDisposable
|
||||||
|
|
||||||
<h3>File Upload</h3>
|
<h3>File Upload</h3>
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,9 @@
|
||||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@layout AdminLayout
|
@layout AdminLayout
|
||||||
@inject IAcLogWriterBase BrowserConsoleLogWriter
|
@inject IAcLogWriterClientBase BrowserConsoleLogWriter
|
||||||
@inject IStringLocalizer<TIAMResources> localizer
|
@inject IStringLocalizer<TIAMResources> localizer
|
||||||
<h3>Properties</h3>
|
<h3>Properties</h3>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@using TIAM.Core.Loggers
|
@using TIAM.Core.Loggers
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@inject IUserDataService NwindDataService
|
@inject IUserDataService NwindDataService
|
||||||
@inject IEnumerable<IAcLogWriterBase> LogWriters
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,10 @@
|
||||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.Messages
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.Messages
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@layout AdminLayout
|
@layout AdminLayout
|
||||||
@inject IStringLocalizer<TIAMResources> localizer
|
@inject IStringLocalizer<TIAMResources> localizer
|
||||||
@inject BrowserConsoleLogWriter BrowserConsoleLogWriter
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
|
|
||||||
<!--div class="text-center m-5">
|
<!--div class="text-center m-5">
|
||||||
<h1>Service management</h1>
|
<h1>Service management</h1>
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
using TIAM.Entities.ServiceProviders;
|
using TIAM.Entities.ServiceProviders;
|
||||||
using TIAM.Core.Enums;
|
using TIAM.Core.Enums;
|
||||||
|
using TIAM.Core.Loggers;
|
||||||
using TIAMWebApp.Shared.Application.Services;
|
using TIAMWebApp.Shared.Application.Services;
|
||||||
using TIAMWebApp.Shared.Application.Utility;
|
using TIAMWebApp.Shared.Application.Utility;
|
||||||
|
|
||||||
|
|
@ -17,6 +18,7 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
|
||||||
{
|
{
|
||||||
public partial class ManageProducts :ComponentBase
|
public partial class ManageProducts :ComponentBase
|
||||||
{
|
{
|
||||||
|
private ILogger _logger;
|
||||||
|
|
||||||
IGrid Grid { get; set; }
|
IGrid Grid { get; set; }
|
||||||
object? ProductData { get; set; }
|
object? ProductData { get; set; }
|
||||||
|
|
@ -65,7 +67,7 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
|
||||||
public async Task SubmitForm(object Result)
|
public async Task SubmitForm(object Result)
|
||||||
{
|
{
|
||||||
//await WizardProcessor.ProcessWizardAsync(Result.GetType(), Result);
|
//await WizardProcessor.ProcessWizardAsync(Result.GetType(), Result);
|
||||||
BrowserConsoleLogWriter.Info($"Submitted nested form: {Result.GetType().FullName}");
|
_logger.Info($"Submitted nested form: {Result.GetType().FullName}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -104,13 +106,13 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
|
||||||
ProductData = ((ProductWizardModel[])ProductData).Append(myModel);
|
ProductData = ((ProductWizardModel[])ProductData).Append(myModel);
|
||||||
|
|
||||||
//add new orderData to orderData array
|
//add new orderData to orderData array
|
||||||
BrowserConsoleLogWriter.Info("New orderData added");
|
_logger.Info("New orderData added");
|
||||||
//await NwindDataService.InsertEmployeeAsync((EditableEmployee)e.EditModel);
|
//await NwindDataService.InsertEmployeeAsync((EditableEmployee)e.EditModel);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BrowserConsoleLogWriter.Info("orderData updated");
|
_logger.Info("orderData updated");
|
||||||
//modify transferData where transferData.Id == e.EditModel.Id
|
//modify transferData where transferData.Id == e.EditModel.Id
|
||||||
//get transfer from TransferData by Id
|
//get transfer from TransferData by Id
|
||||||
|
|
||||||
|
|
@ -140,27 +142,32 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
|
||||||
{
|
{
|
||||||
//await NwindDataService.RemoveEmployeeAsync((EditableEmployee)e.DataItem);
|
//await NwindDataService.RemoveEmployeeAsync((EditableEmployee)e.DataItem);
|
||||||
//remove orderData from orderData array
|
//remove orderData from orderData array
|
||||||
BrowserConsoleLogWriter.Info("orderData deleted");
|
_logger.Info("orderData deleted");
|
||||||
//await UpdateDataAsync();
|
//await UpdateDataAsync();
|
||||||
}
|
}
|
||||||
async Task UpdateDataAsync()
|
async Task UpdateDataAsync()
|
||||||
{
|
{
|
||||||
//DataSource = await NwindDataService.GetEmployeesEditableAsync();
|
//DataSource = await NwindDataService.GetEmployeesEditableAsync();
|
||||||
//refresh grid
|
//refresh grid
|
||||||
BrowserConsoleLogWriter.Info("orderData grid refreshed");
|
_logger.Info("orderData grid refreshed");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
base.OnInitialized();
|
base.OnInitialized();
|
||||||
|
|
||||||
|
_logger = new LoggerClient<ManageProducts>(LogWriters.ToArray());
|
||||||
|
|
||||||
var a = await serviceProviderDataService.GetProductsForServiceProviderAsync(Guid.Parse("3587F169-683C-4EEE-BCB5-E8D57F8C6DCE"));
|
var a = await serviceProviderDataService.GetProductsForServiceProviderAsync(Guid.Parse("3587F169-683C-4EEE-BCB5-E8D57F8C6DCE"));
|
||||||
BrowserConsoleLogWriter.Info($"ProductDataFromDb: {((ProductWizardModel[])ProductDataFromDb).Length}");
|
_logger.Info($"ProductDataFromDb: {((ProductWizardModel[])ProductDataFromDb).Length}");
|
||||||
|
|
||||||
foreach (var item in a)
|
foreach (var item in a)
|
||||||
{
|
{
|
||||||
//add new transferwizardmodel to transferData array
|
//add new transferwizardmodel to transferData array
|
||||||
ProductDataFromDb = ((ProductWizardModel[])ProductDataFromDb).Append(
|
ProductDataFromDb = ((ProductWizardModel[])ProductDataFromDb).Append(
|
||||||
new ProductWizardModel(item.ServiceProvider, item.ProductType, item.Name, item.Description, item.Price, item.JsonDetails));
|
new ProductWizardModel(item.ServiceProvider, item.ProductType, item.Name, item.Description, item.Price, item.JsonDetails));
|
||||||
BrowserConsoleLogWriter.Info($"TransferDataFromDb: {item.Name}");
|
|
||||||
|
_logger.Info($"TransferDataFromDb: {item.Name}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,10 @@
|
||||||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@using TIAM.Core.Loggers
|
@using TIAM.Core.Loggers
|
||||||
@layout AdminLayout
|
@layout AdminLayout
|
||||||
@inject IEnumerable<IAcLogWriterBase> LogWriters
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
@inject IStringLocalizer<TIAMResources> localizer
|
@inject IStringLocalizer<TIAMResources> localizer
|
||||||
@inject IWizardProcessor wizardProcessor
|
@inject IWizardProcessor wizardProcessor
|
||||||
@inject ITransferDataService transferDataService
|
@inject ITransferDataService transferDataService
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,10 @@
|
||||||
@using TIAMWebApp.Shared.Application.Models.PageModels
|
@using TIAMWebApp.Shared.Application.Models.PageModels
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@using TIAM.Core.Loggers
|
@using TIAM.Core.Loggers
|
||||||
@layout AdminLayout
|
@layout AdminLayout
|
||||||
@inject IEnumerable<IAcLogWriterBase> LogWriters
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
@inject IStringLocalizer<TIAMResources> localizer
|
@inject IStringLocalizer<TIAMResources> localizer
|
||||||
@inject ISessionService sessionService
|
@inject ISessionService sessionService
|
||||||
@inject IWizardProcessor wizardProcessor
|
@inject IWizardProcessor wizardProcessor
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,9 @@
|
||||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.Messages
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.Messages
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@layout AdminLayout
|
@layout AdminLayout
|
||||||
@inject IEnumerable<IAcLogWriterBase> LogWriters
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
@inject IStringLocalizer<TIAMResources> localizer
|
@inject IStringLocalizer<TIAMResources> localizer
|
||||||
<PageTitle>Transfers</PageTitle>
|
<PageTitle>Transfers</PageTitle>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,10 @@
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@using TIAM.Core.Loggers
|
@using TIAM.Core.Loggers
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
@inject IUserDataService NwindDataService
|
@inject IUserDataService NwindDataService
|
||||||
@inject IServiceProviderDataService serviceProviderDataService
|
@inject IServiceProviderDataService serviceProviderDataService
|
||||||
@inject IEnumerable<IAcLogWriterBase> LogWriters
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
|
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
UserProductMapping
|
UserProductMapping
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,21 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
|
using TIAM.Core.Loggers;
|
||||||
using TIAM.Resources;
|
using TIAM.Resources;
|
||||||
|
using TIAMSharedUI.Resources;
|
||||||
using TIAMWebApp.Shared.Application.Interfaces;
|
using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
using TIAMWebApp.Shared.Application.Utility;
|
using TIAMWebApp.Shared.Application.Utility;
|
||||||
|
using TIAMSharedUI.Pages.Components;
|
||||||
|
|
||||||
namespace TIAMSharedUI.Shared.Components
|
namespace TIAMSharedUI.Shared.Components
|
||||||
{
|
{
|
||||||
public partial class Navbar : ComponentBase
|
public partial class Navbar : ComponentBase
|
||||||
{
|
{
|
||||||
|
[Inject]
|
||||||
|
public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
public ISecureStorageHandler SecureStorageHandler { get; set; }
|
public ISecureStorageHandler SecureStorageHandler { get; set; }
|
||||||
|
|
||||||
|
|
@ -29,8 +36,7 @@ namespace TIAMSharedUI.Shared.Components
|
||||||
[Inject]
|
[Inject]
|
||||||
public IComponentUpdateService componentUpdateService { get; set; }
|
public IComponentUpdateService componentUpdateService { get; set; }
|
||||||
|
|
||||||
[Inject]
|
|
||||||
public IAcLogWriterBase BrowserConsoleLogWriter { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
private bool enableLogin = true;
|
private bool enableLogin = true;
|
||||||
|
|
@ -45,12 +51,19 @@ namespace TIAMSharedUI.Shared.Components
|
||||||
private bool myUser = false;
|
private bool myUser = false;
|
||||||
private bool hasProperty = false;
|
private bool hasProperty = false;
|
||||||
|
|
||||||
|
private ILogger _logger;
|
||||||
|
|
||||||
//componentUpdateService.RefreshRequested += RefreshMe;
|
//componentUpdateService.RefreshRequested += RefreshMe;
|
||||||
|
|
||||||
|
public Navbar()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void RefreshMe()
|
private void RefreshMe()
|
||||||
{
|
{
|
||||||
BrowserConsoleLogWriter.Info($"Navbar refresh called! {DateTime.Now} ");
|
_logger.Debug($"Navbar refresh called! {DateTime.Now} ");
|
||||||
|
|
||||||
OnInitialized();
|
OnInitialized();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
@ -75,37 +88,41 @@ namespace TIAMSharedUI.Shared.Components
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
base.OnInitialized();
|
base.OnInitialized();
|
||||||
componentUpdateService.RefreshRequested += RefreshMe;
|
|
||||||
BrowserConsoleLogWriter.Info($"Navbar OnInit {DateTime.Now} ");
|
_logger = new LoggerClient<Navbar>(LogWriters.ToArray());
|
||||||
|
|
||||||
|
|
||||||
|
_logger.Debug($"Navbar OnInit {DateTime.Now} ");
|
||||||
|
|
||||||
if (sessionService.User != null)
|
if (sessionService.User != null)
|
||||||
{
|
{
|
||||||
myUser = true;
|
myUser = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BrowserConsoleLogWriter.Info($"Navbar myUser false! {DateTime.Now} ");
|
_logger.Debug($"Navbar myUser false! {DateTime.Now} ");
|
||||||
myUser = false;
|
myUser = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var _properties = sessionService.User?.HasProperties;
|
var properties = sessionService.User?.HasProperties;
|
||||||
|
|
||||||
if (sessionService.User?.HasProperties != null)
|
if (properties == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
hasProperty = properties.Count > 0;
|
||||||
|
|
||||||
|
foreach (var property in properties)
|
||||||
{
|
{
|
||||||
if(_properties.Count > 0)
|
_logger.Detail($"First property: {property.Value} ");
|
||||||
{
|
|
||||||
hasProperty = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hasProperty = false;
|
|
||||||
}
|
|
||||||
foreach (var property in _properties)
|
|
||||||
{
|
|
||||||
BrowserConsoleLogWriter.Info($"First property: {property.Value} ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnAfterRender(bool firstRender)
|
||||||
|
{
|
||||||
|
base.OnAfterRender(firstRender);
|
||||||
|
|
||||||
|
if (firstRender)
|
||||||
|
componentUpdateService.RefreshRequested += RefreshMe;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
@using System.Linq.Expressions
|
@using System.Linq.Expressions
|
||||||
@using AyCode.Core.Loggers
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
|
@using TIAM.Core.Loggers
|
||||||
@using TIAM.Entities.Transfers
|
@using TIAM.Entities.Transfers
|
||||||
|
@using TIAMSharedUI.Pages
|
||||||
@using TIAMWebApp.Shared.Application.Interfaces
|
@using TIAMWebApp.Shared.Application.Interfaces
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
@inject IAcLogWriterBase BrowserConsoleLogWriter
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.underlineInput{
|
.underlineInput{
|
||||||
|
|
@ -44,7 +47,7 @@
|
||||||
<div class="item-desc text-center pt-3">
|
<div class="item-desc text-center pt-3">
|
||||||
|
|
||||||
<div class="align-content-center my-3">
|
<div class="align-content-center my-3">
|
||||||
<DxTextBox @ref="textField"
|
<DxTextBox @ref="TextField"
|
||||||
@bind-Text="@Content"
|
@bind-Text="@Content"
|
||||||
BindValueMode="BindValueMode.OnDelayedInput"
|
BindValueMode="BindValueMode.OnDelayedInput"
|
||||||
InputDelay="@InputDelay"
|
InputDelay="@InputDelay"
|
||||||
|
|
@ -200,13 +203,13 @@
|
||||||
|
|
||||||
public int SliderElementId = 0;
|
public int SliderElementId = 0;
|
||||||
|
|
||||||
private string content = "";
|
private string _content = "";
|
||||||
|
|
||||||
string Content
|
string Content
|
||||||
{
|
{
|
||||||
get { return content; }
|
get { return _content; }
|
||||||
set {
|
set {
|
||||||
content = value;
|
_content = value;
|
||||||
OnTextChanged(value);
|
OnTextChanged(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -225,13 +228,15 @@
|
||||||
|
|
||||||
public List<TransferDestination> Destinations = new List<TransferDestination>();
|
public List<TransferDestination> Destinations = new List<TransferDestination>();
|
||||||
|
|
||||||
public DxTextBox textField;
|
public DxTextBox TextField;
|
||||||
|
|
||||||
TransferDestination Result;
|
TransferDestination Result;
|
||||||
|
|
||||||
|
ILogger _logger;
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
BrowserConsoleLogWriter.Info($"SliderItemSelector is initialized with OwlId: {OwlId}");
|
_logger.Info($"SliderItemSelector is initialized with OwlId: {OwlId}");
|
||||||
|
|
||||||
base.OnParametersSet();
|
base.OnParametersSet();
|
||||||
}
|
}
|
||||||
|
|
@ -253,7 +258,8 @@
|
||||||
[JSInvokable]
|
[JSInvokable]
|
||||||
public void ShowCoordinates(string coordinates, string itemId)
|
public void ShowCoordinates(string coordinates, string itemId)
|
||||||
{
|
{
|
||||||
BrowserConsoleLogWriter.Info($"Slider is changing: {coordinates}, {itemId}");
|
_logger.Info($"Slider is changing: {coordinates}, {itemId}");
|
||||||
|
|
||||||
//content = coordinates + "item = " + itemId;
|
//content = coordinates + "item = " + itemId;
|
||||||
SliderElementId = Convert.ToInt32(itemId);
|
SliderElementId = Convert.ToInt32(itemId);
|
||||||
|
|
||||||
|
|
@ -278,13 +284,15 @@
|
||||||
|
|
||||||
public void OnTextChanged(string text)
|
public void OnTextChanged(string text)
|
||||||
{
|
{
|
||||||
BrowserConsoleLogWriter.Info($"Slider text changed: {text}");
|
//if (this.TextValue == text) return;
|
||||||
|
|
||||||
|
_logger.Info($"Slider text changed: {text}");
|
||||||
OnSliderChanged.InvokeAsync(text);
|
OnSliderChanged.InvokeAsync(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetAddressFromSelectedSliderItem(int SliderListIndex)
|
public string GetAddressFromSelectedSliderItem(int sliderListIndex)
|
||||||
{
|
{
|
||||||
if(Destinations.Count >0 && Destinations.Count >= SliderListIndex)
|
if(Destinations.Count >0 && Destinations.Count >= sliderListIndex)
|
||||||
{
|
{
|
||||||
return Destinations[SliderElementId-1].AddressString;
|
return Destinations[SliderElementId-1].AddressString;
|
||||||
}
|
}
|
||||||
|
|
@ -293,6 +301,8 @@
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
_logger = new LoggerClient<SliderItemSelector>(LogWriters.ToArray());
|
||||||
|
|
||||||
Destinations = await TransferDataService.GetDestinationsAsync();
|
Destinations = await TransferDataService.GetDestinationsAsync();
|
||||||
Content = TextValue;
|
Content = TextValue;
|
||||||
InitOwl();
|
InitOwl();
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@
|
||||||
<PackageReference Include="Blazor.AnimateOnScroll" Version="1.1.0" />
|
<PackageReference Include="Blazor.AnimateOnScroll" Version="1.1.0" />
|
||||||
<PackageReference Include="BlazorAnimation" Version="2.2.0" />
|
<PackageReference Include="BlazorAnimation" Version="2.2.0" />
|
||||||
<PackageReference Include="DevExpress.Blazor" Version="23.2.3" />
|
<PackageReference Include="DevExpress.Blazor" Version="23.2.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.4" />
|
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.5" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,11 @@ using TIAMWebApp.Client.Services;
|
||||||
using TIAMWebApp.Shared.Application.Interfaces;
|
using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
using TIAMWebApp.Shared.Application.Services;
|
using TIAMWebApp.Shared.Application.Services;
|
||||||
using TIAMWebApp.Shared.Application.Utility;
|
using TIAMWebApp.Shared.Application.Utility;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||||
|
|
||||||
builder.RootComponents.Add<App>("#app");
|
builder.RootComponents.Add<App>("#app");
|
||||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||||
builder.Services.AddLocalization();
|
builder.Services.AddLocalization();
|
||||||
|
|
@ -25,8 +28,10 @@ builder.Services.AddScoped<ISupplierService, SupplierService>();
|
||||||
builder.Services.AddScoped<IUserDataService, UserDataServiceWeb>();
|
builder.Services.AddScoped<IUserDataService, UserDataServiceWeb>();
|
||||||
builder.Services.AddScoped<ISecureStorageHandler, SecureStorageHandler>();
|
builder.Services.AddScoped<ISecureStorageHandler, SecureStorageHandler>();
|
||||||
builder.Services.AddBlazoredLocalStorage();
|
builder.Services.AddBlazoredLocalStorage();
|
||||||
builder.Services.AddSingleton<ISessionService, SessionServiceWeb>();
|
builder.Services.AddScoped<ISessionService, SessionServiceWeb>();
|
||||||
|
|
||||||
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceWeb>();
|
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceWeb>();
|
||||||
|
|
||||||
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
|
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataService>();
|
||||||
builder.Services.AddScoped<IClientNoticeSenderService, ClientNoticeSenderService>();
|
builder.Services.AddScoped<IClientNoticeSenderService, ClientNoticeSenderService>();
|
||||||
builder.Services.AddScoped<IWizardProcessor, WizardProcessor>();
|
builder.Services.AddScoped<IWizardProcessor, WizardProcessor>();
|
||||||
|
|
@ -34,16 +39,34 @@ builder.Services.AddScoped<IImageDataService, ImageDataService>();
|
||||||
//WebSpecific
|
//WebSpecific
|
||||||
builder.Services.AddScoped<SessionStorageAccessor>();
|
builder.Services.AddScoped<SessionStorageAccessor>();
|
||||||
builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Client.Resources.MyResources", typeof(Program).Assembly));
|
builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Client.Resources.MyResources", typeof(Program).Assembly));
|
||||||
builder.Services.AddScoped<IAcLogWriterBase, BrowserConsoleLogWriter>();
|
builder.Services.AddSingleton<IAcLogWriterClientBase, BrowserConsoleLogWriter>();
|
||||||
builder.Services.AddScoped<IAcLogWriterBase, HttpClientLogItemWriter>();
|
builder.Services.AddSingleton<IAcLogWriterClientBase, HttpClientLogItemWriter>();
|
||||||
|
|
||||||
//builder.Services.AddScoped<BrowserConsoleLogWriter>();
|
//builder.Services.AddScoped<BrowserConsoleLogWriter>();
|
||||||
|
|
||||||
//WebSpecific end
|
//WebSpecific end
|
||||||
|
|
||||||
|
//AppDomain.CurrentDomain.FirstChanceException += (s, e) =>
|
||||||
|
//{
|
||||||
|
// Console.WriteLine("********** OMG! FirstChanceException **********");
|
||||||
|
// Console.WriteLine(e.Exception);
|
||||||
|
//};
|
||||||
|
//
|
||||||
|
//AppDomain.CurrentDomain.UnhandledException += (s, e) =>
|
||||||
|
//{
|
||||||
|
// Console.WriteLine("********** OMG! UnhandledException **********");
|
||||||
|
// Console.WriteLine(e.ExceptionObject.ToString());
|
||||||
|
//};
|
||||||
|
|
||||||
builder.Services.AddSingleton(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
builder.Services.AddSingleton(sp => new HttpClient
|
||||||
|
{
|
||||||
|
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress),
|
||||||
|
DefaultRequestVersion = HttpVersion.Version20,
|
||||||
|
DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrHigher
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
builder.Services.AddDevExpressBlazor(configure => configure.BootstrapVersion = BootstrapVersion.v5);
|
builder.Services.AddDevExpressBlazor(configure => configure.BootstrapVersion = BootstrapVersion.v5);
|
||||||
builder.Services.Configure<AnimationOptions>(Guid.NewGuid().ToString(), c => { });
|
builder.Services.Configure<AnimationOptions>(Guid.NewGuid().ToString(), c => { });
|
||||||
|
|
||||||
await builder.Build().RunAsync();
|
await builder.Build().RunAsync();
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ namespace TIAMWebApp.Client.Services
|
||||||
{
|
{
|
||||||
public class ComponentUpdateServiceWeb : IComponentUpdateService
|
public class ComponentUpdateServiceWeb : IComponentUpdateService
|
||||||
{
|
{
|
||||||
public event Action RefreshRequested;
|
public event Action? RefreshRequested;
|
||||||
|
|
||||||
public void CallRequestRefresh()
|
public void CallRequestRefresh()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
|
|
@ -16,9 +17,9 @@ namespace TIAMWebApp.Client.Services
|
||||||
public class PermissionService : IPermissionService
|
public class PermissionService : IPermissionService
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient http;
|
||||||
private readonly IAcLogWriterBase _browserConsoleLogWriter;
|
private readonly IAcLogWriterClientBase _browserConsoleLogWriter;
|
||||||
|
|
||||||
public PermissionService(HttpClient http, IAcLogWriterBase browserConsoleLogWriter)
|
public PermissionService(HttpClient http, IAcLogWriterClientBase browserConsoleLogWriter)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
this._browserConsoleLogWriter = browserConsoleLogWriter;
|
this._browserConsoleLogWriter = browserConsoleLogWriter;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ using TIAM.Models.Dtos.Users;
|
||||||
using ILogger = TIAM.Core.Loggers.ILogger;
|
using ILogger = TIAM.Core.Loggers.ILogger;
|
||||||
using LogLevel = AyCode.Core.Loggers.LogLevel;
|
using LogLevel = AyCode.Core.Loggers.LogLevel;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
|
|
||||||
|
|
||||||
namespace TIAMWebApp.Client.Services
|
namespace TIAMWebApp.Client.Services
|
||||||
|
|
@ -30,7 +31,7 @@ namespace TIAMWebApp.Client.Services
|
||||||
|
|
||||||
public Dictionary<int, string> userRoleTypes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
public Dictionary<int, string> userRoleTypes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||||
|
|
||||||
public UserDataServiceWeb(HttpClient http, ISecureStorageHandler secureStorageHandler, IJSRuntime jSRuntime, IServiceProviderDataService serviceProviderDataService, IEnumerable<IAcLogWriterBase> logWriters)
|
public UserDataServiceWeb(HttpClient http, ISecureStorageHandler secureStorageHandler, IJSRuntime jSRuntime, IServiceProviderDataService serviceProviderDataService, IEnumerable<IAcLogWriterClientBase> logWriters)
|
||||||
//public UserDataServiceWeb(HttpClient http, ISecureStorageHandler secureStorageHandler, IJSRuntime jSRuntime, IServiceProviderDataService serviceProviderDataService, HttpClientLogItemWriter logWriter)
|
//public UserDataServiceWeb(HttpClient http, ISecureStorageHandler secureStorageHandler, IJSRuntime jSRuntime, IServiceProviderDataService serviceProviderDataService, HttpClientLogItemWriter logWriter)
|
||||||
{
|
{
|
||||||
this.http = http;
|
this.http = http;
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,17 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
|
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.4" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.5" PrivateAssets="all" />
|
||||||
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
||||||
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.8" />
|
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\TIAM.Core\TIAM.Core.csproj" />
|
<ProjectReference Include="..\..\TIAM.Core\TIAM.Core.csproj" />
|
||||||
|
<ProjectReference Include="..\..\TIAM.Entities\TIAM.Entities.csproj" />
|
||||||
|
<ProjectReference Include="..\..\TIAM.Models\TIAM.Models.csproj" />
|
||||||
|
<ProjectReference Include="..\..\TIAM.Services\TIAM.Services.csproj" />
|
||||||
<ProjectReference Include="..\..\TIAMSharedUI\TIAMSharedUI.csproj" />
|
<ProjectReference Include="..\..\TIAMSharedUI\TIAMSharedUI.csproj" />
|
||||||
<ProjectReference Include="..\Shared\TIAMWebApp.Shared.Application.csproj" />
|
<ProjectReference Include="..\Shared\TIAMWebApp.Shared.Application.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
using AyCode.Core.Consts;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Core.Server.Loggers;
|
||||||
|
using AyCode.Entities;
|
||||||
|
using AyCode.Entities.Server.LogItems;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Cors;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using TIAMWebApp.Server.Services;
|
||||||
|
using TIAMWebApp.Shared.Application.Models;
|
||||||
|
|
||||||
|
namespace TIAMWebApp.Server.Controllers
|
||||||
|
{
|
||||||
|
[Authorize]
|
||||||
|
[ApiController]
|
||||||
|
[EnableCors("_myAllowSpecificOrigins")]
|
||||||
|
[Route("api/v1/[controller]")]
|
||||||
|
public class LoggerApiController(LoggerToLoggerApiController logger) : ControllerBase
|
||||||
|
{
|
||||||
|
// = new TIAM.Core.Loggers.Logger<LoggerApiController>();
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
|
[HttpPost]
|
||||||
|
[Route(APIUrls.LoggerRouteName)]
|
||||||
|
public async Task AddLogItem(AcLogItem? logItem)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (logItem == null)
|
||||||
|
{
|
||||||
|
logger.Error("AddLogItem; LogItem == null");
|
||||||
|
//_logger.Writer<ConsoleLogWriter>().Detail("");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//logItem.LogHeaderId = ???
|
||||||
|
logItem.TimeStampUtc = DateTime.UtcNow;
|
||||||
|
|
||||||
|
logger.Write(logItem);
|
||||||
|
|
||||||
|
//_logger.Writer<IAcConsoleLogWriter>()?.Write(logItem.AppType, logItem.LogLevel, logItem.Text, logItem.CallerName, logItem.CategoryName, logItem.ErrorType, logItem.Exception);
|
||||||
|
//_logger.Writer<DbLogItemWriter>().WriteLogItemAsync(logItem);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($@"ERROR!!! {nameof(LoggerApiController)}->WriteLogItem; ex: {ex.Message}{AcEnv.NL}{AcEnv.NL}{ex}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -26,9 +26,9 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly ILogger<TransferDataAPIController> _logger;
|
private readonly ILogger<PopulationStructureAPIController> _logger;
|
||||||
|
|
||||||
public PopulationStructureAPIController(ILogger<TransferDataAPIController> logger)
|
public PopulationStructureAPIController(ILogger<PopulationStructureAPIController> logger)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,11 @@
|
||||||
using DevExpress.Drawing;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using QRCoder;
|
using QRCoder;
|
||||||
using SkiaSharp;
|
|
||||||
using SkiaSharp.Views.Desktop;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
using System.Net;
|
|
||||||
using System.Text.Json;
|
|
||||||
using AyCode.Core.Server.Loggers;
|
using AyCode.Core.Server.Loggers;
|
||||||
using TIAM.Database.DataLayers.Admins;
|
using TIAM.Database.DataLayers.Admins;
|
||||||
//using TIAM.Database.DataLayers.ServiceProviders;
|
//using TIAM.Database.DataLayers.ServiceProviders;
|
||||||
using TIAM.Entities.Permissions;
|
|
||||||
using TIAM.Entities.Products;
|
|
||||||
using TIAM.Entities.ServiceProviders;
|
using TIAM.Entities.ServiceProviders;
|
||||||
using TIAM.Entities.Users;
|
using TIAM.Entities.Users;
|
||||||
using TIAMWebApp.Shared.Application.Models;
|
using TIAMWebApp.Shared.Application.Models;
|
||||||
|
|
@ -26,7 +18,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v1/[controller]")]
|
||||||
public class ServiceProviderAPIController : ControllerBase
|
public class ServiceProviderAPIController : ControllerBase
|
||||||
{
|
{
|
||||||
private AdminDal _adminDal;
|
private readonly AdminDal _adminDal;
|
||||||
|
|
||||||
private readonly ILogger<ServiceProviderAPIController> _logger;
|
private readonly ILogger<ServiceProviderAPIController> _logger;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Text.Json;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
using AyCode.Utils.Extensions;
|
using AyCode.Utils.Extensions;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
@ -6,30 +7,14 @@ using Microsoft.EntityFrameworkCore;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Newtonsoft.Json.Serialization;
|
using Newtonsoft.Json.Serialization;
|
||||||
using System.Linq.Expressions;
|
|
||||||
using System.Reflection.Metadata;
|
|
||||||
using System.ServiceModel.Channels;
|
|
||||||
using System.Text.Json;
|
|
||||||
using TIAM.Core.Enums;
|
using TIAM.Core.Enums;
|
||||||
using TIAM.Database.DataLayers;
|
|
||||||
using TIAM.Database.DataLayers.Admins;
|
using TIAM.Database.DataLayers.Admins;
|
||||||
using TIAM.Database.DataLayers.TransferDestinations;
|
|
||||||
using TIAM.Database.DataLayers.Users;
|
|
||||||
using TIAM.Database.DbContexts;
|
|
||||||
using TIAM.Database.DbSets.Transfers;
|
|
||||||
using TIAM.Entities.Emails;
|
using TIAM.Entities.Emails;
|
||||||
using TIAM.Entities.Products;
|
|
||||||
using TIAM.Entities.Transfers;
|
using TIAM.Entities.Transfers;
|
||||||
using TIAM.Entities.Users;
|
|
||||||
using TIAM.Services.Server;
|
using TIAM.Services.Server;
|
||||||
using TIAMWebApp.Shared.Application.Models;
|
using TIAMWebApp.Shared.Application.Models;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide.Messages;
|
using TIAMWebApp.Shared.Application.Models.ClientSide.Messages;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels;
|
using TIAMWebApp.Shared.Application.Services;
|
||||||
using TIAMWebApp.Shared.Application.Models.PageModels;
|
|
||||||
using ILogger = TIAM.Core.Loggers.ILogger;
|
|
||||||
using LogLevel = AyCode.Core.Loggers.LogLevel;
|
|
||||||
using TIAM.Core.Loggers;
|
|
||||||
using System.Security.Cryptography.Xml;
|
|
||||||
|
|
||||||
namespace TIAMWebApp.Server.Controllers
|
namespace TIAMWebApp.Server.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -50,18 +35,17 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
|
|
||||||
//};
|
//};
|
||||||
|
|
||||||
private readonly TransferDestinationDal _transferDestinationDal;
|
|
||||||
private readonly AdminDal _adminDal;
|
private readonly AdminDal _adminDal;
|
||||||
private readonly ILogger _logger;
|
private readonly TIAM.Core.Loggers.ILogger _logger;
|
||||||
private readonly TransferBackendService _transferBackendService;
|
private readonly TransferBackendService _transferBackendService;
|
||||||
private readonly IMessageSenderService _messageSenderService;
|
private readonly IMessageSenderService _messageSenderService;
|
||||||
|
|
||||||
public TransferDataAPIController(TransferDestinationDal transferDestinationDal, AdminDal adminDal, TransferBackendService transferBackendService, IMessageSenderService messageSenderService, IEnumerable<IAcLogWriterBase> logWriters)
|
public TransferDataAPIController(AdminDal adminDal, TransferBackendService transferBackendService, IMessageSenderService messageSenderService, IEnumerable<IAcLogWriterBase> logWriters)
|
||||||
{
|
{
|
||||||
_logger = new TIAM.Core.Loggers.Logger<UserAPIController>(logWriters.ToArray());
|
|
||||||
_transferDestinationDal = transferDestinationDal;
|
|
||||||
_adminDal = adminDal;
|
_adminDal = adminDal;
|
||||||
_transferBackendService = transferBackendService;
|
_transferBackendService = transferBackendService;
|
||||||
|
|
||||||
|
_logger = new TIAM.Core.Loggers.Logger<TransferDataAPIController>(logWriters.ToArray());
|
||||||
_messageSenderService = messageSenderService;
|
_messageSenderService = messageSenderService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -118,16 +102,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.Info($@"TransferDestination to be created: {id}");
|
_logger.Debug(transferDestination.ToString());
|
||||||
_logger.Info($@"TransferDestination to be created: {transferDestination.AddressId}");
|
|
||||||
_logger.Info($@"TransferDestination to be created: {transferDestination.Name}");
|
|
||||||
_logger.Info($@"TransferDestination to be created: {transferDestination.Price}");
|
|
||||||
_logger.Info($@"TransferDestination to be created: {transferDestination.Price2}");
|
|
||||||
_logger.Info($@"TransferDestination to be created: {transferDestination.Price3}");
|
|
||||||
_logger.Info($@"TransferDestination to be created: {transferDestination.ExtraPrice}");
|
|
||||||
//Console.WriteLine($"TransferDestination to be created: {transferDestination.ExtraPriceType}");
|
|
||||||
_logger.Info($@"TransferDestination to be created: {transferDestination.AddressString}");
|
|
||||||
_logger.Info($@"TransferDestination to be created: {transferDestination.Description}");
|
|
||||||
|
|
||||||
//await _transferDestinationDal.Context.TransferDestinations.AddAsync(transferDestination);
|
//await _transferDestinationDal.Context.TransferDestinations.AddAsync(transferDestination);
|
||||||
await _adminDal.AddTransferDestinationAsync(transferDestination);
|
await _adminDal.AddTransferDestinationAsync(transferDestination);
|
||||||
|
|
@ -153,7 +128,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
_logger.Info(@"UpdateTransferDestination called!");
|
_logger.Info(@"UpdateTransferDestination called!");
|
||||||
if (string.IsNullOrEmpty(serializedTransferDestination.GetRawText()))
|
if (string.IsNullOrEmpty(serializedTransferDestination.GetRawText()))
|
||||||
{
|
{
|
||||||
_logger.Info(@"Bad request!");
|
_logger.Error(@"Bad request!");
|
||||||
return BadRequest("SerializedTramsferDestinationWizardModel is required");
|
return BadRequest("SerializedTramsferDestinationWizardModel is required");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -172,7 +147,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
|
|
||||||
if (transferDestination.Id == Guid.Empty || string.IsNullOrEmpty(transferDestination.Name) || string.IsNullOrEmpty(transferDestination.AddressString))
|
if (transferDestination.Id == Guid.Empty || string.IsNullOrEmpty(transferDestination.Name) || string.IsNullOrEmpty(transferDestination.AddressString))
|
||||||
{
|
{
|
||||||
_logger.Info(@"Serialized model not empty, but bad request!");
|
_logger.Error(@"Serialized model not empty, but bad request!");
|
||||||
return BadRequest("Invalid request");
|
return BadRequest("Invalid request");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -188,7 +163,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
_logger.Info($@"TransferDestination to be updated new description: {transferDestination.Description}");
|
_logger.Info($@"TransferDestination to be updated new description: {transferDestination.Description}");
|
||||||
|
|
||||||
//var dbTransferDestinationJson = _adminDal.GetTransferDestinationJsonById(transferDestination.Id);
|
//var dbTransferDestinationJson = _adminDal.GetTransferDestinationJsonById(transferDestination.Id);
|
||||||
//Console.WriteLine($"TransferDestination JSON to be updated: {dbTransferDestinationJson}");
|
//_logger.Info($"TransferDestination JSON to be updated: {dbTransferDestinationJson}");
|
||||||
|
|
||||||
//var dbTransferDestination = JObject.Parse(dbTransferDestinationJson).ToObject<TransferDestination>();
|
//var dbTransferDestination = JObject.Parse(dbTransferDestinationJson).ToObject<TransferDestination>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,11 @@ using TIAM.Database.DataLayers.Users;
|
||||||
using TIAM.Entities.Users;
|
using TIAM.Entities.Users;
|
||||||
using TIAM.Models.Dtos.Users;
|
using TIAM.Models.Dtos.Users;
|
||||||
using TIAM.Database.DataLayers.Admins;
|
using TIAM.Database.DataLayers.Admins;
|
||||||
using AyCode.Core.Enums;
|
|
||||||
using AyCode.Core.Server.Loggers;
|
|
||||||
using AyCode.Entities.LogItems;
|
|
||||||
using AyCode.Entities.Server.LogItems;
|
using AyCode.Entities.Server.LogItems;
|
||||||
using TIAM.Database;
|
|
||||||
using TIAM.Entities.Profiles;
|
using TIAM.Entities.Profiles;
|
||||||
using TIAM.Entities.Addresses;
|
using TIAM.Entities.Addresses;
|
||||||
using TIAM.Services.Server.Logins;
|
using TIAM.Services.Server.Logins;
|
||||||
using TIAMWebApp.Shared.Application.Utility;
|
|
||||||
using ILogger = TIAM.Core.Loggers.ILogger;
|
using ILogger = TIAM.Core.Loggers.ILogger;
|
||||||
using LogLevel = AyCode.Core.Loggers.LogLevel;
|
|
||||||
using TIAM.Core.Loggers;
|
|
||||||
|
|
||||||
namespace TIAMWebApp.Server.Controllers
|
namespace TIAMWebApp.Server.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -33,9 +26,8 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
{
|
{
|
||||||
private LoginService _loginService;
|
private LoginService _loginService;
|
||||||
private UserDal _userDal;
|
private UserDal _userDal;
|
||||||
private AdminDal _adminDal;
|
|
||||||
private readonly IConfiguration _configuration;
|
private readonly IConfiguration _configuration;
|
||||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
//private readonly IWebHostEnvironment _webHostEnvironment;
|
||||||
//readonly PasswordHasher _hasher = new();
|
//readonly PasswordHasher _hasher = new();
|
||||||
|
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
|
@ -48,36 +40,37 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
|
|
||||||
//private readonly ILogger<UserAPIController> _logger;
|
//private readonly ILogger<UserAPIController> _logger;
|
||||||
|
|
||||||
public UserAPIController(IConfiguration configuration, IWebHostEnvironment webHostEnvironment, UserDal userDal, AdminDal adminDal, IEnumerable<IAcLogWriterBase> logWriters)
|
public UserAPIController(IConfiguration configuration, UserDal userDal, IEnumerable<IAcLogWriterBase> logWriters)
|
||||||
{
|
{
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
_webHostEnvironment = webHostEnvironment;
|
//_webHostEnvironment = webHostEnvironment;
|
||||||
_userDal = userDal;
|
_userDal = userDal;
|
||||||
_adminDal = adminDal;
|
|
||||||
|
|
||||||
_loginService = new LoginService(_userDal, _configuration);
|
_loginService = new LoginService(_userDal, _configuration);
|
||||||
|
|
||||||
_logger = new TIAM.Core.Loggers.Logger<UserAPIController>(logWriters.ToArray());
|
_logger = new TIAM.Core.Loggers.Logger<UserAPIController>(logWriters.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
[AllowAnonymous]
|
//[AllowAnonymous]
|
||||||
[HttpPost]
|
//[HttpPost]
|
||||||
[Route(APIUrls.LoggerRouteName)]
|
//[Route(APIUrls.LoggerRouteName)]
|
||||||
public async Task AddLogItem(AcLogItem? logItem)
|
//public async Task AddLogItem(AcLogItem? logItem)
|
||||||
{
|
//{
|
||||||
if (logItem == null)
|
// if (logItem == null)
|
||||||
{
|
// {
|
||||||
_logger.Error("AddLogItem; LogItem == null");
|
// _logger.Error("AddLogItem; LogItem == null");
|
||||||
//_logger.Writer<ConsoleLogWriter>().Detail("");
|
// //_logger.Writer<ConsoleLogWriter>().Detail("");
|
||||||
|
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
//logItem.LogHeaderId = ???
|
// //logItem.LogHeaderId = ???
|
||||||
|
// logItem.TimeStampUtc = DateTime.UtcNow;
|
||||||
|
|
||||||
|
// _logger.Write(logItem);
|
||||||
|
|
||||||
_logger.Writer<IAcConsoleLogWriter>()?.Write(logItem.AppType, logItem.LogLevel, logItem.Text, logItem.CallerName, logItem.CategoryName, logItem.ErrorType, logItem.Exception);
|
// //_logger.Writer<IAcConsoleLogWriter>()?.Write(logItem.AppType, logItem.LogLevel, logItem.Text, logItem.CallerName, logItem.CategoryName, logItem.ErrorType, logItem.Exception);
|
||||||
_logger.Writer<DbLogItemWriter>().WriteLogItemAsync(logItem);
|
// //_logger.Writer<DbLogItemWriter>().WriteLogItemAsync(logItem);
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
|
|
@ -121,7 +114,7 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
return Ok(response);
|
return Ok(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Info(@"User not valid! errorCode: " + loggedInModel.LoginErrorCode);
|
_logger.Warning(@"User not valid! errorCode: " + loggedInModel.LoginErrorCode);
|
||||||
return Unauthorized();
|
return Unauthorized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,26 @@ using TIAM.Database.DataLayers.Users;
|
||||||
using TIAM.Entities.Emails;
|
using TIAM.Entities.Emails;
|
||||||
using TIAM.Services.Server;
|
using TIAM.Services.Server;
|
||||||
using TIAMWebApp.Shared.Application.Utility;
|
using TIAMWebApp.Shared.Application.Utility;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using TIAMWebApp.Server.Controllers;
|
||||||
|
using TIAMWebApp.Server.Services;
|
||||||
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||||
|
|
||||||
//using TIAM.Database.DataLayers.ServiceProviders;
|
//using TIAM.Database.DataLayers.ServiceProviders;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
string MyAllowSpecificOrigins = "_myAllowSpecificOrigins";
|
const string myAllowSpecificOrigins = "_myAllowSpecificOrigins";
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
|
|
||||||
builder.Services.AddControllersWithViews();
|
builder.Services.AddControllersWithViews();
|
||||||
builder.Services.AddRazorPages();
|
builder.Services.AddRazorPages();
|
||||||
//builder.Services.AddDbContext<TransferDestinationDbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("DeveloperDbConnection")));;
|
|
||||||
builder.Services.AddScoped<IAcLogWriterBase, ConsoleLogWriter>();
|
builder.Services.AddSingleton<LoggerToLoggerApiController>();
|
||||||
builder.Services.AddScoped<IAcLogWriterBase, DbLogItemWriter>();
|
builder.Services.AddSingleton<IAcLogWriterBase, ConsoleLogWriter>();
|
||||||
|
builder.Services.AddSingleton<IAcLogWriterBase, DbLogItemWriter>();
|
||||||
|
|
||||||
builder.Services.AddScoped<UserDal>();
|
builder.Services.AddScoped<UserDal>();
|
||||||
builder.Services.AddScoped<AdminDal>();
|
builder.Services.AddScoped<AdminDal>();
|
||||||
builder.Services.AddScoped<AuctionDal>();
|
builder.Services.AddScoped<AuctionDal>();
|
||||||
|
|
@ -33,9 +40,9 @@ builder.Services.AddScoped<TransferDestinationDal>();
|
||||||
|
|
||||||
|
|
||||||
builder.Services.AddCors(options => {
|
builder.Services.AddCors(options => {
|
||||||
options.AddPolicy(MyAllowSpecificOrigins,
|
options.AddPolicy(myAllowSpecificOrigins,
|
||||||
builder => {
|
policy => {
|
||||||
builder.AllowAnyOrigin();
|
policy.AllowAnyOrigin();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -75,7 +82,7 @@ builder.Services.AddAuthentication(f =>
|
||||||
f.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
f.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
}).AddJwtBearer(k =>
|
}).AddJwtBearer(k =>
|
||||||
{
|
{
|
||||||
var Key = Encoding.UTF8.GetBytes(builder.Configuration["JWT:Key"]);
|
var key = Encoding.UTF8.GetBytes(builder.Configuration["JWT:Key"]);
|
||||||
k.SaveToken = true;
|
k.SaveToken = true;
|
||||||
k.TokenValidationParameters = new TokenValidationParameters
|
k.TokenValidationParameters = new TokenValidationParameters
|
||||||
{
|
{
|
||||||
|
|
@ -85,7 +92,7 @@ builder.Services.AddAuthentication(f =>
|
||||||
ValidateIssuerSigningKey = true,
|
ValidateIssuerSigningKey = true,
|
||||||
ValidIssuer = builder.Configuration["JWT:Issuer"],
|
ValidIssuer = builder.Configuration["JWT:Issuer"],
|
||||||
ValidAudience = builder.Configuration["JWT:Audience"],
|
ValidAudience = builder.Configuration["JWT:Audience"],
|
||||||
IssuerSigningKey = new SymmetricSecurityKey(Key),
|
IssuerSigningKey = new SymmetricSecurityKey(key),
|
||||||
ClockSkew = TimeSpan.Zero
|
ClockSkew = TimeSpan.Zero
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -108,6 +115,16 @@ builder.Services.ConfigureApplicationCookie(options =>
|
||||||
options.SlidingExpiration = true;
|
options.SlidingExpiration = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
builder.WebHost.ConfigureKestrel((context, options) =>
|
||||||
|
{
|
||||||
|
options.ListenAnyIP(7116, listenOptions =>
|
||||||
|
{
|
||||||
|
listenOptions.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
|
||||||
|
listenOptions.UseHttps();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -139,7 +156,7 @@ app.UseStaticFiles();
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
//cors
|
//cors
|
||||||
app.UseCors(MyAllowSpecificOrigins);
|
app.UseCors(myAllowSpecificOrigins);
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
app.UsePathBase("/");
|
app.UsePathBase("/");
|
||||||
app.MapRazorPages();
|
app.MapRazorPages();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
using TIAMWebApp.Server.Controllers;
|
||||||
|
|
||||||
|
namespace TIAMWebApp.Server.Services;
|
||||||
|
|
||||||
|
public class LoggerToLoggerApiController : TIAM.Core.Loggers.Logger<LoggerApiController>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
@ -10,18 +10,18 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="GoogleApi" Version="5.4.0" />
|
<PackageReference Include="GoogleApi" Version="5.4.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.OpenApi" Version="1.6.14" />
|
<PackageReference Include="Microsoft.OpenApi" Version="1.6.14" />
|
||||||
<PackageReference Include="QRCoderNetCore" Version="1.0.0" />
|
<PackageReference Include="QRCoderNetCore" Version="1.0.0" />
|
||||||
<PackageReference Include="SendGrid" Version="9.29.3" />
|
<PackageReference Include="SendGrid" Version="9.29.3" />
|
||||||
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
||||||
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.8" />
|
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.8" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.6.1" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.6.1" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.6.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
@ -76,9 +76,5 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Services\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ namespace TIAMWebApp.Shared.Application.Models
|
||||||
public const string BaseUrlWithSlash = BaseUrl + "/";
|
public const string BaseUrlWithSlash = BaseUrl + "/";
|
||||||
public const string BaseUrlWithSlashAndVersion = BaseUrlWithSlash + "v1/";
|
public const string BaseUrlWithSlashAndVersion = BaseUrlWithSlash + "v1/";
|
||||||
|
|
||||||
|
public const string LoggerApi = BaseUrlWithSlashAndVersion + "LoggerApi/";
|
||||||
|
|
||||||
public const string UserAPI = BaseUrlWithSlashAndVersion + "UserAPI/";
|
public const string UserAPI = BaseUrlWithSlashAndVersion + "UserAPI/";
|
||||||
public const string WeatherForecastAPI = BaseUrlWithSlashAndVersion + "WeatherForecastAPI/";
|
public const string WeatherForecastAPI = BaseUrlWithSlashAndVersion + "WeatherForecastAPI/";
|
||||||
public const string PopulationStructureAPI = BaseUrlWithSlashAndVersion + "PopulationStructureAPI/";
|
public const string PopulationStructureAPI = BaseUrlWithSlashAndVersion + "PopulationStructureAPI/";
|
||||||
|
|
@ -16,6 +18,9 @@ namespace TIAMWebApp.Shared.Application.Models
|
||||||
public const string FileAPI = BaseUrlWithSlashAndVersion + "FileAPI/";
|
public const string FileAPI = BaseUrlWithSlashAndVersion + "FileAPI/";
|
||||||
public const string MessageAPI = BaseUrlWithSlashAndVersion + "MessageAPI/";
|
public const string MessageAPI = BaseUrlWithSlashAndVersion + "MessageAPI/";
|
||||||
|
|
||||||
|
public const string LoggerRouteName = "Logger";
|
||||||
|
public const string Logger = LoggerApi + LoggerRouteName;
|
||||||
|
|
||||||
//userdata
|
//userdata
|
||||||
public const string UserTestRouteName = "test1";
|
public const string UserTestRouteName = "test1";
|
||||||
public const string UserTest = UserAPI + UserTestRouteName;
|
public const string UserTest = UserAPI + UserTestRouteName;
|
||||||
|
|
@ -41,9 +46,6 @@ namespace TIAMWebApp.Shared.Application.Models
|
||||||
public const string LogoutUserRouteName = "LogoutUser";
|
public const string LogoutUserRouteName = "LogoutUser";
|
||||||
public const string LogoutUser = UserAPI + LogoutUserRouteName;
|
public const string LogoutUser = UserAPI + LogoutUserRouteName;
|
||||||
|
|
||||||
public const string LoggerRouteName = "Logger";
|
|
||||||
public const string Logger = UserAPI + LoggerRouteName;
|
|
||||||
|
|
||||||
public const string CreateUserRouteName = "CreateUser";
|
public const string CreateUserRouteName = "CreateUser";
|
||||||
public const string CreateUser = UserAPI + CreateUserRouteName;
|
public const string CreateUser = UserAPI + CreateUserRouteName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using TIAM.Entities.Addresses;
|
||||||
using TIAM.Entities.Transfers;
|
using TIAM.Entities.Transfers;
|
||||||
using TIAM.Resources;
|
using TIAM.Resources;
|
||||||
|
|
||||||
|
|
@ -136,8 +137,13 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
return FirstName + " " + LastName;
|
return FirstName + " " + LastName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return $"{nameof(Id)}: {Id}; {nameof(Destination)}: {Destination}; {nameof(PickupAddress)}: {PickupAddress}; {nameof(TripDate)}: {TripDate}; {nameof(NumberOfPassengers)}: {NumberOfPassengers}; " +
|
||||||
|
$"{nameof(FirstName)}: {FirstName}; {nameof(LastName)}: {LastName}; {nameof(PhoneNumber)}: {PhoneNumber}; {nameof(EmailAddress)}: {EmailAddress};";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
|
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
|
||||||
public class DestinationAttribute : ValidationAttribute
|
public class DestinationAttribute : ValidationAttribute
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
using TIAM.Core.Loggers;
|
||||||
using TIAM.Entities.Transfers;
|
using TIAM.Entities.Transfers;
|
||||||
using TIAMWebApp.Shared.Application.Interfaces;
|
using TIAMWebApp.Shared.Application.Interfaces;
|
||||||
using TIAMWebApp.Shared.Application.Models;
|
using TIAMWebApp.Shared.Application.Models;
|
||||||
|
|
@ -12,13 +14,13 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
{
|
{
|
||||||
public class TransferDataService : ITransferDataService
|
public class TransferDataService : ITransferDataService
|
||||||
{
|
{
|
||||||
private readonly HttpClient http;
|
private readonly HttpClient _http;
|
||||||
private readonly IAcLogWriterBase _browserConsoleLogWriter;
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
public TransferDataService(HttpClient http, IAcLogWriterBase browserConsoleLogWriter)
|
public TransferDataService(HttpClient http, IEnumerable<IAcLogWriterClientBase> logWriters)
|
||||||
{
|
{
|
||||||
this.http = http;
|
_http = http;
|
||||||
this._browserConsoleLogWriter = browserConsoleLogWriter;
|
_logger = new LoggerClient<TransferDataService>(logWriters.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -27,8 +29,8 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
|
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferDestinations}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferDestinations}";
|
||||||
//var url = $"{APIUrls.GetTransferDestinations}";
|
//var url = $"{APIUrls.GetTransferDestinations}";
|
||||||
_browserConsoleLogWriter.Info(url);
|
_logger.Info(url);
|
||||||
List<TransferDestination>? response = await http.GetFromJsonAsync<List<TransferDestination>>(url);
|
List<TransferDestination>? response = await _http.GetFromJsonAsync<List<TransferDestination>>(url);
|
||||||
if(response == null)
|
if(response == null)
|
||||||
return new List<TransferDestination>();
|
return new List<TransferDestination>();
|
||||||
return response;
|
return response;
|
||||||
|
|
@ -37,19 +39,19 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
public async Task<TransferDestination?> GetTransferDestinationbyCoordinatesAsync(string destinationId)
|
public async Task<TransferDestination?> GetTransferDestinationbyCoordinatesAsync(string destinationId)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferDestinationByCoordinates}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferDestinationByCoordinates}";
|
||||||
return await http.GetFromJsonAsync<TransferDestination>(url);
|
return await _http.GetFromJsonAsync<TransferDestination>(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<TransferDestination?> GetTransferDestinationbyAddressAsync(string destinationId)
|
public async Task<TransferDestination?> GetTransferDestinationbyAddressAsync(string destinationId)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferDestinationByAddress}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferDestinationByAddress}";
|
||||||
return await http.GetFromJsonAsync<TransferDestination>(url);
|
return await _http.GetFromJsonAsync<TransferDestination>(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<TransferDestination?> CreateTransferDestination(TransferDestination model)
|
public async Task<TransferDestination?> CreateTransferDestination(TransferDestination model)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransferDestination}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransferDestination}";
|
||||||
var response = await http.PostAsJsonAsync(url, model);
|
var response = await _http.PostAsJsonAsync(url, model);
|
||||||
|
|
||||||
//var result = new WizardProcessorResult();
|
//var result = new WizardProcessorResult();
|
||||||
|
|
||||||
|
|
@ -69,20 +71,16 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
|
|
||||||
public async Task<Transfer?> CreateTransfer(TransferWizardModel model)
|
public async Task<Transfer?> CreateTransfer(TransferWizardModel model)
|
||||||
{
|
{
|
||||||
_browserConsoleLogWriter.Info("CreateTransfer called");
|
_logger.Info("CreateTransfer called");
|
||||||
_browserConsoleLogWriter.Info(model.PickupAddress);
|
|
||||||
_browserConsoleLogWriter.Info(model.Destination);
|
|
||||||
_browserConsoleLogWriter.Info(model.EmailAddress);
|
|
||||||
_browserConsoleLogWriter.Info(model.PhoneNumber);
|
|
||||||
_browserConsoleLogWriter.Info(model.TripDate.ToString());
|
|
||||||
_browserConsoleLogWriter.Info(model.NumberOfPassengers.ToString());
|
|
||||||
model.Id = Guid.NewGuid();
|
model.Id = Guid.NewGuid();
|
||||||
|
_logger.Debug(model.ToString());
|
||||||
|
|
||||||
var transfer = model.CopyToTransfer();
|
var transfer = model.CopyToTransfer();
|
||||||
|
|
||||||
|
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransfer}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransfer}";
|
||||||
var response = await http.PostAsJsonAsync(url, transfer);
|
var response = await _http.PostAsJsonAsync(url, transfer);
|
||||||
|
|
||||||
|
|
||||||
//var result = new WizardProcessorResult();
|
//var result = new WizardProcessorResult();
|
||||||
|
|
@ -112,7 +110,7 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransfers}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.CreateTransfers}";
|
||||||
var response = await http.PostAsJsonAsync(url, transferList);
|
var response = await _http.PostAsJsonAsync(url, transferList);
|
||||||
|
|
||||||
|
|
||||||
//var result = new WizardProcessorResult();
|
//var result = new WizardProcessorResult();
|
||||||
|
|
@ -134,7 +132,7 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
public async Task<TransferDestination?> UpdateTransferDestination(TransferDestination model)
|
public async Task<TransferDestination?> UpdateTransferDestination(TransferDestination model)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.UpdateTransferDestination}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.UpdateTransferDestination}";
|
||||||
var response = await http.PostAsJsonAsync(url, model);
|
var response = await _http.PostAsJsonAsync(url, model);
|
||||||
|
|
||||||
//var result = new WizardProcessorResult();
|
//var result = new WizardProcessorResult();
|
||||||
|
|
||||||
|
|
@ -156,8 +154,8 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
{
|
{
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferById}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransferById}";
|
||||||
//var url = $"{APIUrls.GetTransferDestinations}";
|
//var url = $"{APIUrls.GetTransferDestinations}";
|
||||||
_browserConsoleLogWriter.Info(url);
|
_logger.Info(url);
|
||||||
Transfer? response = await http.GetFromJsonAsync<Transfer>(url);
|
Transfer? response = await _http.GetFromJsonAsync<Transfer>(url);
|
||||||
if (response == null)
|
if (response == null)
|
||||||
return new Transfer();
|
return new Transfer();
|
||||||
return response;
|
return response;
|
||||||
|
|
@ -167,14 +165,14 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
{
|
{
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransfers}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.GetTransfers}";
|
||||||
//var url = $"{APIUrls.GetTransferDestinations}";
|
//var url = $"{APIUrls.GetTransferDestinations}";
|
||||||
_browserConsoleLogWriter.Info(url);
|
_logger.Info(url);
|
||||||
//add json settings ignore readonly properties
|
//add json settings ignore readonly properties
|
||||||
JsonSerializerOptions options = new JsonSerializerOptions
|
JsonSerializerOptions options = new JsonSerializerOptions
|
||||||
{
|
{
|
||||||
IgnoreReadOnlyProperties = true
|
IgnoreReadOnlyProperties = true
|
||||||
};
|
};
|
||||||
|
|
||||||
List<Transfer>? response = await http.GetFromJsonAsync<List<Transfer>>(url, options);
|
List<Transfer>? response = await _http.GetFromJsonAsync<List<Transfer>>(url, options);
|
||||||
if (response == null)
|
if (response == null)
|
||||||
return new List<Transfer>();
|
return new List<Transfer>();
|
||||||
return response;
|
return response;
|
||||||
|
|
@ -183,7 +181,7 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
public async Task<bool> UpdateTransferAsync(Transfer model)
|
public async Task<bool> UpdateTransferAsync(Transfer model)
|
||||||
{
|
{
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.UpdateTransfer}";
|
var url = $"{Setting.ApiBaseUrl}/{APIUrls.UpdateTransfer}";
|
||||||
var response = await http.PostAsJsonAsync(url, model);
|
var response = await _http.PostAsJsonAsync(url, model);
|
||||||
|
|
||||||
//var result = new WizardProcessorResult();
|
//var result = new WizardProcessorResult();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.5" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
|
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
|
||||||
<PackageReference Include="Microsoft.JSInterop" Version="8.0.4" />
|
<PackageReference Include="Microsoft.JSInterop" Version="8.0.5" />
|
||||||
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
||||||
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.8" />
|
<PackageReference Include="SkiaSharp.Views.Desktop.Common" Version="2.88.8" />
|
||||||
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
|
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using AyCode.Core.Consts;
|
using AyCode.Core.Consts;
|
||||||
using AyCode.Core.Enums;
|
using AyCode.Core.Enums;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
using Microsoft.JSInterop;
|
using Microsoft.JSInterop;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||||
|
|
||||||
|
|
@ -16,7 +17,7 @@ namespace TIAMWebApp.Shared.Application.Utility;
|
||||||
// { }
|
// { }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
public class BrowserConsoleLogWriter : AcTextLogWriterBase
|
public class BrowserConsoleLogWriter : AcTextLogWriterBase, IAcLogWriterClientBase
|
||||||
{
|
{
|
||||||
private readonly IJSRuntime _jsRuntime;
|
private readonly IJSRuntime _jsRuntime;
|
||||||
|
|
||||||
|
|
@ -30,7 +31,7 @@ public class BrowserConsoleLogWriter : AcTextLogWriterBase
|
||||||
_jsRuntime = jsRuntime;
|
_jsRuntime = jsRuntime;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void WriteText(string? logText)
|
protected override void WriteText(string? logText, LogLevel logLevel)
|
||||||
{
|
{
|
||||||
_jsRuntime.InvokeVoidAsync("console.log", logText);
|
_jsRuntime.InvokeVoidAsync("console.log", logText);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,14 @@
|
||||||
using AyCode.Entities.LogItems;
|
using AyCode.Services.Loggers;
|
||||||
using AyCode.Services.Loggers;
|
|
||||||
using static System.Net.WebRequestMethods;
|
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||||
using TIAMWebApp.Shared.Application.Models.PageModels;
|
|
||||||
using TIAMWebApp.Shared.Application.Models;
|
using TIAMWebApp.Shared.Application.Models;
|
||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
|
using AyCode.Core.Helpers;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
|
||||||
namespace TIAMWebApp.Shared.Application.Utility;
|
namespace TIAMWebApp.Shared.Application.Utility;
|
||||||
|
|
||||||
public class HttpClientLogItemWriter : AcHttpClientLogItemWriter<AcLogItemClient>
|
public class HttpClientLogItemWriter : AcHttpClientLogItemWriter<AcLogItemClient>
|
||||||
{
|
{
|
||||||
public HttpClientLogItemWriter(HttpClient httpClient) : base(httpClient)
|
public HttpClientLogItemWriter(HttpClient httpClient) : base(httpClient, $"{Setting.ApiBaseUrl}/{APIUrls.Logger}")
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
protected override void WriteLogItemCallback(AcLogItemClient logItem)
|
|
||||||
{
|
|
||||||
var url = $"{Setting.ApiBaseUrl}/{APIUrls.Logger}";
|
|
||||||
|
|
||||||
_httpClient.PostAsJsonAsync(url, logItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using AyCode.Core.Enums;
|
using AyCode.Core.Enums;
|
||||||
using AyCode.Core.Loggers;
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
using TIAM.Core.Loggers;
|
using TIAM.Core.Loggers;
|
||||||
|
|
||||||
namespace TIAMWebApp.Shared.Application.Utility;
|
namespace TIAMWebApp.Shared.Application.Utility;
|
||||||
|
|
@ -9,9 +10,9 @@ public class LoggerClient<TCategory> : Logger, ILogger<TCategory>
|
||||||
public LoggerClient() : base(AppType.Web, LogLevel.Detail, typeof(TCategory).Name)
|
public LoggerClient() : base(AppType.Web, LogLevel.Detail, typeof(TCategory).Name)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public LoggerClient(params IAcLogWriterBase[] logWriters) : base(AppType.Web, LogLevel.Detail, typeof(TCategory).Name, logWriters)
|
public LoggerClient(params IAcLogWriterClientBase[] logWriters) : base(AppType.Web, LogLevel.Detail, typeof(TCategory).Name, logWriters)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public LoggerClient(AppType appType, LogLevel logLevel, params IAcLogWriterBase[] logWriters) : base(appType, logLevel, typeof(TCategory).Name, logWriters)
|
public LoggerClient(AppType appType, LogLevel logLevel, params IAcLogWriterClientBase[] logWriters) : base(appType, logLevel, typeof(TCategory).Name, logWriters)
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue