@using TIAM.Entities.Addresses @using TIAM.Entities.Transfers @using TIAM.Entities.Drivers @using TIAM.Models.Dtos.Users @using TIAM.Resources @using TIAM.Services @using TIAMSharedUI.Shared.Components.Grids @using TIAMWebApp.Shared.Application.Interfaces @using TIAMWebApp.Shared.Application.Utility @using TIAM.Core.Loggers @using AyCode.Core.Loggers @using AyCode.Services.Loggers @using TIAMWebApp.Shared.Application.Services @using AyCode.Core.Enums @using AyCode.Core.Extensions @using AyCode.Core @inject IUserDataService UserDataService @inject IEnumerable LogWriters @inject AdminSignalRClient AdminSignalRClient; @inject IStringLocalizer localizer @{ var keyField = context.Value; @context.Value } @{ var transfer = (TransferDestination)editFormContext.EditModel; } @editFormContext.GetEditor("Name") @editFormContext.GetEditor("AddressString") @editFormContext.GetEditor("Price") @editFormContext.GetEditor("Price2") @editFormContext.GetEditor("Price3") @editFormContext.GetEditor("ProductCommis") @editFormContext.GetEditor("ExtraPrice") @editFormContext.GetEditor("Description") @code { [Parameter] public Guid? ContextId { get; set; } [Parameter] public int GetAllTag { get; set; } [Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never; private TransferDestinationGrid _transferToDriversGrid = null!; private LoggerClient _logger = null!; protected override void OnInitialized() { _logger = new LoggerClient(LogWriters.ToArray()); } private void DataItemChanged(GridDataItemChangedEventArgs args) { } private void DataItemSaving(GridEditModelSavingEventArgs obj) { _logger.Debug($"DataItemSaving"); } private void DataItemDeleting(GridDataItemDeletingEventArgs obj) { _logger.Debug($"DataItemDeleting"); } void CustomizeEditModel(GridCustomizeEditModelEventArgs e) { if (!e.IsNew) return; var newDestination = (TransferDestination)e.EditModel; newDestination.Id = Guid.NewGuid(); newDestination.Name = "Destination name"; newDestination.Description = "Type some description here"; newDestination.AddressString = "The address of the destination"; Guid addressId = Guid.NewGuid(); newDestination.Address = new Address(); newDestination.Address.Id = addressId; newDestination.Address.AddressText = newDestination.AddressString; } }