transferdestinationtoproduct
This commit is contained in:
parent
1e3690f7e8
commit
c94b09a820
|
|
@ -2,6 +2,7 @@
|
||||||
@using BlazorAnimation
|
@using BlazorAnimation
|
||||||
@using TIAM.Models.Dtos.Users
|
@using TIAM.Models.Dtos.Users
|
||||||
@using TIAM.Resources
|
@using TIAM.Resources
|
||||||
|
@using TIAM.Services
|
||||||
@using TIAMSharedUI.Pages.Components
|
@using TIAMSharedUI.Pages.Components
|
||||||
@using TIAMSharedUI.Shared
|
@using TIAMSharedUI.Shared
|
||||||
@using TIAMWebApp.Shared.Application.Interfaces
|
@using TIAMWebApp.Shared.Application.Interfaces
|
||||||
|
|
@ -108,7 +109,7 @@
|
||||||
<ServiceProviderGridComponent ContextId="((UserModelDtoDetail)context.DataItem).Id" />
|
<ServiceProviderGridComponent ContextId="((UserModelDtoDetail)context.DataItem).Id" />
|
||||||
</DxTabPage>
|
</DxTabPage>
|
||||||
<DxTabPage Text="Roles in services">
|
<DxTabPage Text="Roles in services">
|
||||||
<UserProductMappingGridComponent UserModelDtoDetail="(UserModelDtoDetail)context.DataItem" KeyboardNavigationEnabled="true" />
|
<UserProductMappingGridComponent GetAllTag="SignalRTags.GetUserProductMappingsByUserId" ContextIds="new [] {((UserModelDtoDetail)context.DataItem).Id}" KeyboardNavigationEnabled="true" />
|
||||||
</DxTabPage>
|
</DxTabPage>
|
||||||
</DxTabs>
|
</DxTabs>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,9 @@
|
||||||
</Columns>
|
</Columns>
|
||||||
<DetailRowTemplate>
|
<DetailRowTemplate>
|
||||||
<DxTabs>
|
<DxTabs>
|
||||||
|
<DxTabPage Text="Prices">
|
||||||
|
<TransferDestinationToProductDetailGridComponent GetAllTag="SignalRTags.GetTransferDestinationToProductByProductId" ContextIds="new [] {((Product)context.DataItem).Id}" KeyboardNavigationEnabled="true" />
|
||||||
|
</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">
|
||||||
</UserProductMappingGridComponent>
|
</UserProductMappingGridComponent>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,145 @@
|
||||||
|
@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 TIAMSharedUI.Shared.Components.Grids
|
||||||
|
@inject IServiceProviderDataService ServiceProviderDataService
|
||||||
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
|
@inject AdminSignalRClient AdminSignalRClient;
|
||||||
|
|
||||||
|
<TransferDestinationToProductDetailGrid
|
||||||
|
Logger="_logger"
|
||||||
|
SignalRClient="AdminSignalRClient"
|
||||||
|
ContextIds="ContextIds"
|
||||||
|
PageSize="5"
|
||||||
|
AutoExpandAllGroupRows="true"
|
||||||
|
KeyboardNavigationEnabled="KeyboardNavigationEnabled"
|
||||||
|
KeyFieldName="Id"
|
||||||
|
ValidationEnabled="false"
|
||||||
|
EditMode="GridEditMode.EditForm"
|
||||||
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||||
|
ShowFilterRow="true">
|
||||||
|
<Columns>
|
||||||
|
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
||||||
|
<DxGridDataColumn FieldName="Id" GroupIndex="0" 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">
|
||||||
|
|
||||||
|
</DxTabPage>
|
||||||
|
|
||||||
|
</DxTabs>
|
||||||
|
|
||||||
|
|
||||||
|
</DetailRowTemplate>
|
||||||
|
<EditFormTemplate Context="EditFormContext">
|
||||||
|
@{
|
||||||
|
var serviceProvider = (Company)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>
|
||||||
|
|
||||||
|
</TransferDestinationToProductDetailGrid>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
|
||||||
|
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
||||||
|
[Parameter] public Guid? ContextId { get; set; }
|
||||||
|
[Parameter] public Guid[]? ContextIds { get; set; } = new Guid[1];
|
||||||
|
[Parameter] public int GetAllTag { get; set; }
|
||||||
|
|
||||||
|
private LoggerClient<TransferDestinationToProductGridComponent> _logger = null!;
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
_logger = new LoggerClient<TransferDestinationToProductGridComponent>(LogWriters.ToArray());
|
||||||
|
|
||||||
|
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
|
||||||
|
//_detailGridData = UserModelDtoDetail.ServiceProviders ?? [];
|
||||||
|
//_availableServices = await ServiceProviderDataService.GetServiceProvidersAsync();
|
||||||
|
|
||||||
|
//_logger.Info($"DetailGridData: {_detailGridData.Count}");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnParametersSet()
|
||||||
|
{
|
||||||
|
if(ContextId != null)
|
||||||
|
{
|
||||||
|
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");
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
|
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
|
||||||
|
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
||||||
[Parameter] public Guid? ContextId { get; set; }
|
[Parameter] public Guid? ContextId { get; set; }
|
||||||
|
|
||||||
[Parameter] public int GetAllTag { get; set; }
|
[Parameter] public int GetAllTag { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using TIAM.Entities.Products;
|
||||||
|
using TIAM.Entities.Transfers;
|
||||||
|
using TIAM.Services;
|
||||||
|
|
||||||
|
namespace TIAMSharedUI.Shared.Components.Grids;
|
||||||
|
|
||||||
|
public class TransferDestinationToProductDetailGrid : TransferDestinationToProductGrid
|
||||||
|
{
|
||||||
|
public TransferDestinationToProductDetailGrid() : base()
|
||||||
|
{
|
||||||
|
GetAllMessageTag = SignalRTags.GetAllTransferDestinationToProducts;
|
||||||
|
AddMessageTag = SignalRTags.CreateTransferDestinationToProduct;
|
||||||
|
UpdateMessageTag = SignalRTags.UpdateTransferDestinationToProduct;
|
||||||
|
RemoveMessageTag = SignalRTags.DeleteTransferDestinationToProduct;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
||||||
|
{
|
||||||
|
if (!IsFirstInitializeParameters)
|
||||||
|
{
|
||||||
|
//ShowFilterRow = true;
|
||||||
|
//ShowGroupPanel = true;
|
||||||
|
//AllowSort = false;
|
||||||
|
|
||||||
|
//etc...
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.SetParametersAsyncCore(parameters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,10 +9,10 @@ public class TransferDestinationToProductGrid : TiamGrid<TransferDestinationToPr
|
||||||
{
|
{
|
||||||
public TransferDestinationToProductGrid() : base()
|
public TransferDestinationToProductGrid() : base()
|
||||||
{
|
{
|
||||||
GetAllMessageTag = SignalRTags.GetProductsByContextId;
|
GetAllMessageTag = SignalRTags.GetAllTransferDestinationToProducts;
|
||||||
AddMessageTag = SignalRTags.AddProduct;
|
AddMessageTag = SignalRTags.CreateTransferDestinationToProduct;
|
||||||
UpdateMessageTag = SignalRTags.UpdateProduct;
|
UpdateMessageTag = SignalRTags.UpdateTransferDestinationToProduct;
|
||||||
RemoveMessageTag = SignalRTags.RemoveProduct;
|
RemoveMessageTag = SignalRTags.DeleteTransferDestinationToProduct;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue