Merge branch 'master' of http://git2.aycode.com/Adam/TourIAm
This commit is contained in:
commit
2a3c61c3f3
|
|
@ -55,17 +55,13 @@ namespace TIAM.Database.DataLayers.Admins
|
|||
|
||||
#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>> GetTransfersByDriverUserIdAsync(Guid driverUserId)
|
||||
=> 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>> 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>> GetTransfersByUserProductMappingIdAsync(Guid userProductMappingId) => SessionAsync(ctx => ctx.GetTransfersByUserProductMappingId(userProductMappingId).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> 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 Transfer? GetTransferById(Guid transferId) => Session(ctx => ctx.GetTransferById(transferId));
|
||||
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.Entities.Transfers;
|
||||
|
||||
|
|
@ -43,6 +44,16 @@ public static class TransferDbSetExtensions
|
|||
|
||||
#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)
|
||||
=> ctx.Transfers.FirstOrDefault(x => x.Id == transferId);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,13 @@ public class UserProductMapping : IEntityGuid, IUserRelation, IProductRelation,
|
|||
public UserProductMapping()
|
||||
{ }
|
||||
|
||||
public UserProductMapping(UserProductMapping upm) : this(upm.Id, upm.UserId, upm.ProductId, upm.Permissions, upm.JsonDetailModel)
|
||||
{
|
||||
IsAdmin = upm.IsAdmin;
|
||||
Created = upm.Created;
|
||||
Modified = upm.Modified;
|
||||
}
|
||||
|
||||
public UserProductMapping(Guid userId, Guid productId) : this(Guid.NewGuid(), userId, productId)
|
||||
{ }
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace TIAM.Models.Dtos.Users
|
|||
|
||||
foreach (var userProduct in user.UserProductMappings)
|
||||
{
|
||||
UserProductMappings.Add(new UserProductMapping(userProduct.Id, userProduct.UserId, userProduct.ProductId));
|
||||
UserProductMappings.Add(new UserProductMapping(userProduct));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
<DxTabPage Text="Driving permissions assigned">
|
||||
<UserProductMappingGridComponent GetAllTag="SignalRTags.GetUserProductMappingsById" ContextIds="new[] { ((Car)context.DataItem).UserProductMappingId }"
|
||||
NewButtonVisible="false"/>
|
||||
CommandColumnVisible="false" />
|
||||
</DxTabPage>
|
||||
|
||||
</DxTabs>
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
var car = (Car)userEditFormContext.EditModel;
|
||||
}
|
||||
<DxFormLayout CssClass="w-100">
|
||||
<DxFormLayoutItem Caption="Country code" ColSpanMd="4">
|
||||
<DxFormLayoutItem Caption="Country code" ColSpanMd="4" >
|
||||
@userEditFormContext.GetEditor("CountryCode")
|
||||
</DxFormLayoutItem>
|
||||
<DxFormLayoutItem Caption="Licence plate" ColSpanMd="4">
|
||||
|
|
|
|||
|
|
@ -44,12 +44,12 @@
|
|||
DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Auto"
|
||||
ShowFilterRow="true">
|
||||
<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="LogLevel" Caption="LogLevel" Width="80px" />
|
||||
<DxGridDataColumn FieldName="ThreadId" Caption="ThId" Width="55px" />
|
||||
<DxGridDataColumn FieldName="CategoryName" Width="170" />
|
||||
<DxGridDataColumn FieldName="CallerName" Width="200" />
|
||||
<DxGridDataColumn FieldName="CallerName" Width="220" />
|
||||
<DxGridDataColumn FieldName="Text" />
|
||||
<DxGridDataColumn FieldName="Exception" Width="200" />
|
||||
<DxGridDataColumn FieldName="ErrorType" Visible="false" />
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@
|
|||
CustomizeEditModel="Grid_CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
AllowSelectRowByClick="true"
|
||||
PageSize="13"
|
||||
ShowFilterRow="true">
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode">
|
||||
<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="UserId" Caption="UserId" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
@{
|
||||
|
|
@ -80,7 +80,10 @@
|
|||
</UserProductMappingGrid>
|
||||
|
||||
@code {
|
||||
[Parameter] public bool CommandColumnVisible { 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 int GetAllTag { get; set; } = SignalRTags.GetAllUserProductMappings;
|
||||
|
|
|
|||
|
|
@ -104,8 +104,7 @@ namespace TIAMSharedUI.Shared.Components.Grids
|
|||
}
|
||||
|
||||
var crudTags = new SignalRCrudTags(GetAllMessageTag, GetItemMessageTag, AddMessageTag, UpdateMessageTag, RemoveMessageTag);
|
||||
_dataSource = new SignalRDataSource<TDataItem>(SignalRClient, crudTags, ContextIds);
|
||||
_dataSource.FilterText = FilterText;
|
||||
_dataSource = new SignalRDataSource<TDataItem>(SignalRClient, crudTags, ContextIds) { FilterText = FilterText };
|
||||
|
||||
Data = _dataSource;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace TIAMWebApp.Shared.Application.Models
|
|||
UserType = userType;
|
||||
UserModelDto = userModelDto;
|
||||
HasProperties = hasProperties;
|
||||
//UserRoles = userRoles;
|
||||
UserRoles = userRoles;
|
||||
//UserRolesDictionary = new Dictionary<int, string>();
|
||||
|
||||
//UserModelDto.ServiceProviders[0].
|
||||
|
|
|
|||
Loading…
Reference in New Issue