destinations
This commit is contained in:
parent
407219efc7
commit
d111a96c76
|
|
@ -1,6 +1,7 @@
|
||||||
@page "/user/destinations"
|
@page "/sysadmin/destinations"
|
||||||
@using BlazorAnimation
|
@using BlazorAnimation
|
||||||
@using TIAM.Resources
|
@using TIAM.Resources
|
||||||
|
@using TIAM.Services
|
||||||
@using TIAMSharedUI.Shared
|
@using TIAMSharedUI.Shared
|
||||||
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
@using TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
||||||
@using AyCode.Services.Loggers
|
@using AyCode.Services.Loggers
|
||||||
|
|
@ -27,66 +28,7 @@
|
||||||
IconCssClass="btn-column-chooser"
|
IconCssClass="btn-column-chooser"
|
||||||
Click="ColumnChooserButton_Click" />
|
Click="ColumnChooserButton_Click" />
|
||||||
</div>
|
</div>
|
||||||
<DxGrid @ref="Grid"
|
<TransferDestinationGridComponent DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto" GetAllTag="SignalRTags.GetAllTransferDestinations"></TransferDestinationGridComponent>
|
||||||
Data="_transferDestinationWizardModels"
|
|
||||||
PageSize="8"
|
|
||||||
KeyFieldName="Id"
|
|
||||||
ValidationEnabled="false"
|
|
||||||
CustomizeElement="Grid_CustomizeElement"
|
|
||||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
|
||||||
EditModelSaving="Grid_EditModelSaving"
|
|
||||||
DataItemDeleting="Grid_DataItemDeleting"
|
|
||||||
EditMode="GridEditMode.EditForm"
|
|
||||||
ColumnResizeMode="GridColumnResizeMode.ColumnsContainer"
|
|
||||||
KeyboardNavigationEnabled="true"
|
|
||||||
ShowFilterRow="true">
|
|
||||||
<Columns>
|
|
||||||
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
|
||||||
|
|
||||||
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="20%" Visible="false" />
|
|
||||||
<DxGridDataColumn FieldName="Name" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="20%">
|
|
||||||
<CellDisplayTemplate>
|
|
||||||
@{
|
|
||||||
var keyField = context.Value;
|
|
||||||
<a class="d-block text-left" href="transferdetails">@context.Value</a>
|
|
||||||
}
|
|
||||||
</CellDisplayTemplate>
|
|
||||||
</DxGridDataColumn>
|
|
||||||
<DxGridDataColumn FieldName="Description" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="20%" />
|
|
||||||
<DxGridDataColumn FieldName="AddressString" MinWidth="80" Width="20%" />
|
|
||||||
<DxGridDataColumn FieldName="PriceType" MinWidth="80" Width="20%" />
|
|
||||||
<DxGridDataColumn FieldName="Price" MinWidth="80" />
|
|
||||||
<DxGridDataColumn FieldName="Price2" MinWidth="80" />
|
|
||||||
<DxGridDataColumn FieldName="Price3" MinWidth="80" />
|
|
||||||
|
|
||||||
|
|
||||||
</Columns>
|
|
||||||
|
|
||||||
<EditFormTemplate Context="EditFormContext">
|
|
||||||
@{
|
|
||||||
var transfer = (TransferDestinationWizardModel)EditFormContext.EditModel;
|
|
||||||
}
|
|
||||||
<DxFormLayout CssClass="w-100">
|
|
||||||
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationName) ColSpanMd="6">
|
|
||||||
@EditFormContext.GetEditor("Name")
|
|
||||||
</DxFormLayoutItem>
|
|
||||||
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Destination) ColSpanMd="6">
|
|
||||||
@EditFormContext.GetEditor("Description")
|
|
||||||
</DxFormLayoutItem>
|
|
||||||
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
|
|
||||||
@EditFormContext.GetEditor("AddressString")
|
|
||||||
</DxFormLayoutItem>
|
|
||||||
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6">
|
|
||||||
@EditFormContext.GetEditor("PriceType")
|
|
||||||
</DxFormLayoutItem>
|
|
||||||
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6">
|
|
||||||
@EditFormContext.GetEditor("Price")
|
|
||||||
</DxFormLayoutItem>
|
|
||||||
|
|
||||||
</DxFormLayout>
|
|
||||||
</EditFormTemplate>
|
|
||||||
|
|
||||||
</DxGrid>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
@using TIAM.Entities.Transfers
|
||||||
|
@using TIAM.Entities.Drivers
|
||||||
|
@using TIAM.Models.Dtos.Users
|
||||||
|
@using TIAM.Resources
|
||||||
|
@using TIAMSharedUI.Shared.Components.Grids
|
||||||
|
@using TIAMWebApp.Shared.Application.Interfaces
|
||||||
|
@using TIAMWebApp.Shared.Application.Utility
|
||||||
|
@using TIAM.Core.Loggers
|
||||||
|
@using AyCode.Core.Loggers
|
||||||
|
@using AyCode.Services.Loggers
|
||||||
|
@using TIAMWebApp.Shared.Application.Services
|
||||||
|
@using AyCode.Core.Enums
|
||||||
|
@using AyCode.Core.Extensions
|
||||||
|
@using AyCode.Core
|
||||||
|
@inject IUserDataService UserDataService
|
||||||
|
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||||
|
@inject AdminSignalRClient AdminSignalRClient;
|
||||||
|
@inject IStringLocalizer<TIAMResources> localizer
|
||||||
|
|
||||||
|
<TransferDestinationGrid @ref="_transferToDriversGrid"
|
||||||
|
Logger="_logger"
|
||||||
|
SignalRClient="AdminSignalRClient"
|
||||||
|
PageSize="8"
|
||||||
|
GetAllMessageTag="GetAllTag"
|
||||||
|
KeyFieldName="Id"
|
||||||
|
ValidationEnabled="false"
|
||||||
|
CustomizeEditModel="CustomizeEditModel"
|
||||||
|
EditMode="GridEditMode.EditForm"
|
||||||
|
ColumnResizeMode="GridColumnResizeMode.ColumnsContainer"
|
||||||
|
KeyboardNavigationEnabled="true"
|
||||||
|
ShowFilterRow="true">
|
||||||
|
<Columns>
|
||||||
|
<DxGridCommandColumn Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
||||||
|
|
||||||
|
<DxGridDataColumn FieldName="Id" MinWidth="80" Width="20%" Visible="false" />
|
||||||
|
<DxGridDataColumn FieldName="Name" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="20%">
|
||||||
|
<CellDisplayTemplate>
|
||||||
|
@{
|
||||||
|
var keyField = context.Value;
|
||||||
|
<a class="d-block text-left" href="transferdetails">@context.Value</a>
|
||||||
|
}
|
||||||
|
</CellDisplayTemplate>
|
||||||
|
</DxGridDataColumn>
|
||||||
|
<DxGridDataColumn FieldName="Description" FixedPosition="GridColumnFixedPosition.Left" MinWidth="80" Width="20%" />
|
||||||
|
<DxGridDataColumn FieldName="AddressString" MinWidth="80" Width="20%" />
|
||||||
|
<DxGridDataColumn FieldName="PriceType" MinWidth="80" Width="20%" />
|
||||||
|
<DxGridDataColumn FieldName="Price" MinWidth="80" />
|
||||||
|
<DxGridDataColumn FieldName="Price2" MinWidth="80" />
|
||||||
|
<DxGridDataColumn FieldName="Price3" MinWidth="80" />
|
||||||
|
|
||||||
|
|
||||||
|
</Columns>
|
||||||
|
|
||||||
|
<EditFormTemplate Context="EditFormContext">
|
||||||
|
@{
|
||||||
|
var transfer = (TransferDestination)EditFormContext.EditModel;
|
||||||
|
}
|
||||||
|
<DxFormLayout CssClass="w-100">
|
||||||
|
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationName) ColSpanMd="6">
|
||||||
|
@EditFormContext.GetEditor("Name")
|
||||||
|
</DxFormLayoutItem>
|
||||||
|
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Destination) ColSpanMd="6">
|
||||||
|
@EditFormContext.GetEditor("Description")
|
||||||
|
</DxFormLayoutItem>
|
||||||
|
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.DestinationAddress) ColSpanMd="6">
|
||||||
|
@EditFormContext.GetEditor("AddressString")
|
||||||
|
</DxFormLayoutItem>
|
||||||
|
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6">
|
||||||
|
@EditFormContext.GetEditor("PriceType")
|
||||||
|
</DxFormLayoutItem>
|
||||||
|
<DxFormLayoutItem Caption=@localizer.GetString(ResourceKeys.Price) ColSpanMd="6">
|
||||||
|
@EditFormContext.GetEditor("Price")
|
||||||
|
</DxFormLayoutItem>
|
||||||
|
|
||||||
|
</DxFormLayout>
|
||||||
|
</EditFormTemplate>
|
||||||
|
|
||||||
|
</TransferDestinationGrid>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter] public bool KeyboardNavigationEnabled { get; set; }
|
||||||
|
[Parameter] public Guid? ContextId { get; set; }
|
||||||
|
[Parameter] public int GetAllTag { get; set; }
|
||||||
|
[Parameter] public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; } = GridDetailExpandButtonDisplayMode.Never;
|
||||||
|
|
||||||
|
private TransferDestinationGrid _transferToDriversGrid = null!;
|
||||||
|
private LoggerClient<TransferDestinationGridComponent> _logger = null!;
|
||||||
|
|
||||||
|
protected override void OnInitialized()
|
||||||
|
{
|
||||||
|
_logger = new LoggerClient<TransferDestinationGridComponent>(LogWriters.ToArray());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataItemChanged(GridDataItemChangedEventArgs<TransferToDriver> args)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataItemSaving(GridEditModelSavingEventArgs obj)
|
||||||
|
{
|
||||||
|
_logger.Debug($"DataItemSaving");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DataItemDeleting(GridDataItemDeletingEventArgs obj)
|
||||||
|
{
|
||||||
|
_logger.Debug($"DataItemDeleting");
|
||||||
|
}
|
||||||
|
|
||||||
|
void CustomizeEditModel(GridCustomizeEditModelEventArgs e)
|
||||||
|
{
|
||||||
|
if (!e.IsNew) return;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -96,7 +96,7 @@
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
if(ContextId != null)
|
if(ContextId.HasValue)
|
||||||
{
|
{
|
||||||
ContextIds[0] = (Guid)ContextId!;
|
ContextIds[0] = (Guid)ContextId!;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
|
{
|
||||||
|
if(ContextId.HasValue)
|
||||||
{
|
{
|
||||||
ContextIds[0] = (Guid)ContextId!;
|
ContextIds[0] = (Guid)ContextId!;
|
||||||
|
|
||||||
|
}
|
||||||
base.OnParametersSet();
|
base.OnParametersSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using TIAM.Entities.Profiles;
|
||||||
|
using TIAM.Services;
|
||||||
|
|
||||||
|
namespace TIAMSharedUI.Shared.Components.Grids;
|
||||||
|
|
||||||
|
public class TransferDestinationDetailGrid : TransferDestinationGrid
|
||||||
|
{
|
||||||
|
public TransferDestinationDetailGrid() : base()
|
||||||
|
{
|
||||||
|
GetAllMessageTag = SignalRTags.GetAllTransferDestinations;
|
||||||
|
AddMessageTag = SignalRTags.CreateTransferDestination;
|
||||||
|
UpdateMessageTag = SignalRTags.UpdateTransferDestination;
|
||||||
|
RemoveMessageTag = SignalRTags.RemoveTransferDestination;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
||||||
|
{
|
||||||
|
if (!IsFirstInitializeParameters)
|
||||||
|
{
|
||||||
|
//ShowFilterRow = true;
|
||||||
|
//ShowGroupPanel = true;
|
||||||
|
//AllowSort = false;
|
||||||
|
|
||||||
|
//etc...
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.SetParametersAsyncCore(parameters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using TIAM.Entities.Profiles;
|
||||||
|
using TIAM.Services;
|
||||||
|
|
||||||
|
|
||||||
|
namespace TIAMSharedUI.Shared.Components.Grids;
|
||||||
|
|
||||||
|
public class TransferDestinationGrid : TiamGrid<Profile>
|
||||||
|
{
|
||||||
|
public TransferDestinationGrid() : base()
|
||||||
|
{
|
||||||
|
GetAllMessageTag = SignalRTags.GetAllTransferDestinations;
|
||||||
|
AddMessageTag = SignalRTags.CreateTransferDestination;
|
||||||
|
UpdateMessageTag = SignalRTags.UpdateTransferDestination;
|
||||||
|
RemoveMessageTag = SignalRTags.RemoveTransferDestination;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
||||||
|
{
|
||||||
|
if (!IsFirstInitializeParameters)
|
||||||
|
{
|
||||||
|
//ShowFilterRow = true;
|
||||||
|
//ShowGroupPanel = true;
|
||||||
|
//AllowSort = false;
|
||||||
|
|
||||||
|
//etc...
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.SetParametersAsyncCore(parameters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -12,7 +12,7 @@ public class TransferDestinationToProductDetailGrid : TransferDestinationToProdu
|
||||||
GetAllMessageTag = SignalRTags.GetAllTransferDestinationToProducts;
|
GetAllMessageTag = SignalRTags.GetAllTransferDestinationToProducts;
|
||||||
AddMessageTag = SignalRTags.CreateTransferDestinationToProduct;
|
AddMessageTag = SignalRTags.CreateTransferDestinationToProduct;
|
||||||
UpdateMessageTag = SignalRTags.UpdateTransferDestinationToProduct;
|
UpdateMessageTag = SignalRTags.UpdateTransferDestinationToProduct;
|
||||||
RemoveMessageTag = SignalRTags.DeleteTransferDestinationToProduct;
|
RemoveMessageTag = SignalRTags.RemoveTransferDestinationToProduct;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ public class TransferDestinationToProductGrid : TiamGrid<TransferDestinationToPr
|
||||||
GetAllMessageTag = SignalRTags.GetAllTransferDestinationToProducts;
|
GetAllMessageTag = SignalRTags.GetAllTransferDestinationToProducts;
|
||||||
AddMessageTag = SignalRTags.CreateTransferDestinationToProduct;
|
AddMessageTag = SignalRTags.CreateTransferDestinationToProduct;
|
||||||
UpdateMessageTag = SignalRTags.UpdateTransferDestinationToProduct;
|
UpdateMessageTag = SignalRTags.UpdateTransferDestinationToProduct;
|
||||||
RemoveMessageTag = SignalRTags.DeleteTransferDestinationToProduct;
|
RemoveMessageTag = SignalRTags.RemoveTransferDestinationToProduct;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
protected override Task SetParametersAsyncCore(ParameterView parameters)
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
<Items>
|
<Items>
|
||||||
<DxMenuItem NavigateUrl="user/sysadmin" Text="Dashboard" />
|
<DxMenuItem NavigateUrl="user/sysadmin" Text="Dashboard" />
|
||||||
<DxMenuItem NavigateUrl="sysadmin/transfers" Text="Transfers" />
|
<DxMenuItem NavigateUrl="sysadmin/transfers" Text="Transfers" />
|
||||||
|
<DxMenuItem NavigateUrl="sysadmin/destinations" Text="Destinations" />
|
||||||
<DxMenuItem NavigateUrl="sysadmin/companies" Text="Companies" />
|
<DxMenuItem NavigateUrl="sysadmin/companies" Text="Companies" />
|
||||||
<DxMenuItem NavigateUrl="sysadmin/prices" Text="Partner prices" />
|
<DxMenuItem NavigateUrl="sysadmin/prices" Text="Partner prices" />
|
||||||
<DxMenuItem NavigateUrl="sysadmin/products" Text="Services" />
|
<DxMenuItem NavigateUrl="sysadmin/products" Text="Services" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue