Test grids: address grid, driver grid.. cast error onEditmodelSaving
This commit is contained in:
parent
d8de723141
commit
30c5e8382d
|
|
@ -18,4 +18,13 @@ public class SignalRTags : AcSignalRTags
|
|||
public const int UpdateCompanyAsync = 11;
|
||||
public const int AddCompanyAsync = 12;
|
||||
public const int RemoveCompanyAsync = 13;
|
||||
public const int GetTransferToDriversAsync = 14;
|
||||
public const int AddTransferToDriversAsync = 15;
|
||||
public const int UpdateTransferToDriversAsync = 16;
|
||||
public const int RemoveTransferToDriversAsync = 17;
|
||||
public const int GetAddressesByContextIdAsync = 18;
|
||||
public const int AddAddressToContextIdAsync = 19;
|
||||
public const int UpdateAddressByContextIdAsync = 20;
|
||||
public const int RemoveAddressByContextIdAsync = 21;
|
||||
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
@using AyCode.Services.Loggers
|
||||
@using TIAM.Core.Loggers
|
||||
@using TIAM.Entities.Addresses
|
||||
@using TIAMSharedUI.Shared.Components.Grids
|
||||
@using TIAMSharedUI.Pages.Components.EditComponents
|
||||
@inject IServiceProviderDataService serviceProviderDataService
|
||||
@inject IUserDataService userDataService
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
|
||||
|
||||
<DxGrid @ref="Grid" Data="_detailGridData"
|
||||
<AddressGrid @ref="Grid" Data="_detailGridData"
|
||||
PageSize="5"
|
||||
AutoExpandAllGroupRows="true"
|
||||
KeyboardNavigationEnabled="KeyboardNavigationEnabled"
|
||||
|
|
@ -47,7 +48,7 @@
|
|||
<EditAddressComponent Model="@((Address)context.EditModel)" OnAddressChanged="@((Address model) => SaveAddress(model))" />
|
||||
</EditFormTemplate>
|
||||
|
||||
</DxGrid>
|
||||
</AddressGrid>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
@using TIAM.Entities.Transfers
|
||||
@using TIAM.Entities.Drivers
|
||||
@using TIAM.Models.Dtos.Users
|
||||
@using TIAMSharedUI.Shared.Components.Grids
|
||||
@using TIAMWebApp.Shared.Application.Interfaces
|
||||
@using TIAMWebApp.Shared.Application.Utility
|
||||
@using TIAM.Core.Loggers
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
|
||||
|
||||
|
||||
<DxGrid Data="DetailGridData"
|
||||
<TransferToDriversGrid Data="DetailGridData"
|
||||
PageSize="5"
|
||||
AutoExpandAllGroupRows="true"
|
||||
KeyboardNavigationEnabled="KeyboardNavigationEnabled"
|
||||
|
|
@ -29,7 +30,7 @@
|
|||
<DxGridDataColumn FieldName="CarId" Width="40%" />
|
||||
<DxGridDataColumn FieldName="LicencePlate" />
|
||||
</Columns>
|
||||
</DxGrid>
|
||||
</TransferToDriversGrid>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
|
|
@ -66,9 +67,9 @@
|
|||
{
|
||||
if (e.IsNew)
|
||||
//add new orderData to orderData array
|
||||
_logger.Info("New orderData added");
|
||||
_logger.Info("New driver added");
|
||||
else
|
||||
_logger.Info("orderData updated");
|
||||
_logger.Info("Driver updated");
|
||||
|
||||
await UpdateDataAsync();
|
||||
}
|
||||
|
|
@ -76,7 +77,7 @@
|
|||
async Task DataItemDeleting(GridDataItemDeletingEventArgs e)
|
||||
{
|
||||
//remove orderData from orderData array
|
||||
_logger.Info("orderData deleted");
|
||||
_logger.Info("driver deleted");
|
||||
//await UpdateDataAsync();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@
|
|||
|
||||
<DxTabs>
|
||||
<DxTabPage Text="Driver">
|
||||
<Grid_MasterDetail_NestedGrid_DetailContent Customer="(TIAM.Entities.Transfers.Transfer)context.DataItem" KeyboardNavigationEnabled="true" />
|
||||
<DriverGridComponent Transfer="(TIAM.Entities.Transfers.Transfer)context.DataItem" KeyboardNavigationEnabled="true" />
|
||||
</DxTabPage>
|
||||
</DxTabs>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
@using AyCode.Services.Loggers
|
||||
@using TIAM.Core.Loggers
|
||||
@using TIAM.Entities.Addresses
|
||||
@using TIAMSharedUI.Shared.Components.Grids
|
||||
@layout AdminLayout
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
@inject IStringLocalizer<TIAMResources> Localizer
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
using Microsoft.AspNetCore.Components;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Services;
|
||||
|
||||
namespace TIAMSharedUI.Shared.Components.Grids;
|
||||
|
||||
public class AddressGrid : TiamGrid<Address>
|
||||
{
|
||||
public AddressGrid() : base()
|
||||
{
|
||||
GridName = nameof(Address);
|
||||
|
||||
GetAllMessageTag = SignalRTags.GetAddressesByContextIdAsync;
|
||||
AddMessageTag = SignalRTags.AddAddressToContextIdAsync;
|
||||
UpdateMessageTag = SignalRTags.UpdateAddressByContextIdAsync;
|
||||
RemoveMessageTag = SignalRTags.RemoveAddressByContextIdAsync;
|
||||
}
|
||||
|
||||
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
||||
{
|
||||
if (!IsFirstInitializeParameters)
|
||||
{
|
||||
//ShowFilterRow = true;
|
||||
//ShowGroupPanel = true;
|
||||
//AllowSort = false;
|
||||
|
||||
//etc...
|
||||
}
|
||||
|
||||
return base.SetParametersAsyncCore(parameters);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
using Microsoft.AspNetCore.Components;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Services;
|
||||
|
||||
namespace TIAMSharedUI.Shared.Components.Grids;
|
||||
|
||||
public class TransferToDriversGrid : TiamGrid<TransferToDriver>
|
||||
{
|
||||
public TransferToDriversGrid() : base()
|
||||
{
|
||||
GridName = nameof(TransferToDriver);
|
||||
|
||||
GetAllMessageTag = SignalRTags.GetTransferToDriversAsync;
|
||||
AddMessageTag = SignalRTags.AddTransferToDriversAsync;
|
||||
UpdateMessageTag = SignalRTags.UpdateTransferToDriversAsync;
|
||||
RemoveMessageTag = SignalRTags.RemoveTransferToDriversAsync;
|
||||
}
|
||||
|
||||
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
||||
{
|
||||
if (!IsFirstInitializeParameters)
|
||||
{
|
||||
//ShowFilterRow = true;
|
||||
//ShowGroupPanel = true;
|
||||
//AllowSort = false;
|
||||
|
||||
//etc...
|
||||
}
|
||||
|
||||
return base.SetParametersAsyncCore(parameters);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue