This commit is contained in:
Adam 2024-06-26 11:06:25 +02:00
parent 422a1c0bab
commit 0b042063af
3 changed files with 18 additions and 16 deletions

View File

@ -5,7 +5,6 @@
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels @using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
@using AyCode.Services.Loggers @using AyCode.Services.Loggers
@layout AdminLayout @layout AdminLayout
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
@inject IStringLocalizer<TIAMResources> localizer @inject IStringLocalizer<TIAMResources> localizer
<PageTitle>Transfers</PageTitle> <PageTitle>Transfers</PageTitle>

View File

@ -3,10 +3,11 @@ using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels;
using TIAMWebApp.Shared.Application.Interfaces; using TIAMWebApp.Shared.Application.Interfaces;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using TIAMWebApp.Shared.Application.Utility; using TIAMWebApp.Shared.Application.Utility;
using AyCode.Services.Loggers;
namespace TIAMSharedUI.Pages.User.SysAdmins namespace TIAMSharedUI.Pages.User.SysAdmins
{ {
public partial class TransferDestinations public partial class ManageTransferDestinations : ComponentBase
{ {
IGrid Grid { get; set; } IGrid Grid { get; set; }
@ -22,6 +23,8 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
[Inject] [Inject]
public ITransferDataService TransferDataService { get; set; } public ITransferDataService TransferDataService { get; set; }
[Inject]
public IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
/*object? TransferData = new TransferDestinationWizardModel[] /*object? TransferData = new TransferDestinationWizardModel[]
{ {
@ -34,9 +37,9 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
new TransferDestinationWizardModel(Guid.NewGuid(), "Margaret Island", "Historical site in the heart of Budapest", "1138 Budapest, Margitsziget" ), new TransferDestinationWizardModel(Guid.NewGuid(), "Margaret Island", "Historical site in the heart of Budapest", "1138 Budapest, Margitsziget" ),
};*/ };*/
private LoggerClient<TransferDestinations> _logger; private LoggerClient<ManageTransferDestinations> _logger;
private readonly List<TransferDestinationWizardModel> _transferDestinationWizardModels = []; public readonly List<TransferDestinationWizardModel> _transferDestinationWizardModels = [];
void CancelCreateClick() void CancelCreateClick()
{ {
@ -64,11 +67,12 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
} }
protected override async Task OnAfterRenderAsync(bool firstRender) //protected override async Task OnAfterRenderAsync(bool firstRender)
{ //{
//if (firstRender) // //if (firstRender)
// await Grid.StartEditRowAsync(0); // // await Grid.StartEditRowAsync(0);
} // throw new NotImplementedException();
//}
void Grid_CustomizeEditModel(GridCustomizeEditModelEventArgs e) void Grid_CustomizeEditModel(GridCustomizeEditModelEventArgs e)
{ {
@ -158,7 +162,7 @@ namespace TIAMSharedUI.Pages.User.SysAdmins
{ {
base.OnInitialized(); base.OnInitialized();
_logger = new LoggerClient<TransferDestinations>(LogWriters.ToArray()); _logger = new LoggerClient<ManageTransferDestinations>(LogWriters.ToArray());
await FillGridDataSource(); await FillGridDataSource();
} }

View File

@ -23,7 +23,6 @@
<ProductGrid @ref="_productGrid" <ProductGrid @ref="_productGrid"
ContextIds="new[] {ContextId}"
DataSource="ParentData?.Products ?? []" DataSource="ParentData?.Products ?? []"
GetAllMessageTag="GetAllTag" GetAllMessageTag="GetAllTag"
Logger="_logger" Logger="_logger"
@ -91,11 +90,11 @@
[Parameter] public int GetAllTag { get; set; } = SignalRTags.GetProductsByContextId; [Parameter] public int GetAllTag { get; set; } = SignalRTags.GetProductsByContextId;
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never; [Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
private ProductDetailGrid _productGrid = null!; private ProductGrid _productGrid = null!;
private LoggerClient<ProductDetailGridComponent> _logger = null!; private LoggerClient<ProductGridComponent> _logger = null!;
protected override void OnInitialized() protected override void OnInitialized()
{ {
_logger = new LoggerClient<ProductDetailGridComponent>(LogWriters.ToArray()); _logger = new LoggerClient<ProductGridComponent>(LogWriters.ToArray());
//DataSource = new List<Address>(); //DataSource = new List<Address>();
} }
@ -170,7 +169,7 @@
var newProduct = (Product)e.EditModel; var newProduct = (Product)e.EditModel;
newProduct.Id = Guid.NewGuid(); newProduct.Id = Guid.NewGuid();
newProduct.Name = "Type a name"; newProduct.Name = "Type a name";
newProduct.ServiceProviderId = (Guid)ContextId!; newProduct.ServiceProviderId = Guid.NewGuid();
newProduct.Price = 0; newProduct.Price = 0;
newProduct.ProductType = TIAM.Core.Enums.ProductType.Hotel; newProduct.ProductType = TIAM.Core.Enums.ProductType.Hotel;
newProduct.Description = "Type a description"; newProduct.Description = "Type a description";