123 lines
4.7 KiB
Plaintext
123 lines
4.7 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.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"
|
|
PageSize="10"
|
|
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="TransferDestinationId" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
|
@{
|
|
var destinationNameFieldName = $"{nameof(TransferDestinationToProduct.TransferDestination.Name)}.{nameof(TransferDestination.Name)}";
|
|
}
|
|
<DxGridDataColumn FieldName="@destinationNameFieldName" Caption="TransferDestination name" />*@
|
|
<DxGridDataColumn FieldName="Price" />
|
|
<DxGridDataColumn FieldName="Price2" />
|
|
<DxGridDataColumn FieldName="Price3" />
|
|
<DxGridDataColumn FieldName="ProductCommis" />
|
|
<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>
|
|
<DetailRowTemplate>
|
|
<DxTabs>
|
|
<DxTabPage Text="Partner">
|
|
|
|
</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 GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
|
|
|
private LoggerClient<TransferDestinationToProductGridComponent> _logger = null!;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
_logger = new LoggerClient<TransferDestinationToProductGridComponent>(LogWriters.ToArray());
|
|
|
|
base.OnInitialized();
|
|
}
|
|
|
|
// 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");
|
|
// }
|
|
|
|
} |