ba#&#@#@#ába commit
This commit is contained in:
parent
e3c4239c87
commit
5a52545071
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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,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
|
||||||
|
|
@ -19,16 +20,38 @@
|
||||||
|
|
||||||
<TransferDestinationToProductGrid Logger="_logger"
|
<TransferDestinationToProductGrid Logger="_logger"
|
||||||
SignalRClient="AdminSignalRClient"
|
SignalRClient="AdminSignalRClient"
|
||||||
|
CustomizeEditModel="CustomizeEditModel"
|
||||||
|
OnGridEditModelSaving="OnGridEditModelSaving"
|
||||||
Context="TransferDestinationToProductContext"
|
Context="TransferDestinationToProductContext"
|
||||||
PageSize="10"
|
PageSize="10"
|
||||||
ValidationEnabled="false"
|
ValidationEnabled="false"
|
||||||
EditMode="GridEditMode.EditForm"
|
EditMode="GridEditMode.EditRow"
|
||||||
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="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)}";
|
||||||
|
|
@ -48,7 +71,7 @@
|
||||||
</DxTabPage>
|
</DxTabPage>
|
||||||
</DxTabs>
|
</DxTabs>
|
||||||
</DetailRowTemplate>
|
</DetailRowTemplate>
|
||||||
<EditFormTemplate Context="editFormContext">
|
@* <EditFormTemplate Context="editFormContext">
|
||||||
@{
|
@{
|
||||||
var transferDestinationToProduct = (TransferDestinationToProduct)editFormContext.EditModel;
|
var transferDestinationToProduct = (TransferDestinationToProduct)editFormContext.EditModel;
|
||||||
}
|
}
|
||||||
|
|
@ -63,38 +86,13 @@
|
||||||
@editFormContext.GetEditor("Price3")
|
@editFormContext.GetEditor("Price3")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
<DxFormLayoutItem Context="FormLayoutContext" Caption="TransferDestination" ColSpanMd="4">
|
<DxFormLayoutItem Context="FormLayoutContext" Caption="TransferDestination" ColSpanMd="4">
|
||||||
@{
|
|
||||||
var contextId = ((TransferDestinationToProduct)editFormContext.EditModel).Id;
|
|
||||||
TransferDestinationToProduct thisItem = (TransferDestinationToProduct)editFormContext.EditModel;
|
|
||||||
if (Value != null)
|
|
||||||
{
|
|
||||||
thisItem.TransferDestinationId = ((TransferDestination)Value).Id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<DxDropDownBox @bind-Value="Value"
|
|
||||||
QueryDisplayText="QueryText"
|
|
||||||
DropDownWidthMode="DropDownWidthMode.ContentWidth"
|
|
||||||
ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
|
|
||||||
NullText="Select a destination..."
|
|
||||||
InputId="ddbSearchLookup"
|
|
||||||
CssClass="cw-480">
|
|
||||||
<DropDownBodyTemplate>
|
|
||||||
<TransferDestinationGrid Logger="_logger"
|
|
||||||
SignalRClient="AdminSignalRClient"
|
|
||||||
GetAllMessageTag="@SignalRTags.GetAllTransferDestinations"
|
|
||||||
ShowSearchBox="true"
|
|
||||||
SelectedDataItem="@Value"
|
|
||||||
SelectedDataItemChanged="item => GridSelectedDataItemChanged(item, context.DropDownBox)"/>
|
|
||||||
</DropDownBodyTemplate>
|
|
||||||
</DxDropDownBox>
|
|
||||||
|
|
||||||
</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> *@
|
||||||
|
|
||||||
</TransferDestinationToProductGrid>
|
</TransferDestinationToProductGrid>
|
||||||
|
|
||||||
|
|
@ -102,41 +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 = [];
|
||||||
|
|
||||||
|
|
||||||
object Value { get; set; }
|
protected override async Task OnInitializedAsync()
|
||||||
|
|
||||||
string QueryText(DropDownBoxQueryDisplayTextContext arg)
|
|
||||||
{
|
|
||||||
if (arg.Value is TransferDestination value)
|
|
||||||
return value.Id.ToString();
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
void GridSelectedDataItemChanged(object item, IDropDownBox dropDownBox)
|
|
||||||
{
|
|
||||||
Value = item as TransferDestination;
|
|
||||||
dropDownBox.HideDropDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
{
|
||||||
_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)
|
||||||
// {
|
// {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,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"
|
||||||
|
|
@ -175,4 +176,9 @@
|
||||||
_isNewState = false;
|
_isNewState = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EditCanceling(GridEditCancelingEventArgs e)
|
||||||
|
{
|
||||||
|
_isNewState = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue