93 lines
4.2 KiB
Plaintext
93 lines
4.2 KiB
Plaintext
@using TIAM.Entities.Products
|
|
@using TIAM.Entities.ServiceProviders
|
|
@using TIAM.Entities.Transfers
|
|
@using TIAM.Entities.Drivers
|
|
@using TIAM.Entities.Users
|
|
@using TIAM.Models.Dtos.Users
|
|
@using TIAMWebApp.Shared.Application.Interfaces
|
|
@using TIAMWebApp.Shared.Application.Utility
|
|
@using AyCode.Services.Loggers
|
|
@using TIAM.Core.Loggers
|
|
@using TIAM.Entities.Addresses
|
|
@using TIAMSharedUI.Shared.Components.Grids
|
|
@using TIAMSharedUI.Pages.Components.EditComponents
|
|
@using TIAMWebApp.Shared.Application.Services
|
|
@using AyCode.Interfaces.Addresses
|
|
@using AyCode.Core
|
|
@using AyCode.Core.Loggers
|
|
@inject IServiceProviderDataService serviceProviderDataService
|
|
@inject IUserDataService userDataService
|
|
@inject ITransferDataService transferDataService
|
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
|
@inject AdminSignalRClient AdminSignalRClient;
|
|
|
|
|
|
<AddressDetailGrid @ref="_addressGrid"
|
|
ContextIds="new object[] {ParentData.AddressId}"
|
|
DataSource="DataSource"
|
|
Logger="_logger"
|
|
SignalRClient="AdminSignalRClient"
|
|
OnGridEditModelSaving="DataItemSaving"
|
|
OnGridItemDeleting="DataItemDeleting"
|
|
OnGridItemChanged="DataItemChanged"
|
|
ValidationEnabled="false"
|
|
EditMode="GridEditMode.EditForm"
|
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
|
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode">
|
|
<Columns>
|
|
<DxGridCommandColumn NewButtonVisible="false" DeleteButtonVisible="false" Width="70" MinWidth="70" FixedPosition="GridColumnFixedPosition.Left" />
|
|
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
|
<DxGridDataColumn FieldName="AddressText" />
|
|
<DxGridDataColumn FieldName="IsValid" Width="40" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
|
<DxGridDataColumn FieldName="IsHelper" Width="40" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
|
<DxGridDataColumn FieldName="Latitude" Width="40" />
|
|
<DxGridDataColumn FieldName="Longitude" Width="40" />
|
|
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
|
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
|
</Columns>
|
|
<EditFormTemplate>
|
|
@{
|
|
Address bleh = (Address)context.EditModel;
|
|
}
|
|
@* <EditAddressComponent TModel="Address" Model="@bleh" OnAddressChanged="@((Address model) => SaveAddress(model))" /> *@
|
|
<EditAddressComponent Model="@((Address)context.EditModel)" />
|
|
</EditFormTemplate>
|
|
|
|
</AddressDetailGrid>
|
|
|
|
@code {
|
|
[Parameter] public IAcAddressRelation<Address> ParentData { get; set; } = null!;
|
|
[Parameter] public IList<Address>? DataSource { get; set; }
|
|
[Parameter] public EventCallback<Address> OnAddressChanged { get; set; }
|
|
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
|
|
|
private Guid? _contextId = null!;
|
|
private AddressDetailGrid _addressGrid = null!;
|
|
private LoggerClient<AddressDetailGridComponent> _logger = null!;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
_logger = new LoggerClient<AddressDetailGridComponent>(LogWriters.ToArray());
|
|
|
|
//DataSource = new List<Address>();
|
|
DataSource ??= new List<Address> { ParentData.Address };
|
|
}
|
|
|
|
private void DataItemChanged(GridDataItemChangedEventArgs<Address> args)
|
|
{
|
|
_logger.Debug($"DataItemSaving; addressId: {args.DataItem.Id}");
|
|
|
|
ParentData.Address = args.DataItem;
|
|
OnAddressChanged.InvokeAsync(args.DataItem);
|
|
}
|
|
|
|
private void DataItemSaving(GridEditModelSavingEventArgs obj)
|
|
{
|
|
_logger.Debug($"DataItemSaving");
|
|
}
|
|
|
|
private void DataItemDeleting(GridDataItemDeletingEventArgs obj)
|
|
{
|
|
_logger.Debug($"DataItemDeleting");
|
|
}
|
|
} |