improvements, fixes, etc...
This commit is contained in:
parent
4e4afd538c
commit
04c70480e5
|
|
@ -55,17 +55,13 @@ namespace TIAM.Database.DataLayers.Admins
|
||||||
|
|
||||||
#region Transfer
|
#region Transfer
|
||||||
|
|
||||||
public Task<List<Transfer>> GetTransfersByFilterAsync(CriteriaOperator criteriaOperator) => SessionAsync(ctx => (ctx.GetTransfers().AppendWhere(new CriteriaToExpressionConverter(), criteriaOperator) as IQueryable<Transfer>)!.ToList());
|
public Task<List<Transfer>> GetTransfersByFilterAsync(CriteriaOperator criteriaOperator) => SessionAsync(ctx => (ctx.GetTransfers().AppendWhere(new CriteriaToExpressionConverter(), criteriaOperator) as IQueryable<Transfer>)!.OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToList());
|
||||||
|
public Task<List<Transfer>> GetTransfersByDriverUserIdAsync(Guid driverUserId) => SessionAsync(ctx => ctx.GetTransfersByDriverUserId(driverUserId).OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToList());
|
||||||
public Task<List<Transfer>> GetTransfersByDriverUserIdAsync(Guid driverUserId)
|
public Task<List<Transfer>> GetTransfersByUserProductMappingIdAsync(Guid userProductMappingId) => SessionAsync(ctx => ctx.GetTransfersByUserProductMappingId(userProductMappingId).OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToList());
|
||||||
=> SessionAsync(ctx => ctx.GetTransfers().Where(x => x.TransferToDrivers.Any(ttd => ttd.UserProductMapping.UserId == driverUserId)).ToList());
|
|
||||||
|
|
||||||
public Task<List<Transfer>> GetTransfersByUserProductMappingIdAsync(Guid userProductMappingId)
|
|
||||||
=> SessionAsync(ctx => ctx.GetTransfers().Where(x => x.TransferToDrivers.Any(ttd => ttd.UserProductMappingId == userProductMappingId)).ToList());
|
|
||||||
|
|
||||||
public Task<List<Transfer>> GetTransfersAsync() => SessionAsync(ctx => ctx.GetTransfers().OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToList());
|
public Task<List<Transfer>> GetTransfersAsync() => SessionAsync(ctx => ctx.GetTransfers().OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToList());
|
||||||
public Task<string> GetTransfersJsonAsync() => SessionAsync(ctx => ctx.GetTransfers().OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToJson());
|
public Task<string> GetTransfersJsonAsync() => SessionAsync(ctx => ctx.GetTransfers().OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToJson());
|
||||||
public Task<string> GetTransfersByUserIdJsonAsync(Guid userId) => SessionAsync(ctx => ctx.GetTransfers().Where(x => x.UserId == userId).OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToJson());
|
public Task<string> GetTransfersByUserIdJsonAsync(Guid userId) => SessionAsync(ctx => ctx.GetTransfersByUserId(userId).OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToJson());
|
||||||
public string GetTransfersJson() => Session(ctx => ctx.GetTransfers().OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToJson());
|
public string GetTransfersJson() => Session(ctx => ctx.GetTransfers().OrderBy(x => x.TransferStatusType).ThenByDescending(x => x.OrderId).ToJson());
|
||||||
public Transfer? GetTransferById(Guid transferId) => Session(ctx => ctx.GetTransferById(transferId));
|
public Transfer? GetTransferById(Guid transferId) => Session(ctx => ctx.GetTransferById(transferId));
|
||||||
public string? GetTransferJsonById(Guid transferId) => Session(ctx => ctx.GetTransferById(transferId)?.ToJson());
|
public string? GetTransferJsonById(Guid transferId) => Session(ctx => ctx.GetTransferById(transferId)?.ToJson());
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
using DevExpress.Utils.Serializing;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using TIAM.Core.Enums;
|
using TIAM.Core.Enums;
|
||||||
using TIAM.Entities.Transfers;
|
using TIAM.Entities.Transfers;
|
||||||
|
|
||||||
|
|
@ -43,6 +44,16 @@ public static class TransferDbSetExtensions
|
||||||
|
|
||||||
#endregion Add, Update, Remove
|
#endregion Add, Update, Remove
|
||||||
|
|
||||||
|
public static IQueryable<Transfer> GetTransfersByUserId(this ITransferDbSet ctx, Guid userId)
|
||||||
|
=> ctx.GetTransfers().Where(x => x.UserId == userId);
|
||||||
|
|
||||||
|
public static IQueryable<Transfer> GetTransfersByDriverUserId(this ITransferDbSet ctx, Guid driverUserId)
|
||||||
|
=> ctx.GetTransfers().Where(x => x.TransferToDrivers.Any(ttd => ttd.UserProductMapping.UserId == driverUserId));
|
||||||
|
|
||||||
|
public static IQueryable<Transfer> GetTransfersByUserProductMappingId(this ITransferDbSet ctx, Guid userProductMappingId)
|
||||||
|
=> ctx.GetTransfers().Where(x => x.TransferToDrivers.Any(ttd => ttd.UserProductMappingId == userProductMappingId));
|
||||||
|
|
||||||
|
|
||||||
public static Transfer? GetTransferById(this ITransferDbSet ctx, Guid transferId)
|
public static Transfer? GetTransferById(this ITransferDbSet ctx, Guid transferId)
|
||||||
=> ctx.Transfers.FirstOrDefault(x => x.Id == transferId);
|
=> ctx.Transfers.FirstOrDefault(x => x.Id == transferId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
<DxTabPage Text="Driving permissions assigned">
|
<DxTabPage Text="Driving permissions assigned">
|
||||||
<UserProductMappingGridComponent GetAllTag="SignalRTags.GetUserProductMappingsById" ContextIds="new[] { ((Car)context.DataItem).UserProductMappingId }"
|
<UserProductMappingGridComponent GetAllTag="SignalRTags.GetUserProductMappingsById" ContextIds="new[] { ((Car)context.DataItem).UserProductMappingId }"
|
||||||
NewButtonVisible="false"/>
|
CommandColumnVisible="false" />
|
||||||
</DxTabPage>
|
</DxTabPage>
|
||||||
|
|
||||||
</DxTabs>
|
</DxTabs>
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
var car = (Car)userEditFormContext.EditModel;
|
var car = (Car)userEditFormContext.EditModel;
|
||||||
}
|
}
|
||||||
<DxFormLayout CssClass="w-100">
|
<DxFormLayout CssClass="w-100">
|
||||||
<DxFormLayoutItem Caption="Country code" ColSpanMd="4">
|
<DxFormLayoutItem Caption="Country code" ColSpanMd="4" >
|
||||||
@userEditFormContext.GetEditor("CountryCode")
|
@userEditFormContext.GetEditor("CountryCode")
|
||||||
</DxFormLayoutItem>
|
</DxFormLayoutItem>
|
||||||
<DxFormLayoutItem Caption="Licence plate" ColSpanMd="4">
|
<DxFormLayoutItem Caption="Licence plate" ColSpanMd="4">
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,12 @@
|
||||||
DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto"
|
DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto"
|
||||||
ShowFilterRow="true">
|
ShowFilterRow="true">
|
||||||
<Columns>
|
<Columns>
|
||||||
<DxGridDataColumn FieldName="TimeStampUtc" Caption="TimeStampUtc" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" DisplayFormat="g" Width="130" />
|
<DxGridDataColumn FieldName="TimeStampUtc" Caption="TimeStampUtc" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" DisplayFormat="yyyy-MM-dd HH:mm:ss.fff" Width="165" />
|
||||||
<DxGridDataColumn FieldName="AppType" Caption="AppType" Width="80px" />
|
<DxGridDataColumn FieldName="AppType" Caption="AppType" Width="80px" />
|
||||||
<DxGridDataColumn FieldName="LogLevel" Caption="LogLevel" Width="80px" />
|
<DxGridDataColumn FieldName="LogLevel" Caption="LogLevel" Width="80px" />
|
||||||
<DxGridDataColumn FieldName="ThreadId" Caption="ThId" Width="55px" />
|
<DxGridDataColumn FieldName="ThreadId" Caption="ThId" Width="55px" />
|
||||||
<DxGridDataColumn FieldName="CategoryName" Width="170" />
|
<DxGridDataColumn FieldName="CategoryName" Width="170" />
|
||||||
<DxGridDataColumn FieldName="CallerName" Width="200" />
|
<DxGridDataColumn FieldName="CallerName" Width="220" />
|
||||||
<DxGridDataColumn FieldName="Text" />
|
<DxGridDataColumn FieldName="Text" />
|
||||||
<DxGridDataColumn FieldName="Exception" Width="200" />
|
<DxGridDataColumn FieldName="Exception" Width="200" />
|
||||||
<DxGridDataColumn FieldName="ErrorType" Visible="false" />
|
<DxGridDataColumn FieldName="ErrorType" Visible="false" />
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,6 @@
|
||||||
CustomizeEditModel="Grid_CustomizeEditModel"
|
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||||
EditMode="GridEditMode.EditForm"
|
EditMode="GridEditMode.EditForm"
|
||||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||||
AllowSelectRowByClick="true"
|
|
||||||
PageSize="13"
|
PageSize="13"
|
||||||
ShowFilterRow="true">
|
ShowFilterRow="true">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||||
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode">
|
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode">
|
||||||
<Columns>
|
<Columns>
|
||||||
<DxGridCommandColumn Width="135" MinWidth="135" NewButtonVisible="NewButtonVisible" DeleteButtonVisible="AcDomain.IsDeveloperVersion" EditButtonVisible="AcDomain.IsDeveloperVersion" FixedPosition="GridColumnFixedPosition.Left" />
|
<DxGridCommandColumn Width="135" MinWidth="135" Visible="CommandColumnVisible" NewButtonVisible="NewButtonVisible" EditButtonVisible="EditButtonVisible" DeleteButtonVisible="DeleteButtonVisible" 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="UserId" Caption="UserId" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
<DxGridDataColumn FieldName="UserId" Caption="UserId" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||||
@{
|
@{
|
||||||
|
|
@ -80,7 +80,10 @@
|
||||||
</UserProductMappingGrid>
|
</UserProductMappingGrid>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
[Parameter] public bool CommandColumnVisible { get; set; } = true;
|
||||||
[Parameter] public bool NewButtonVisible { get; set; } = true;
|
[Parameter] public bool NewButtonVisible { get; set; } = true;
|
||||||
|
[Parameter] public bool EditButtonVisible { get; set; } = true;
|
||||||
|
[Parameter] public bool DeleteButtonVisible { get; set; } = true;
|
||||||
[Parameter] public IProductRelation ParentData { get; set; } = null!;
|
[Parameter] public IProductRelation ParentData { get; set; } = null!;
|
||||||
|
|
||||||
[Parameter] public int GetAllTag { get; set; } = SignalRTags.GetAllUserProductMappings;
|
[Parameter] public int GetAllTag { get; set; } = SignalRTags.GetAllUserProductMappings;
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,7 @@ namespace TIAMSharedUI.Shared.Components.Grids
|
||||||
}
|
}
|
||||||
|
|
||||||
var crudTags = new SignalRCrudTags(GetAllMessageTag, GetItemMessageTag, AddMessageTag, UpdateMessageTag, RemoveMessageTag);
|
var crudTags = new SignalRCrudTags(GetAllMessageTag, GetItemMessageTag, AddMessageTag, UpdateMessageTag, RemoveMessageTag);
|
||||||
_dataSource = new SignalRDataSource<TDataItem>(SignalRClient, crudTags, ContextIds);
|
_dataSource = new SignalRDataSource<TDataItem>(SignalRClient, crudTags, ContextIds) { FilterText = FilterText };
|
||||||
_dataSource.FilterText = FilterText;
|
|
||||||
|
|
||||||
Data = _dataSource;
|
Data = _dataSource;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue