136 lines
4.9 KiB
Plaintext
136 lines
4.9 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 TIAM.Services
|
|
@using TIAMWebApp.Shared.Application.Interfaces
|
|
@using TIAMWebApp.Shared.Application.Services
|
|
@using TIAMWebApp.Shared.Application.Utility
|
|
@using AyCode.Services.Loggers
|
|
@using TIAM.Core.Loggers
|
|
@using AyCode.Core
|
|
@using AyCode.Core.Extensions
|
|
@using TIAMSharedUI.Shared.Components.Grids
|
|
@inject IServiceProviderDataService ServiceProviderDataService
|
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
|
@inject AdminSignalRClient AdminSignalRClient;
|
|
|
|
<TransferDestinationToProductGrid
|
|
Logger="_logger"
|
|
SignalRClient="AdminSignalRClient"
|
|
GetAllMessageTag="GetAllTag"
|
|
ContextIds="@(ContextId.IsNullOrEmpty() ? throw new InvalidDataException($"ContextId.IsNullOrEmpty(); ContextId: {ContextId}") : [ContextId.Value])"
|
|
PageSize="10"
|
|
KeyboardNavigationEnabled="KeyboardNavigationEnabled"
|
|
KeyFieldName="Id"
|
|
ValidationEnabled="false"
|
|
EditMode="GridEditMode.EditForm"
|
|
ColumnResizeMode="GridColumnResizeMode.NextColumn">
|
|
<Columns>
|
|
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
|
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
|
<DxGridDataColumn FieldName="ProductId" />
|
|
<DxGridDataColumn FieldName="TransferDestinationId"/>
|
|
<DxGridDataColumn FieldName="Price" />
|
|
<DxGridDataColumn FieldName="Price2" />
|
|
<DxGridDataColumn FieldName="Price3" />
|
|
<DxGridDataColumn FieldName="ProductCommis" />
|
|
</Columns>
|
|
<DetailRowTemplate>
|
|
<DxTabs>
|
|
<DxTabPage Text="Partner">
|
|
<ProductDetailGridComponent DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto" GetAllTag="SignalRTags.GetProductsById" ContextId="((TransferDestinationToProduct)context.DataItem).ProductId" ParentData="(Company)context.DataItem" KeyboardNavigationEnabled="true" />
|
|
</DxTabPage>
|
|
</DxTabs>
|
|
</DetailRowTemplate>
|
|
<EditFormTemplate Context="editFormContext">
|
|
@{
|
|
var transferDestinationToProduct = (TransferDestinationToProduct)editFormContext.EditModel;
|
|
}
|
|
<DxFormLayout CssClass="w-100">
|
|
<DxFormLayoutItem Caption="Price" ColSpanMd="4">
|
|
@editFormContext.GetEditor("Price")
|
|
</DxFormLayoutItem>
|
|
<DxFormLayoutItem Caption="Price2" ColSpanMd="4">
|
|
@editFormContext.GetEditor("Price2")
|
|
</DxFormLayoutItem>
|
|
<DxFormLayoutItem Caption="Price3" ColSpanMd="4">
|
|
@editFormContext.GetEditor("Price3")
|
|
</DxFormLayoutItem>
|
|
|
|
<DxFormLayoutItem Caption="Commission rate" ColSpanMd="4">
|
|
@editFormContext.GetEditor("ProductCommis")
|
|
</DxFormLayoutItem>
|
|
</DxFormLayout>
|
|
</EditFormTemplate>
|
|
|
|
</TransferDestinationToProductGrid>
|
|
|
|
@code {
|
|
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
|
|
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
|
[Parameter] public Guid? ContextId { get; set; }
|
|
[Parameter] public int GetAllTag { get; set; }
|
|
|
|
private Guid[] ContextIds = new Guid[0];
|
|
private LoggerClient<TransferDestinationToProductGridComponent> _logger = null!;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
_logger = new LoggerClient<TransferDestinationToProductGridComponent>(LogWriters.ToArray());
|
|
|
|
base.OnInitialized();
|
|
}
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
if(ContextId != null)
|
|
{
|
|
ContextIds = new Guid[1];
|
|
ContextIds[0] = (Guid)ContextId!;
|
|
|
|
}
|
|
base.OnParametersSet();
|
|
}
|
|
|
|
// void CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
|
// {
|
|
// if (!e.IsNew) return;
|
|
|
|
// var newProductMapping = new UserProductMapping
|
|
// {
|
|
// ProductId = Guid.NewGuid(),
|
|
// UserId = UserModelDtoDetail.Id,
|
|
// Permissions = 1
|
|
// };
|
|
|
|
// e.EditModel = newProductMapping;
|
|
// }
|
|
|
|
// async Task EditModelSaving(GridEditModelSavingEventArgs e)
|
|
// {
|
|
// if (e.IsNew)
|
|
// //add new orderData to orderData array
|
|
// _logger.Info("New orderData added");
|
|
// else
|
|
// _logger.Info("orderData updated");
|
|
|
|
// await UpdateDataAsync();
|
|
// }
|
|
|
|
// async Task DataItemDeleting(GridDataItemDeletingEventArgs e)
|
|
// {
|
|
// //remove orderData from orderData array
|
|
// _logger.Info("orderData deleted");
|
|
// //await UpdateDataAsync();
|
|
// }
|
|
|
|
// async Task UpdateDataAsync()
|
|
// {
|
|
// //refresh grid
|
|
// _logger.Info("orderData grid refreshed");
|
|
// }
|
|
|
|
} |