fix
This commit is contained in:
parent
3388c6d67a
commit
6cc32c8f84
|
|
@ -0,0 +1,84 @@
|
||||||
|
@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
|
||||||
|
@inject IServiceProviderDataService serviceProviderDataService
|
||||||
|
@inject IUserDataService userDataService
|
||||||
|
@inject ITransferDataService transferDataService
|
||||||
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
|
@inject AdminSignalRClient AdminSignalRClient;
|
||||||
|
|
||||||
|
|
||||||
|
<AddressDetailGrid @ref="_addressGrid"
|
||||||
|
Logger="_logger"
|
||||||
|
SignalRClient="AdminSignalRClient"
|
||||||
|
OnDataItemSaving="DataItemSaving"
|
||||||
|
OnDataItemDeleting="DataItemDeleting"
|
||||||
|
|
||||||
|
PageSize="5"
|
||||||
|
AutoExpandAllGroupRows="true"
|
||||||
|
KeyboardNavigationEnabled="KeyboardNavigationEnabled"
|
||||||
|
KeyFieldName="Id"
|
||||||
|
ValidationEnabled="false"
|
||||||
|
EditMode="GridEditMode.EditForm"
|
||||||
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||||
|
ShowFilterRow="true">
|
||||||
|
<Columns>
|
||||||
|
<DxGridCommandColumn NewButtonVisible="true" Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
||||||
|
<DxGridDataColumn FieldName="Id" GroupIndex="0" />
|
||||||
|
<DxGridDataColumn FieldName="AddressText" />
|
||||||
|
<DxGridDataColumn FieldName="IsValid" Width="40" />
|
||||||
|
<DxGridDataColumn FieldName="IsHelper" Width="40"/>
|
||||||
|
<DxGridDataColumn FieldName="Latitude" Width="40"/>
|
||||||
|
<DxGridDataColumn FieldName="Longitude" Width="40"/>
|
||||||
|
<DxGridDataColumn FieldName="Created" Width="40"/>
|
||||||
|
<DxGridDataColumn FieldName="Modified" Width="40"/>
|
||||||
|
</Columns>
|
||||||
|
<EditFormTemplate>
|
||||||
|
@{
|
||||||
|
Address bleh = (Address)context.EditModel;
|
||||||
|
}
|
||||||
|
@* <EditAddressComponent TModel="Address" Model="@bleh" OnAddressChanged="@((Address model) => SaveAddress(model))" /> *@
|
||||||
|
<EditAddressComponent Model="@((Address)context.EditModel)" OnAddressChanged="@((Address model) => SaveAddress(model))" />
|
||||||
|
</EditFormTemplate>
|
||||||
|
|
||||||
|
</AddressDetailGrid>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
|
||||||
|
|
||||||
|
private AddressDetailGrid _addressGrid;
|
||||||
|
private LoggerClient<AddressDetailGridComponent> _logger;
|
||||||
|
|
||||||
|
public void SaveAddress(object addressOwnerToSave)
|
||||||
|
{
|
||||||
|
_addressGrid.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
_logger = new LoggerClient<AddressDetailGridComponent>(LogWriters.ToArray());
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataItemSaving(GridEditModelSavingEventArgs obj)
|
||||||
|
{
|
||||||
|
_logger.Debug($"DataItemSaving");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataItemDeleting(GridDataItemDeletingEventArgs obj)
|
||||||
|
{
|
||||||
|
_logger.Debug($"DataItemDeleting");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
<CompaniesNestedUserProductMapping CurrentCompany="(TIAM.Entities.ServiceProviders.Company)context.DataItem" KeyboardNavigationEnabled="true" />
|
<CompaniesNestedUserProductMapping CurrentCompany="(TIAM.Entities.ServiceProviders.Company)context.DataItem" KeyboardNavigationEnabled="true" />
|
||||||
</DetailRowTemplate> *@
|
</DetailRowTemplate> *@
|
||||||
<DetailRowTemplate>
|
<DetailRowTemplate>
|
||||||
<AddressGridComponent AddressContext="(TIAM.Entities.ServiceProviders.Company)context.DataItem" ContextIdType="companyprofile" KeyboardNavigationEnabled="true" />
|
<AddressDetailGridComponent AddressContext="(Company)context.DataItem" KeyboardNavigationEnabled="true" />
|
||||||
</DetailRowTemplate>
|
</DetailRowTemplate>
|
||||||
<EditFormTemplate Context="EditFormContext">
|
<EditFormTemplate Context="EditFormContext">
|
||||||
@{
|
@{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace TIAMSharedUI.Shared.Components.Grids;
|
||||||
|
|
||||||
|
public class AddressDetailGrid : AddressGrid
|
||||||
|
{
|
||||||
|
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
||||||
|
{
|
||||||
|
var isFirst = IsFirstInitializeParameters;
|
||||||
|
|
||||||
|
return base.SetParametersAsyncCore(parameters);
|
||||||
|
|
||||||
|
if (isFirst)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -73,4 +73,10 @@
|
||||||
<Folder Include="Pages\User\Guides\" />
|
<Folder Include="Pages\User\Guides\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="Pages\User\SysAdmins\AddressDetailGridComponent.razor">
|
||||||
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,9 @@ namespace TIAMWebApp.Shared.Application.Services
|
||||||
public virtual Task GetAllAsync<TResponseData>(int messageTag, Action<ISignalResponseMessage<TResponseData?>> responseCallback)
|
public virtual Task GetAllAsync<TResponseData>(int messageTag, Action<ISignalResponseMessage<TResponseData?>> responseCallback)
|
||||||
=> SendMessageToServerAsync(messageTag, null, responseCallback);
|
=> SendMessageToServerAsync(messageTag, null, responseCallback);
|
||||||
|
|
||||||
|
public virtual Task GetAllAsync<TResponseData>(int messageTag, Guid contextId, Action<ISignalResponseMessage<TResponseData?>> responseCallback)
|
||||||
|
=> throw new NotImplementedException();
|
||||||
|
|
||||||
public virtual Task<TPostData?> PostDataAsync<TPostData>(int messageTag, TPostData postData) where TPostData : class
|
public virtual Task<TPostData?> PostDataAsync<TPostData>(int messageTag, TPostData postData) where TPostData : class
|
||||||
=> SendMessageToServerAsync<TPostData>(messageTag, new SignalPostJsonDataMessage<TPostData>(postData), AcDomain.NextUniqueInt32);
|
=> SendMessageToServerAsync<TPostData>(messageTag, new SignalPostJsonDataMessage<TPostData>(postData), AcDomain.NextUniqueInt32);
|
||||||
public virtual Task PostDataAsync<TPostData>(int messageTag, TPostData postData, Action<ISignalResponseMessage<TPostData?>> responseCallback) where TPostData : class
|
public virtual Task PostDataAsync<TPostData>(int messageTag, TPostData postData, Action<ISignalResponseMessage<TPostData?>> responseCallback) where TPostData : class
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue