Merge branch 'master' of http://git2.aycode.com/Adam/TourIAm
This commit is contained in:
commit
42b351262a
|
|
@ -20,8 +20,8 @@
|
||||||
<PageTitle>User permissions</PageTitle>
|
<PageTitle>User permissions</PageTitle>
|
||||||
|
|
||||||
<div class="text-center m-5">
|
<div class="text-center m-5">
|
||||||
<h1>Drivers</h1>
|
<h1>My companies</h1>
|
||||||
<h2 style="font-size:small">Manage drivers here!</h2>
|
<h2 style="font-size:small">Manage your companies here!</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
}
|
}
|
||||||
<DxFormLayout CssClass="w-100">
|
<DxFormLayout CssClass="w-100">
|
||||||
|
|
||||||
<DxFormLayoutItem Caption="UserId" ColSpanLg="6" ColSpanMd="12">
|
<DxFormLayoutItem Caption="UserId" ColSpanLg="12" ColSpanMd="12">
|
||||||
@transfer2.UserId
|
@transfer2.UserId
|
||||||
@{
|
@{
|
||||||
var a = UserEditFormContext.GetEditor("UserId");
|
var a = UserEditFormContext.GetEditor("UserId");
|
||||||
|
|
@ -117,7 +117,7 @@
|
||||||
<DxButton Click="@(async (MouseEventArgs e) => await ShowPopup((UserProductMapping)UserEditFormContext.EditModel))" Context="ButtonContext">Select user</DxButton>
|
<DxButton Click="@(async (MouseEventArgs e) => await ShowPopup((UserProductMapping)UserEditFormContext.EditModel))" Context="ButtonContext">Select user</DxButton>
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
|
|
||||||
<DxFormLayoutItem Caption="Permissions" ColSpanMd="4">
|
<DxFormLayoutItem Caption="Permissions" ColSpanLg="12">
|
||||||
@UserEditFormContext.GetEditor("Permissions")
|
@UserEditFormContext.GetEditor("Permissions")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private LoggerClient<ManageUserProductMappings> _logger;
|
private LoggerClient<ManageTransferDestinationToProducts> _logger;
|
||||||
//public UserModelDtoDetail UserModelDtoDetail = new();
|
//public UserModelDtoDetail UserModelDtoDetail = new();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -135,7 +135,7 @@
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
_logger = new LoggerClient<ManageUserProductMappings>(LogWriters.ToArray());
|
_logger = new LoggerClient<ManageTransferDestinationToProducts>(LogWriters.ToArray());
|
||||||
|
|
||||||
base.OnInitialized();
|
base.OnInitialized();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
<DetailRowTemplate>
|
<DetailRowTemplate>
|
||||||
<DxTabs>
|
<DxTabs>
|
||||||
<DxTabPage Text="Prices">
|
<DxTabPage Text="Prices">
|
||||||
<TransferDestinationToProductDetailGridComponent GetAllTag="SignalRTags.GetTransferDestinationToProductsByProductId" ContextIds="new [] {((Product)context.DataItem).Id}" />
|
<TransferDestinationToProductDetailGridComponent IsProductIdReadonly="true" GetAllTag="SignalRTags.GetTransferDestinationToProductsByProductId" ContextIds="new [] {((Product)context.DataItem).Id}" />
|
||||||
</DxTabPage>
|
</DxTabPage>
|
||||||
<DxTabPage Text="Permissions">
|
<DxTabPage Text="Permissions">
|
||||||
<UserProductMappingGridComponent DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Never" ContextIds="new[] { ((Product)context.DataItem).Id }" GetAllTag="SignalRTags.GetUserProductMappingsByProductId">
|
<UserProductMappingGridComponent DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Never" ContextIds="new[] { ((Product)context.DataItem).Id }" GetAllTag="SignalRTags.GetUserProductMappingsByProductId">
|
||||||
|
|
@ -76,8 +76,6 @@
|
||||||
<DxFormLayoutItem Caption=@Localizer.GetString(ResourceKeys.ProductDescription) ColSpanMd="4">
|
<DxFormLayoutItem Caption=@Localizer.GetString(ResourceKeys.ProductDescription) ColSpanMd="4">
|
||||||
@editFormContext.GetEditor("Description")
|
@editFormContext.GetEditor("Description")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
|
|
||||||
|
|
||||||
</DxFormLayout>
|
</DxFormLayout>
|
||||||
</EditFormTemplate>
|
</EditFormTemplate>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,16 @@
|
||||||
Logger="_logger"
|
Logger="_logger"
|
||||||
SignalRClient="AdminSignalRClient"
|
SignalRClient="AdminSignalRClient"
|
||||||
ValidationEnabled="false"
|
ValidationEnabled="false"
|
||||||
EditMode="GridEditMode.EditForm"
|
EditMode="GridEditMode.EditRow"
|
||||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||||
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode">
|
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode">
|
||||||
<Columns>
|
<Columns>
|
||||||
<DxGridCommandColumn NewButtonVisible="false" DeleteButtonVisible="false" Width="70" MinWidth="70" FixedPosition="GridColumnFixedPosition.Left" />
|
<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="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||||
<DxGridDataColumn FieldName="Name" />
|
<DxGridDataColumn Caption="Public name" FieldName="Name" />
|
||||||
<DxGridDataColumn FieldName="FullName" />
|
<DxGridDataColumn FieldName="FirstName" />
|
||||||
|
<DxGridDataColumn FieldName="LastName" />
|
||||||
|
<DxGridDataColumn Caption="Contact email" FieldName="EmailAddress" />
|
||||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
<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" />
|
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||||
</Columns>
|
</Columns>
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
<DetailRowTemplate>
|
<DetailRowTemplate>
|
||||||
<DxTabs>
|
<DxTabs>
|
||||||
<DxTabPage Text="Prices">
|
<DxTabPage Text="Prices">
|
||||||
<TransferDestinationToProductDetailGridComponent GetAllTag="SignalRTags.GetTransferDestinationToProductsByTransferDestinationId" ContextIds="new [] {((TransferDestination)context.DataItem).Id}" />
|
<TransferDestinationToProductDetailGridComponent IsDestinationIdReadonly="true" GetAllTag="SignalRTags.GetTransferDestinationToProductsByTransferDestinationId" ContextIds="new [] {((TransferDestination)context.DataItem).Id}" />
|
||||||
</DxTabPage>
|
</DxTabPage>
|
||||||
</DxTabs>
|
</DxTabs>
|
||||||
</DetailRowTemplate>
|
</DetailRowTemplate>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
@using TIAM.Entities.Products
|
@using AyCode.Core.Helpers
|
||||||
|
@using TIAM.Entities.Products
|
||||||
@using TIAM.Entities.ServiceProviders
|
@using TIAM.Entities.ServiceProviders
|
||||||
@using TIAM.Entities.Transfers
|
@using TIAM.Entities.Transfers
|
||||||
@using TIAM.Entities.Drivers
|
@using TIAM.Entities.Drivers
|
||||||
|
|
@ -18,19 +19,42 @@
|
||||||
|
|
||||||
<TransferDestinationToProductDetailGrid Logger="_logger"
|
<TransferDestinationToProductDetailGrid Logger="_logger"
|
||||||
SignalRClient="AdminSignalRClient"
|
SignalRClient="AdminSignalRClient"
|
||||||
|
CustomizeEditModel="CustomizeEditModel"
|
||||||
|
OnGridEditModelSaving="OnGridEditModelSaving"
|
||||||
|
EditCanceling="EditCanceling"
|
||||||
ContextIds="ContextIds?.Cast<object>().ToArray()"
|
ContextIds="ContextIds?.Cast<object>().ToArray()"
|
||||||
GetAllMessageTag="GetAllTag"
|
GetAllMessageTag="GetAllTag"
|
||||||
PageSize="10"
|
PageSize="10"
|
||||||
ValidationEnabled="false"
|
ValidationEnabled="false"
|
||||||
EditMode="GridEditMode.EditForm"
|
EditMode="GridEditMode.EditRow"
|
||||||
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode"
|
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode"
|
||||||
ColumnResizeMode="GridColumnResizeMode.NextColumn">
|
ColumnResizeMode="GridColumnResizeMode.NextColumn">
|
||||||
|
|
||||||
<Columns>
|
<Columns>
|
||||||
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
||||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
||||||
<DxGridDataColumn FieldName="ProductId" />
|
<DxGridDataColumn FieldName="ProductId" Caption="ServiceId">
|
||||||
<DxGridDataColumn FieldName="TransferDestinationId" />
|
<CellEditTemplate>
|
||||||
|
@{
|
||||||
|
var TransferDestinationToProductEditModel = (TransferDestinationToProduct)context.EditModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
<DxComboBox Data="@_products" TextFieldName="Name" ValueFieldName="Id" @bind-Value="TransferDestinationToProductEditModel.ProductId" ReadOnly="@ProductIdReadOnly"
|
||||||
|
SearchFilterCondition="ListSearchFilterCondition.Contains" SearchMode="ListSearchMode.AutoSearch">
|
||||||
|
</DxComboBox>
|
||||||
|
</CellEditTemplate>
|
||||||
|
</DxGridDataColumn>
|
||||||
|
<DxGridDataColumn FieldName="TransferDestinationId">
|
||||||
|
<CellEditTemplate>
|
||||||
|
@{
|
||||||
|
var TransferDestinationToProductEditModel = (TransferDestinationToProduct)context.EditModel;
|
||||||
|
|
||||||
|
}
|
||||||
|
<DxComboBox Data="@_transferDestinations" TextFieldName="Name" ValueFieldName="Id" @bind-Value="TransferDestinationToProductEditModel.TransferDestinationId" ReadOnly="@DestinationIdReadOnly"
|
||||||
|
SearchFilterCondition="ListSearchFilterCondition.Contains" SearchMode="ListSearchMode.AutoSearch">
|
||||||
|
</DxComboBox>
|
||||||
|
</CellEditTemplate>
|
||||||
|
</DxGridDataColumn>
|
||||||
@*<DxGridDataColumn FieldName="TransferDestinationId" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
@*<DxGridDataColumn FieldName="TransferDestinationId" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||||
@{
|
@{
|
||||||
var destinationNameFieldName = $"{nameof(TransferDestinationToProduct.TransferDestination.Name)}.{nameof(TransferDestination.Name)}";
|
var destinationNameFieldName = $"{nameof(TransferDestinationToProduct.TransferDestination.Name)}.{nameof(TransferDestination.Name)}";
|
||||||
|
|
@ -54,29 +78,29 @@
|
||||||
|
|
||||||
|
|
||||||
</DetailRowTemplate>
|
</DetailRowTemplate>
|
||||||
<EditFormTemplate Context="editFormContext">
|
@* <EditFormTemplate Context="editFormContext">
|
||||||
@{
|
@{
|
||||||
var transferDestinationToProduct = (TransferDestinationToProduct)editFormContext.EditModel;
|
var transferDestinationToProduct = (TransferDestinationToProduct)editFormContext.EditModel;
|
||||||
}
|
}
|
||||||
<DxFormLayout CssClass="w-100">
|
<DxFormLayout CssClass="w-100">
|
||||||
<DxFormLayoutItem Caption="Price" ColSpanMd="4">
|
<DxFormLayoutItem Caption="Price" ColSpanMd="4">
|
||||||
@editFormContext.GetEditor("Price")
|
@editFormContext.GetEditor("Price")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
<DxFormLayoutItem Caption="Price2" ColSpanMd="4">
|
<DxFormLayoutItem Caption="Price2" ColSpanMd="4">
|
||||||
@editFormContext.GetEditor("Price2")
|
@editFormContext.GetEditor("Price2")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
<DxFormLayoutItem Caption="Price3" ColSpanMd="4">
|
<DxFormLayoutItem Caption="Price3" ColSpanMd="4">
|
||||||
@editFormContext.GetEditor("Price3")
|
@editFormContext.GetEditor("Price3")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
|
|
||||||
<DxFormLayoutItem Caption="Commission rate" ColSpanMd="4">
|
<DxFormLayoutItem Caption="Commission rate" ColSpanMd="4">
|
||||||
@editFormContext.GetEditor("ProductCommis")
|
@editFormContext.GetEditor("ProductCommis")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</DxFormLayout>
|
</DxFormLayout>
|
||||||
</EditFormTemplate>
|
</EditFormTemplate> *@
|
||||||
|
|
||||||
</TransferDestinationToProductDetailGrid>
|
</TransferDestinationToProductDetailGrid>
|
||||||
|
|
||||||
|
|
@ -84,13 +108,64 @@
|
||||||
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
||||||
[Parameter] public Guid[]? ContextIds { get; set; } = null!;
|
[Parameter] public Guid[]? ContextIds { get; set; } = null!;
|
||||||
[Parameter] public int GetAllTag { get; set; } = SignalRTags.GetAllTransferDestinationToProducts;
|
[Parameter] public int GetAllTag { get; set; } = SignalRTags.GetAllTransferDestinationToProducts;
|
||||||
|
[Parameter] public bool IsProductIdReadonly { get; set; } = false;
|
||||||
|
[Parameter] public bool IsDestinationIdReadonly { get; set; } = false;
|
||||||
|
|
||||||
|
private bool ProductIdReadOnly = false;
|
||||||
|
private bool DestinationIdReadOnly = false;
|
||||||
|
|
||||||
|
//private bool? _isNewState = null;
|
||||||
|
private List<TransferDestination> _transferDestinations = [];
|
||||||
|
private List<Product> _products = [];
|
||||||
|
|
||||||
private LoggerClient<TransferDestinationToProductGridComponent> _logger = null!;
|
private LoggerClient<TransferDestinationToProductGridComponent> _logger = null!;
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
_logger = new LoggerClient<TransferDestinationToProductGridComponent>(LogWriters.ToArray());
|
_logger = new LoggerClient<TransferDestinationToProductGridComponent>(LogWriters.ToArray());
|
||||||
|
AdminSignalRClient.GetAllIntoAsync(_transferDestinations, SignalRTags.GetAllTransferDestinations).Forget();
|
||||||
|
AdminSignalRClient.GetAllIntoAsync(_products, SignalRTags.GetAllProducts).Forget();
|
||||||
base.OnInitialized();
|
base.OnInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
||||||
|
{
|
||||||
|
if (!e.IsNew)
|
||||||
|
{
|
||||||
|
DestinationIdReadOnly = true;
|
||||||
|
|
||||||
|
ProductIdReadOnly = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(IsDestinationIdReadonly)
|
||||||
|
{
|
||||||
|
((TransferDestinationToProduct)(e.EditModel)).TransferDestinationId = (Guid)ContextIds[0];
|
||||||
|
}
|
||||||
|
DestinationIdReadOnly = IsDestinationIdReadonly;
|
||||||
|
if (IsProductIdReadonly)
|
||||||
|
{
|
||||||
|
((TransferDestinationToProduct)(e.EditModel)).ProductId = (Guid)ContextIds[0];
|
||||||
|
}
|
||||||
|
ProductIdReadOnly = IsProductIdReadonly;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!e.IsNew) return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnGridEditModelSaving(GridEditModelSavingEventArgs e)
|
||||||
|
{
|
||||||
|
DestinationIdReadOnly = false;
|
||||||
|
ProductIdReadOnly = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EditCanceling(GridEditCancelingEventArgs e)
|
||||||
|
{
|
||||||
|
DestinationIdReadOnly = false;
|
||||||
|
ProductIdReadOnly = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
@using TIAM.Entities.Products
|
@using AyCode.Core.Helpers
|
||||||
|
@using TIAM.Entities.Products
|
||||||
@using TIAM.Entities.ServiceProviders
|
@using TIAM.Entities.ServiceProviders
|
||||||
@using TIAM.Entities.Transfers
|
@using TIAM.Entities.Transfers
|
||||||
@using TIAM.Entities.Drivers
|
@using TIAM.Entities.Drivers
|
||||||
@using TIAM.Entities.Users
|
@using TIAM.Entities.Users
|
||||||
@using TIAM.Models.Dtos.Users
|
@using TIAM.Models.Dtos.Users
|
||||||
|
@using TIAM.Services
|
||||||
@using TIAMWebApp.Shared.Application.Interfaces
|
@using TIAMWebApp.Shared.Application.Interfaces
|
||||||
@using TIAMWebApp.Shared.Application.Services
|
@using TIAMWebApp.Shared.Application.Services
|
||||||
@using TIAMWebApp.Shared.Application.Utility
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
|
|
@ -16,21 +18,43 @@
|
||||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
@inject AdminSignalRClient AdminSignalRClient;
|
@inject AdminSignalRClient AdminSignalRClient;
|
||||||
|
|
||||||
<TransferDestinationToProductGrid
|
<TransferDestinationToProductGrid Logger="_logger"
|
||||||
Logger="_logger"
|
SignalRClient="AdminSignalRClient"
|
||||||
SignalRClient="AdminSignalRClient"
|
CustomizeEditModel="CustomizeEditModel"
|
||||||
PageSize="10"
|
OnGridEditModelSaving="OnGridEditModelSaving"
|
||||||
ValidationEnabled="false"
|
Context="TransferDestinationToProductContext"
|
||||||
EditMode="GridEditMode.EditForm"
|
PageSize="10"
|
||||||
ColumnResizeMode="GridColumnResizeMode.NextColumn">
|
ValidationEnabled="false"
|
||||||
|
EditMode="GridEditMode.EditRow"
|
||||||
|
ColumnResizeMode="GridColumnResizeMode.NextColumn">
|
||||||
<Columns>
|
<Columns>
|
||||||
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
||||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
||||||
<DxGridDataColumn FieldName="ProductId" />
|
<DxGridDataColumn FieldName="ProductId" Caption="Service id">
|
||||||
<DxGridDataColumn FieldName="TransferDestinationId" />
|
<CellEditTemplate>
|
||||||
|
@{
|
||||||
|
var TransferDestinationToProductEditModel = (TransferDestinationToProduct)context.EditModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
<DxComboBox Data="@_products" TextFieldName="Name" ValueFieldName="Id" @bind-Value="TransferDestinationToProductEditModel.ProductId" ReadOnly="@(!_isNewState!.Value)"
|
||||||
|
SearchFilterCondition="ListSearchFilterCondition.Contains" SearchMode="ListSearchMode.AutoSearch">
|
||||||
|
</DxComboBox>
|
||||||
|
</CellEditTemplate>
|
||||||
|
</DxGridDataColumn>
|
||||||
|
<DxGridDataColumn FieldName="TransferDestinationId">
|
||||||
|
<CellEditTemplate>
|
||||||
|
@{
|
||||||
|
var TransferDestinationToProductEditModel = (TransferDestinationToProduct)context.EditModel;
|
||||||
|
|
||||||
|
}
|
||||||
|
<DxComboBox Data="@_transferDestinations" TextFieldName="Name" ValueFieldName="Id" @bind-Value="TransferDestinationToProductEditModel.TransferDestinationId" ReadOnly="@(!_isNewState!.Value)"
|
||||||
|
SearchFilterCondition="ListSearchFilterCondition.Contains" SearchMode="ListSearchMode.AutoSearch">
|
||||||
|
</DxComboBox>
|
||||||
|
</CellEditTemplate>
|
||||||
|
</DxGridDataColumn>
|
||||||
@*<DxGridDataColumn FieldName="TransferDestinationId" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
@*<DxGridDataColumn FieldName="TransferDestinationId" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||||
@{
|
@{
|
||||||
var destinationNameFieldName = $"{nameof(TransferDestinationToProduct.TransferDestination.Name)}.{nameof(TransferDestination.Name)}";
|
var destinationNameFieldName = $"{nameof(TransferDestinationToProduct.TransferDestination.Name)}.{nameof(TransferDestination.Name)}";
|
||||||
}
|
}
|
||||||
<DxGridDataColumn FieldName="@destinationNameFieldName" Caption="TransferDestination name" />*@
|
<DxGridDataColumn FieldName="@destinationNameFieldName" Caption="TransferDestination name" />*@
|
||||||
<DxGridDataColumn FieldName="Price" />
|
<DxGridDataColumn FieldName="Price" />
|
||||||
|
|
@ -40,14 +64,14 @@
|
||||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
<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" />
|
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||||
</Columns>
|
</Columns>
|
||||||
<DetailRowTemplate>
|
<DetailRowTemplate>
|
||||||
<DxTabs>
|
<DxTabs>
|
||||||
<DxTabPage Text="Partner">
|
<DxTabPage Text="Partner">
|
||||||
|
|
||||||
</DxTabPage>
|
</DxTabPage>
|
||||||
</DxTabs>
|
</DxTabs>
|
||||||
</DetailRowTemplate>
|
</DetailRowTemplate>
|
||||||
<EditFormTemplate Context="editFormContext">
|
@* <EditFormTemplate Context="editFormContext">
|
||||||
@{
|
@{
|
||||||
var transferDestinationToProduct = (TransferDestinationToProduct)editFormContext.EditModel;
|
var transferDestinationToProduct = (TransferDestinationToProduct)editFormContext.EditModel;
|
||||||
}
|
}
|
||||||
|
|
@ -61,12 +85,14 @@
|
||||||
<DxFormLayoutItem Caption="Price3" ColSpanMd="4">
|
<DxFormLayoutItem Caption="Price3" ColSpanMd="4">
|
||||||
@editFormContext.GetEditor("Price3")
|
@editFormContext.GetEditor("Price3")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
|
<DxFormLayoutItem Context="FormLayoutContext" Caption="TransferDestination" ColSpanMd="4">
|
||||||
|
|
||||||
|
</DxFormLayoutItem>
|
||||||
<DxFormLayoutItem Caption="Commission rate" ColSpanMd="4">
|
<DxFormLayoutItem Caption="Commission rate" ColSpanMd="4">
|
||||||
@editFormContext.GetEditor("ProductCommis")
|
@editFormContext.GetEditor("ProductCommis")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
</DxFormLayout>
|
</DxFormLayout>
|
||||||
</EditFormTemplate>
|
</EditFormTemplate> *@
|
||||||
|
|
||||||
</TransferDestinationToProductGrid>
|
</TransferDestinationToProductGrid>
|
||||||
|
|
||||||
|
|
@ -74,27 +100,30 @@
|
||||||
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
||||||
|
|
||||||
private LoggerClient<TransferDestinationToProductGridComponent> _logger = null!;
|
private LoggerClient<TransferDestinationToProductGridComponent> _logger = null!;
|
||||||
|
private bool? _isNewState = null;
|
||||||
|
private List<TransferDestination> _transferDestinations = [];
|
||||||
|
private List<Product> _products = [];
|
||||||
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
_logger = new LoggerClient<TransferDestinationToProductGridComponent>(LogWriters.ToArray());
|
_logger = new LoggerClient<TransferDestinationToProductGridComponent>(LogWriters.ToArray());
|
||||||
|
AdminSignalRClient.GetAllIntoAsync(_transferDestinations, SignalRTags.GetAllTransferDestinations).Forget();
|
||||||
base.OnInitialized();
|
AdminSignalRClient.GetAllIntoAsync(_products, SignalRTags.GetAllProducts).Forget();
|
||||||
|
await base.OnInitializedAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
// void CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
void CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
||||||
// {
|
{
|
||||||
// if (!e.IsNew) return;
|
_isNewState = e.IsNew;
|
||||||
|
if (!e.IsNew) return;
|
||||||
|
|
||||||
// var newProductMapping = new UserProductMapping
|
}
|
||||||
// {
|
|
||||||
// ProductId = Guid.NewGuid(),
|
|
||||||
// UserId = UserModelDtoDetail.Id,
|
|
||||||
// Permissions = 1
|
|
||||||
// };
|
|
||||||
|
|
||||||
// e.EditModel = newProductMapping;
|
private void OnGridEditModelSaving(GridEditModelSavingEventArgs e)
|
||||||
// }
|
{
|
||||||
|
_isNewState = false;
|
||||||
|
}
|
||||||
|
|
||||||
// async Task EditModelSaving(GridEditModelSavingEventArgs e)
|
// async Task EditModelSaving(GridEditModelSavingEventArgs e)
|
||||||
// {
|
// {
|
||||||
|
|
@ -118,6 +147,6 @@
|
||||||
// {
|
// {
|
||||||
// //refresh grid
|
// //refresh grid
|
||||||
// _logger.Info("orderData grid refreshed");
|
// _logger.Info("orderData grid refreshed");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
PageSize="10"
|
PageSize="10"
|
||||||
ValidationEnabled="false"
|
ValidationEnabled="false"
|
||||||
CustomizeEditModel="CustomizeEditModel"
|
CustomizeEditModel="CustomizeEditModel"
|
||||||
|
EditCanceling="EditCanceling"
|
||||||
EditMode="GridEditMode.EditRow"
|
EditMode="GridEditMode.EditRow"
|
||||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||||
OnGridEditModelSaving="OnGridEditModelSaving"
|
OnGridEditModelSaving="OnGridEditModelSaving"
|
||||||
|
|
@ -152,4 +153,9 @@
|
||||||
// StateHasChanged();
|
// StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EditCanceling(GridEditCancelingEventArgs e)
|
||||||
|
{
|
||||||
|
_isNewState = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue