Merge branch 'master' of http://git2.aycode.com/Adam/TourIAm
This commit is contained in:
commit
27adc095d1
|
|
@ -23,6 +23,7 @@ using TIAM.Entities.Transfers;
|
|||
using TIAM.Entities.Users;
|
||||
using TIAM.Models.Dtos.Products;
|
||||
using AyCode.Database.DbSets.Profiles;
|
||||
using TIAM.Database.DbSets.Drivers;
|
||||
|
||||
namespace TIAM.Database.DataLayers.Admins
|
||||
{
|
||||
|
|
@ -66,7 +67,7 @@ namespace TIAM.Database.DataLayers.Admins
|
|||
return ctx.UpdateTransfer(transfer);
|
||||
});
|
||||
|
||||
public Task<bool> RemoveTransferAsync(Transfer transfer) => TransactionAsync(ctx => ctx.RemoveTransfer(transfer));
|
||||
public Task<bool> RemoveTransferAsync(Transfer transfer) => RemoveTransferAsync(transfer.Id);
|
||||
public Task<bool> RemoveTransferAsync(Guid transferId) => TransactionAsync(ctx => ctx.RemoveTransfer(transferId));
|
||||
#endregion Transfer
|
||||
|
||||
|
|
@ -78,40 +79,43 @@ namespace TIAM.Database.DataLayers.Admins
|
|||
|
||||
public Task<bool> AddTransferDestinationAsync(TransferDestination transferDestination) => TransactionAsync(ctx => ctx.AddTransferDestination(transferDestination));
|
||||
public Task<bool> UpdateTransferDestinationAsync(TransferDestination transferDestination) => TransactionAsync(ctx => ctx.UpdateTransferDestination(transferDestination));
|
||||
public Task<bool> RemoveTransferDestinationAsync(TransferDestination transferDestination, bool removeAddress) => TransactionAsync(ctx => ctx.RemoveTransferDestination(transferDestination.Id, removeAddress));
|
||||
public Task<bool> RemoveTransferDestinationAsync(TransferDestination transferDestination, bool removeAddress) => RemoveTransferDestinationAsync(transferDestination.Id, removeAddress);
|
||||
public Task<bool> RemoveTransferDestinationAsync(Guid transferDestinationId, bool removeAddress) => TransactionAsync(ctx => ctx.RemoveTransferDestination(transferDestinationId, removeAddress));
|
||||
#endregion TransferDestination
|
||||
|
||||
#region TransferToDriver
|
||||
public Task<TransferToDriver?> GetTransferToDriverByIdAsync(Guid transferToDriverId, bool autoInclude = false) => SessionAsync(ctx => ctx.TransferToDrivers.FirstOrDefault(x=>x.Id == transferToDriverId));
|
||||
public Task<List<TransferToDriver>> GetTransferToDriversByTransferIdAsync(Guid transferId, bool autoInclude = false) => SessionAsync(ctx => ctx.TransferToDrivers.Where(x => x.TransferId == transferId).ToList());
|
||||
public Task<TransferToDriver?> GetTransferToDriverByIdAsync(Guid transferToDriverId, bool autoInclude = true) => SessionAsync(ctx => ctx.GetTransferToDriverById(transferToDriverId, autoInclude));
|
||||
public Task<List<TransferToDriver>> GetTransferToDriversByTransferIdAsync(Guid transferId, bool autoInclude = true) => SessionAsync(ctx => ctx.GetTransferToDriversByTransferId(transferId, autoInclude).ToList());
|
||||
|
||||
public Task<bool> AddTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.TransferToDrivers.Add(transferToDriver).State == EntityState.Added);
|
||||
public Task<bool> AddTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.AddTransferToDriver(transferToDriver));
|
||||
public async Task<TransferToDriver?> UpdateTransferToDriverAsync(TransferToDriver transferToDriver)
|
||||
{
|
||||
var transferToDriverId = transferToDriver.Id;
|
||||
TransferToDriver transferToDriver2 = null!;
|
||||
|
||||
var result = await TransactionAsync(ctx =>
|
||||
{
|
||||
var transferToDriver2 = ctx.TransferToDrivers.FirstOrDefault(x => x.Id == transferToDriverId)!;
|
||||
transferToDriver2 = ctx.TransferToDrivers.FirstOrDefault(x => x.Id == transferToDriverId)!;
|
||||
transferToDriver2.CarId = transferToDriver.CarId;
|
||||
transferToDriver2.LicencePlate = transferToDriver.LicencePlate;
|
||||
transferToDriver2.UserProductMappingId = transferToDriver.UserProductMappingId;
|
||||
transferToDriver2.TransferId = transferToDriver.TransferId;
|
||||
transferToDriver2.Price = transferToDriver.Price;
|
||||
|
||||
return ctx.TransferToDrivers.Update(transferToDriver2).State == EntityState.Modified;
|
||||
});
|
||||
|
||||
return result ? transferToDriver : null;
|
||||
return result ? transferToDriver2 : null;
|
||||
}
|
||||
|
||||
public Task<bool> RemoveTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.TransferToDrivers.Remove(transferToDriver).State == EntityState.Deleted);
|
||||
public Task<bool> RemoveTransferToDriverAsync(TransferToDriver transferToDriver) => TransactionAsync(ctx => ctx.RemoveTransferToDriver(transferToDriver.Id));
|
||||
#endregion TransferToDriver
|
||||
|
||||
#region Drivers
|
||||
|
||||
public Task<List<UserProductMapping>> GetTAllDrivers() => SessionAsync(ctx => ctx.UserProductMappings.Where(x => ctx.Cars.Any(car => car.UserProductMappingId == x.Id)).ToList());
|
||||
public Task<List<UserProductMapping>> GetTAllDriversByProductId(Guid productId) => SessionAsync(ctx => ctx.UserProductMappings.Where(x => x.ProductId == productId && ctx.Cars.Any(car => car.UserProductMappingId == x.Id)).ToList());
|
||||
public Task<List<UserProductMapping>> GetAllDriversAsync(bool autoInclude = true) => SessionAsync(ctx => ctx.GetAllDrivers(autoInclude).ToList());
|
||||
public Task<List<UserProductMapping>> GetAllDriversByProductIdAsync(Guid productId, bool autoInclude = true) => SessionAsync(ctx => ctx.GetAllDriversByProductId(productId, autoInclude).ToList());
|
||||
#endregion Drivers
|
||||
|
||||
#region TransferDestinationToProduct
|
||||
public TransferDestinationToProduct? GetTransferDestinationToProductById(Guid transferDestinationToProductId) => Session(ctx=>ctx.GetTransferDestinationToProductById(transferDestinationToProductId));
|
||||
public Task<TransferDestinationToProduct?> GetTransferDestinationToProductByIdAsync(Guid transferDestinationToProductId) => SessionAsync(ctx=>ctx.GetTransferDestinationToProductById(transferDestinationToProductId));
|
||||
|
|
@ -125,7 +129,7 @@ namespace TIAM.Database.DataLayers.Admins
|
|||
|
||||
public Task<bool> AddTransferDestinationToProductAsync(TransferDestinationToProduct transferDestinationToProduct) => TransactionAsync(ctx => ctx.AddTransferDestinationToProduct(transferDestinationToProduct));
|
||||
public Task<bool> UpdateTransferDestinationToProductAsync(TransferDestinationToProduct transferDestinationToProduct) => TransactionAsync(ctx => ctx.UpdateTransferDestinationToProduct(transferDestinationToProduct));
|
||||
public Task<bool> RemoveTransferDestinationToProductAsync(TransferDestinationToProduct transferDestinationToProduct) => TransactionAsync(ctx => ctx.RemoveTransferDestinationToProduct(transferDestinationToProduct.Id));
|
||||
public Task<bool> RemoveTransferDestinationToProductAsync(TransferDestinationToProduct transferDestinationToProduct) => RemoveTransferDestinationToProductAsync(transferDestinationToProduct.Id);
|
||||
public Task<bool> RemoveTransferDestinationToProductAsync(Guid transferDestinationToProductId) => TransactionAsync(ctx => ctx.RemoveTransferDestinationToProduct(transferDestinationToProductId));
|
||||
#endregion TransferDestinationToProduct
|
||||
|
||||
|
|
@ -158,7 +162,7 @@ namespace TIAM.Database.DataLayers.Admins
|
|||
public Task<bool> AddProductAsync(Product product) => TransactionAsync(ctx => ctx.AddProduct(product));
|
||||
|
||||
public Task<bool> UpdateProductAsync(Product product) => TransactionAsync(ctx => ctx.UpdateProduct(product));
|
||||
//public Task<bool> RemoveProductAsync(Product product) => TransactionAsync(ctx => ctx.RemoveProduct(product.Id));
|
||||
public Task<bool> RemoveProductAsync(Product product) => RemoveProductAsync(product.Id);
|
||||
public Task<bool> RemoveProductAsync(Guid productId) => TransactionAsync(ctx => ctx.RemoveProduct(productId));
|
||||
|
||||
public UserProductMapping? GetUserProductMappingById(Guid userProductMappingId, bool autoInclude = true) => Session(ctx => ctx.GetUserProductMappingById(userProductMappingId, autoInclude));
|
||||
|
|
@ -217,9 +221,7 @@ namespace TIAM.Database.DataLayers.Admins
|
|||
}
|
||||
|
||||
public Task<bool> RemoveUserProductMappingAsync(Guid userProductMappingId) => TransactionAsync(ctx => ctx.RemoveUserProductMapping(userProductMappingId));
|
||||
|
||||
public Task<bool> RemoveUserProductMappingAsync(Guid userId, Guid productId)
|
||||
=> TransactionAsync(ctx => ctx.RemoveUserProductMapping(userId, productId));
|
||||
public Task<bool> RemoveUserProductMappingAsync(Guid userId, Guid productId) => TransactionAsync(ctx => ctx.RemoveUserProductMapping(userId, productId));
|
||||
|
||||
#endregion UserProductMapping
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using AyCode.Database.DbContexts.Users;
|
||||
using TIAM.Database.DbSets.Drivers;
|
||||
using TIAM.Database.DbSets.Emails;
|
||||
using TIAM.Database.DbSets.Permissions;
|
||||
using TIAM.Database.DbSets.Products;
|
||||
|
|
@ -14,7 +15,7 @@ using TIAM.Entities.Users;
|
|||
namespace TIAM.Database.DbContexts.Admins;
|
||||
|
||||
public interface IAdminDbContext :
|
||||
ICompanyDbSet, IProductDbSet, IUserProductMappingDbSet,
|
||||
ICompanyDbSet, IProductDbSet, IDriverDbSet,
|
||||
IAcUserDbContextBase<User, Profile, UserToken, Company, UserToCompany, Address, EmailMessage>,
|
||||
IPermissionsDbSetContext, ITransferDestinationDbSet, ITransferDbSet, IEmailMessageDbSet
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ namespace TIAM.Database.DbContexts.Users
|
|||
public DbSet<Company> Companies { get; set; }
|
||||
|
||||
public DbSet<Transfer> Transfers { get; set; }
|
||||
public DbSet<TransferToDriver> TransferToDrivers { get; set; }
|
||||
|
||||
public DbSet<TransferDestinationToProduct> TransferDestinationToProducts { get; set; }
|
||||
|
||||
public DbSet<TransferDestination> TransferDestinations { get; set; }
|
||||
|
|
@ -86,6 +88,5 @@ namespace TIAM.Database.DbContexts.Users
|
|||
// //builderUserProductJsonDetail.OwnsMany(userProductJsonDetail => userProductJsonDetail.Cars2);
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using TIAM.Entities.Drivers;
|
||||
|
||||
namespace TIAM.Database.DbSets.Cars;
|
||||
|
||||
public interface ICarDbSet
|
||||
{
|
||||
public DbSet<Car> Cars { get; set; }
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using AyCode.Core.Extensions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TIAM.Database.DbSets.Transfers;
|
||||
using TIAM.Database.DbSets.Users;
|
||||
using TIAM.Entities.Drivers;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Entities.Users;
|
||||
|
||||
namespace TIAM.Database.DbSets.Drivers;
|
||||
|
||||
public static class DriverDbSetExtensions
|
||||
{
|
||||
public static IQueryable<UserProductMapping> GetAllDrivers(this IDriverDbSet ctx, bool autoInclude = true)
|
||||
=> ctx.UserProductMappingsWithRelations(autoInclude).Where(x => ctx.Cars.Any(car => car.UserProductMappingId == x.Id));
|
||||
|
||||
public static IQueryable<UserProductMapping> GetAllDriversByProductId(this IDriverDbSet ctx, Guid productId, bool autoInclude = true)
|
||||
=> ctx.GetAllDrivers(autoInclude).Where(x => x.ProductId == productId);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using TIAM.Database.DbSets.Cars;
|
||||
using TIAM.Database.DbSets.Transfers;
|
||||
using TIAM.Database.DbSets.Users;
|
||||
using TIAM.Entities.Users;
|
||||
|
||||
namespace TIAM.Database.DbSets.Drivers;
|
||||
|
||||
public interface IDriverDbSet : IUserProductMappingDbSet, ICarDbSet, ITransferToDriverDbSet, ITransferDbSet
|
||||
{ }
|
||||
|
|
@ -3,7 +3,7 @@ using TIAM.Entities.Transfers;
|
|||
|
||||
namespace TIAM.Database.DbSets.Transfers;
|
||||
|
||||
public interface ITransferDbSet
|
||||
public interface ITransferDbSet : ITransferToDriverDbSet
|
||||
{
|
||||
public DbSet<Transfer> Transfers { get; set; }
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using TIAM.Entities.Transfers;
|
||||
|
||||
namespace TIAM.Database.DbSets.Transfers;
|
||||
|
||||
public interface ITransferToDriverDbSet
|
||||
{
|
||||
public DbSet<TransferToDriver> TransferToDrivers { get; set; }
|
||||
}
|
||||
|
|
@ -13,8 +13,12 @@ public static class TransferDbSetExtensions
|
|||
public static bool UpdateTransfer(this ITransferDbSet ctx, Transfer transfer)
|
||||
=> ctx.Transfers.Update(transfer).State == EntityState.Modified;
|
||||
|
||||
public static bool RemoveTransfer(this ITransferDbSet ctx, Transfer transfer)
|
||||
=> ctx.Transfers.Remove(transfer).State == EntityState.Deleted;
|
||||
private static bool RemoveTransfer(this ITransferDbSet ctx, Transfer transfer)
|
||||
{
|
||||
ctx.TransferToDrivers.RemoveRange(ctx.TransferToDrivers.Where(x => x.TransferId == transfer.Id));
|
||||
|
||||
return ctx.Transfers.Remove(transfer).State == EntityState.Deleted;
|
||||
}
|
||||
|
||||
public static bool RemoveTransfer(this ITransferDbSet ctx, Guid transferId)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using TIAM.Core.Enums;
|
||||
using TIAM.Database.DbSets.Drivers;
|
||||
using TIAM.Database.DbSets.Users;
|
||||
using TIAM.Entities.Transfers;
|
||||
using TIAM.Entities.Users;
|
||||
|
||||
namespace TIAM.Database.DbSets.Transfers;
|
||||
|
||||
public static class TransferToDriverDbSetExtensions
|
||||
{
|
||||
#region TransferToDriver
|
||||
public static TransferToDriver? GetTransferToDriverById(this ITransferToDriverDbSet ctx, Guid transferToDriverId, bool autoInclude = true)
|
||||
=> ctx.TransferToDrivers.FirstOrDefault(x => x.Id == transferToDriverId);
|
||||
|
||||
public static IQueryable<TransferToDriver> GetTransferToDriversByTransferId(this ITransferToDriverDbSet ctx, Guid transferId, bool autoInclude = true)
|
||||
=> ctx.TransferToDrivers.Where(x => x.TransferId == transferId);
|
||||
|
||||
public static bool AddTransferToDriver(this ITransferDbSet ctx, TransferToDriver transferToDriver)
|
||||
{
|
||||
var transfer = ctx.GetTransferById(transferToDriver.TransferId)!;
|
||||
transfer.TransferStatusType = TransferStatusType.AssignedToDriver;
|
||||
|
||||
return ctx.TransferToDrivers.Add(transferToDriver).State == EntityState.Added;
|
||||
}
|
||||
|
||||
private static bool RemoveTransferToDriver(this ITransferDbSet ctx, TransferToDriver transferToDriver)
|
||||
{
|
||||
//TODO: TransferStatusType change, ha nincs sofőr a törlés után! - J.
|
||||
return ctx.TransferToDrivers.Remove(transferToDriver).State == EntityState.Deleted;
|
||||
}
|
||||
|
||||
public static bool RemoveTransferToDriver(this ITransferDbSet ctx, Guid transferToDriverId)
|
||||
{
|
||||
var transferToDriver = ctx.GetTransferToDriverById(transferToDriverId);
|
||||
return transferToDriver == null || ctx.RemoveTransferToDriver(transferToDriver);
|
||||
}
|
||||
|
||||
#endregion TransferToDriver
|
||||
}
|
||||
|
|
@ -25,7 +25,6 @@ public static class UserProductMappingDbSetExtensions
|
|||
public static IQueryable<UserProductMapping> GetUserProductMappingsByProductId(this IUserProductMappingDbSet ctx, Guid productId, bool autoInclude = true)
|
||||
=> ctx.UserProductMappingsWithRelations(autoInclude).Where(x => x.ProductId == productId);
|
||||
|
||||
|
||||
public static bool AddUserProductMapping(this IUserProductMappingDbSet ctx, UserProductMapping userProductMapping)
|
||||
{
|
||||
if (userProductMapping.UserId.IsNullOrEmpty() || userProductMapping.ProductId.IsNullOrEmpty() || userProductMapping.Permissions < 0)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using AyCode.Interfaces;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
using AyCode.Interfaces;
|
||||
using AyCode.Models.Users;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Profiles;
|
||||
|
|
@ -7,11 +9,20 @@ using TIAM.Entities.Users;
|
|||
|
||||
namespace TIAM.Models.Dtos.Users;
|
||||
|
||||
public class UserModelDto : AcUserModelDtoBase<UserDto, Profile, Company, UserToCompany>, IProductsRelation, IUserModelDtoMinBase, IAcModelDtoBase<User>
|
||||
public class UserModelDto : AcUserModelDtoBase<UserDto, Profile, Company, UserToCompany>, IProductsRelation, IUserModelDtoMinBase, IAcModelDtoBase<User>, IProfileForeignKey
|
||||
{
|
||||
public List<UserProductMapping> UserProductMappings { get; set; }
|
||||
public List<Product> Products { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
[JsonIgnore]
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
public Guid ProfileId
|
||||
{
|
||||
get => ProfileDto.Id;
|
||||
set => ProfileDto.Id = value;
|
||||
}
|
||||
|
||||
public UserModelDto(){}
|
||||
public UserModelDto(User user) : base(user)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
using AyCode.Models.Users;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
using AyCode.Interfaces.TimeStampInfo;
|
||||
using AyCode.Models.Users;
|
||||
using TIAM.Entities.Addresses;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Profiles;
|
||||
|
|
@ -9,15 +12,18 @@ namespace TIAM.Models.Dtos.Users
|
|||
{
|
||||
public class UserModelDtoDetail : AcUserModelDtoDetailBase<UserDtoDetail, Profile, Company, UserToCompany, Address>, IProductsRelation, IUserModelDtoMinBase, IProfileForeignKey
|
||||
{
|
||||
public List<UserProductMapping> UserProductMappings { get; set; }
|
||||
public List<Product> Products { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
[JsonIgnore]
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
public Guid ProfileId
|
||||
{
|
||||
get => ProfileDto.Id;
|
||||
set {}
|
||||
set => ProfileDto.Id = value;
|
||||
}
|
||||
|
||||
public List<UserProductMapping> UserProductMappings { get; set; }
|
||||
public List<Product> Products { get; set; }
|
||||
|
||||
public UserModelDtoDetail()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,13 +35,14 @@
|
|||
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode">
|
||||
<Columns>
|
||||
<DxGridCommandColumn NewButtonVisible="false" DeleteButtonVisible="false" Width="70" MinWidth="70" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" GroupIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="AddressText" />
|
||||
<DxGridDataColumn FieldName="IsValid" Width="40" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
||||
<DxGridDataColumn FieldName="IsHelper" Width="40" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
||||
<DxGridDataColumn FieldName="Latitude" Width="40" />
|
||||
<DxGridDataColumn FieldName="Longitude" Width="40" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<EditFormTemplate>
|
||||
@{
|
||||
|
|
|
|||
|
|
@ -14,28 +14,28 @@
|
|||
@using AyCode.Core
|
||||
@inject IServiceProviderDataService serviceProviderDataService
|
||||
@inject IUserDataService userDataService
|
||||
@inject ITransferDataService transferDataService
|
||||
@inject ITransferDataService transferDataService
|
||||
@inject IEnumerable<IAcLogWriterClientBase> LogWriters
|
||||
|
||||
|
||||
<AddressGrid @ref="Grid" Data="_detailGridData"
|
||||
PageSize="5"
|
||||
ValidationEnabled="false"
|
||||
CustomizeEditModel="CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
ShowFilterRow="true">
|
||||
PageSize="5"
|
||||
ValidationEnabled="false"
|
||||
CustomizeEditModel="CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
ShowFilterRow="true">
|
||||
<Columns>
|
||||
<DxGridCommandColumn NewButtonVisible="false" DeleteButtonVisible="false" Width="70" MinWidth="70" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
||||
<DxGridDataColumn FieldName="AddressText" />
|
||||
<DxGridDataColumn FieldName="IsValid" Width="40" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
||||
<DxGridDataColumn FieldName="IsHelper" Width="40" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
||||
<DxGridDataColumn FieldName="Latitude" Width="40"/>
|
||||
<DxGridDataColumn FieldName="Longitude" Width="40"/>
|
||||
<DxGridDataColumn FieldName="Created" Width="40"/>
|
||||
<DxGridDataColumn FieldName="Modified" Width="40"/>
|
||||
</Columns>
|
||||
<DxGridDataColumn FieldName="Latitude" Width="40" />
|
||||
<DxGridDataColumn FieldName="Longitude" Width="40" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<EditFormTemplate>
|
||||
@{
|
||||
Address bleh = (Address)context.EditModel;
|
||||
|
|
@ -47,8 +47,8 @@
|
|||
</AddressGrid>
|
||||
|
||||
@code {
|
||||
[Parameter]public object AddressContext { get; set; }
|
||||
[Parameter]public string ContextIdType { get; set; }
|
||||
[Parameter] public object AddressContext { get; set; }
|
||||
[Parameter] public string ContextIdType { get; set; }
|
||||
IGrid Grid { get; set; }
|
||||
|
||||
List<TIAM.Entities.Addresses.Address> _detailGridData = new List<Address>();
|
||||
|
|
@ -59,23 +59,23 @@
|
|||
|
||||
public void SaveAddress(object addressOwnerToSave)
|
||||
{
|
||||
|
||||
|
||||
Grid.SaveChangesAsync();
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Address myAddress = new Address();
|
||||
|
||||
|
||||
|
||||
_logger = new LoggerClient<AddressGridComponent>(LogWriters.ToArray());
|
||||
if(ContextIdType == null)
|
||||
if (ContextIdType == null)
|
||||
{
|
||||
//get all profiles from DB
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
switch (ContextIdType)
|
||||
{
|
||||
case ("userprofile"):
|
||||
|
|
@ -104,13 +104,13 @@
|
|||
break;
|
||||
case ("transferdestination"):
|
||||
//get address for transferDestination
|
||||
TransferDestination resultData5 = (TransferDestination)AddressContext;
|
||||
TransferDestination resultData5 = (TransferDestination)AddressContext;
|
||||
if (resultData5.Address != null)
|
||||
_detailGridData.Add(resultData5.Address);
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Info($"DetailGridData: {_detailGridData.Count}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
<DxGridDataColumn FieldName="YearOfMake"/>
|
||||
<DxGridDataColumn FieldName="SeatNumber"/>
|
||||
<DxGridDataColumn FieldName="CarMotorType"/>
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@{
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@
|
|||
<DxGridDataColumn FieldName="YearOfMake"/>
|
||||
<DxGridDataColumn FieldName="SeatNumber"/>
|
||||
<DxGridDataColumn FieldName="CarMotorType"/>
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@{
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
<DxGridDataColumn FieldName="Id" GroupIndex="0" />
|
||||
<DxGridDataColumn FieldName="UserId" />
|
||||
<DxGridDataColumn FieldName="ServiceProviderId" Width="40%" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
@* <DxGridDataColumn FieldName="Permissions" /> *@
|
||||
</Columns>
|
||||
<EditFormTemplate Context="EditFormContext">
|
||||
|
|
|
|||
|
|
@ -42,7 +42,9 @@
|
|||
<div style="@_errorCss" @ref="_errorMessage"><p>User not found, type another email please</p></div>
|
||||
<DxGrid Data="@FoundUsers" RowClick="@OnRowClick">
|
||||
<Columns>
|
||||
<DxGridDataColumn FieldName="Id" Caption="ID" />
|
||||
<DxGridDataColumn FieldName="Id" Caption="ID" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
</DxGrid>
|
||||
</BodyContentTemplate>
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@
|
|||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="AffiliateId" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="CommissionPercent" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
@* <DxGridDataColumn FieldName="ContactEmail">
|
||||
|
||||
</DxGridDataColumn> *@
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@
|
|||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
AllowSelectRowByClick="false"
|
||||
PageSize="13"
|
||||
ShowFilterRow="true">
|
||||
|
||||
<Columns>
|
||||
|
|
@ -137,6 +138,7 @@
|
|||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
<DxTabs>
|
||||
|
|
|
|||
|
|
@ -71,28 +71,34 @@
|
|||
DataItemDeleting="Grid_DataItemDeleting"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
PageSize="15"
|
||||
TextWrapEnabled = "false"
|
||||
AllowSelectRowByClick = "true"
|
||||
HighlightRowOnHover = "true"
|
||||
AutoCollapseDetailRow = "true"
|
||||
AutoExpandAllGroupRows = "false"
|
||||
ShowFilterRow="true">
|
||||
|
||||
<Columns>
|
||||
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn Name="@Localizer.GetString("Id")" FieldName="Id" SortIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn Name="@Localizer.GetString("FullName")" FieldName="ProfileDto.FullName" />
|
||||
<DxGridDataColumn Name="@Localizer.GetString("PhoneNumber")" FieldName="UserDto.PhoneNumber" />
|
||||
<DxGridDataColumn Name="@Localizer.GetString("Created")" FieldName="UserDto.Created" />
|
||||
<DxGridDataColumn Name="@Localizer.GetString("EmailConfirmed")" FieldName="UserDto.EmailConfirmed" />
|
||||
<DxGridDataColumn FieldName="UserDto.RefferalId" />
|
||||
<DxGridDataColumn Width="240px" FieldName="UserDto.EmailAddress"/>
|
||||
<DxGridDataColumn Width="110px" FieldName="UserDto.EmailAddress">
|
||||
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left"/>
|
||||
<DxGridDataColumn Caption="@Localizer.GetString("Id")" FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N"/>
|
||||
<DxGridDataColumn Caption="@Localizer.GetString("FullName")" FieldName="ProfileDto.FullName"/>
|
||||
<DxGridDataColumn Caption="@Localizer.GetString("PhoneNumber")" FieldName="UserDto.PhoneNumber"/>
|
||||
<DxGridDataColumn Caption="@Localizer.GetString("RefferalId")" FieldName="UserDto.RefferalId" />
|
||||
<DxGridDataColumn Caption="@Localizer.GetString("EmailConfirmed")" FieldName="UserDto.EmailConfirmed" Width="120" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn Caption="@Localizer.GetString("EmailAddress")" Width="240" FieldName="UserDto.EmailAddress" SortIndex="0" />
|
||||
<DxGridDataColumn Caption="Send email" Width="110" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
var keyField = context.Value;
|
||||
var keyItem = (UserModelDtoDetail)context.DataItem;
|
||||
|
||||
var buttonText = "Contact";
|
||||
<DxButton Click="() => SendMail(keyItem)" IconCssClass="btn-icon-envelope" Text="@buttonText" RenderStyle="ButtonRenderStyle.Primary" />
|
||||
var buttonText = "Contact";
|
||||
<DxButton Click="() => SendMail(keyItem)" IconCssClass="btn-icon-envelope" Text="@buttonText" RenderStyle="ButtonRenderStyle.Primary"/>
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn Caption="@Localizer.GetString("Created")" FieldName="UserDto.Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn Caption="@Localizer.GetString("Modified")" FieldName="UserDto.Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
<DxTabs>
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@
|
|||
<text>@System.Text.RegularExpressions.Regex.Replace((displayTextContext.Value as string)!, "<(.|\n)*?>", string.Empty)</text>
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="IsReaded" Caption="Readed" Width="70" CaptionAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Created" Width="100" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" />
|
||||
<DxGridDataColumn FieldName="IsReaded" Caption="Readed" Width="70" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="100" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
@using TIAMWebApp.Shared.Application.Services
|
||||
@using AyCode.Interfaces.Addresses
|
||||
@using TIAM.Entities.Emails
|
||||
@using AyCode.Core
|
||||
@inject IServiceProviderDataService serviceProviderDataService
|
||||
@inject IUserDataService userDataService
|
||||
@inject ITransferDataService transferDataService
|
||||
|
|
@ -30,16 +31,17 @@
|
|||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
ShowFilterRow="false">
|
||||
<Columns>
|
||||
<DxGridCommandColumn NewButtonVisible="false" Width="8%" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" GroupIndex="0" />
|
||||
<DxGridCommandColumn Width="135" MinWidth="135" DeleteButtonVisible="AcDomain.IsDeveloperVersion" EditButtonVisible="AcDomain.IsDeveloperVersion" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="AddressText" />
|
||||
<DxGridDataColumn FieldName="IsValid" Width="40" />
|
||||
<DxGridDataColumn FieldName="IsHelper" Width="40" />
|
||||
<DxGridDataColumn FieldName="Latitude" Width="40" />
|
||||
<DxGridDataColumn FieldName="Longitude" Width="40" />
|
||||
<DxGridDataColumn FieldName="Created" Width="40" />
|
||||
<DxGridDataColumn FieldName="Modified" Width="40" />
|
||||
</Columns>
|
||||
<DxGridDataColumn FieldName="IsReaded" Caption="Readed" Width="70" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="100" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@{
|
||||
<text>@(((EmailMessage)context.DataItem).Text)</text>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.ProductType) FieldName="ProductType" Width="130" />
|
||||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.Price) FieldName="Price" Width="100" />
|
||||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.ProductDescription) FieldName="Description" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
<DxTabs>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@
|
|||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.ProductType) FieldName="ProductType" Width="130" />
|
||||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.Price) FieldName="Price" Width="100" />
|
||||
<DxGridDataColumn Caption=@Localizer.GetString(ResourceKeys.ProductDescription) FieldName="Description" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
<DxTabs>
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@
|
|||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="Name" />
|
||||
<DxGridDataColumn FieldName="FullName" />
|
||||
<DxGridDataColumn FieldName="Created" Width="40%" />
|
||||
<DxGridDataColumn FieldName="Modified" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
<DxTabs>
|
||||
|
|
|
|||
|
|
@ -22,15 +22,16 @@
|
|||
PageSize="5"
|
||||
ValidationEnabled="false"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
ShowFilterRow="true">
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn">
|
||||
<Columns>
|
||||
<DxGridCommandColumn Width="135" MinWidth="135" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" GroupIndex="0" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" />
|
||||
<DxGridDataColumn FieldName="OwnerId" />
|
||||
<DxGridDataColumn FieldName="Name" Width="40%" />
|
||||
<DxGridDataColumn FieldName="AffiliateId" />
|
||||
<DxGridDataColumn FieldName="CommissionPercent" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@
|
|||
<DxGridDataColumn FieldName="Price3" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="ProductCommis" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="ExtraPrice" MinWidth="80" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
<DxTabs>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@
|
|||
<DxGridDataColumn FieldName="Price2" />
|
||||
<DxGridDataColumn FieldName="Price3" />
|
||||
<DxGridDataColumn FieldName="ProductCommis" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@
|
|||
<DxGridDataColumn FieldName="Price2" />
|
||||
<DxGridDataColumn FieldName="Price3" />
|
||||
<DxGridDataColumn FieldName="ProductCommis" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
<DxTabs>
|
||||
|
|
|
|||
|
|
@ -38,34 +38,36 @@
|
|||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
@{
|
||||
var userEmailFieldName = $"{nameof(TransferToDriver.UserProductMapping)}.{nameof(UserProductMapping.User)}.{nameof(User.EmailAddress)}";
|
||||
var userEmailFieldName2 = $"{nameof(UserProductMapping.User)}.{nameof(User.EmailAddress)}";
|
||||
|
||||
var userEmailFieldNameComboItem = $"{nameof(UserProductMapping.User)}.{nameof(User.EmailAddress)}";
|
||||
var userNameFieldNameComboItem = $"{nameof(UserProductMapping.User)}.{nameof(User.FullName)}";
|
||||
}
|
||||
<DxGridDataColumn FieldName="@userEmailFieldName" Caption="Driver" SortIndex="0">
|
||||
<CellEditTemplate>
|
||||
@{
|
||||
var transferToDriverDataItem = (TransferToDriver)context.DataItem;
|
||||
var transferToDriverEditModel = (TransferToDriver)context.EditModel;
|
||||
}
|
||||
|
||||
<DxComboBox Data="@_drivers.Where(x => x.ProductId == (transferToDriverDataItem?.UserProductMapping.ProductId ?? TiamConstClient.TransferProductId))"
|
||||
<DxComboBox Data="@_drivers"
|
||||
TData="@UserProductMapping"
|
||||
TValue="@UserProductMapping"
|
||||
TextFieldName="@userEmailFieldName2"
|
||||
TextFieldName="@userEmailFieldNameComboItem"
|
||||
Value="@_drivers.FirstOrDefault(x => x.Id == transferToDriverEditModel.UserProductMappingId)"
|
||||
ValueChanged="v => transferToDriverEditModel.UserProductMappingId = v.Id"
|
||||
SearchFilterCondition="ListSearchFilterCondition.Contains"
|
||||
SearchMode="ListSearchMode.AutoSearch">
|
||||
<Columns>
|
||||
@* <DxListEditorColumn FieldName="Id"/> *@
|
||||
<DxListEditorColumn FieldName="@userEmailFieldName2" Caption="Driver email" />
|
||||
<DxListEditorColumn FieldName="@userEmailFieldNameComboItem" Caption="Driver email" />
|
||||
<DxListEditorColumn FieldName="@userNameFieldNameComboItem" Caption="Driver name" />
|
||||
</Columns>
|
||||
</DxComboBox>
|
||||
|
||||
</CellEditTemplate>
|
||||
</DxGridDataColumn>
|
||||
|
||||
<DxGridDataColumn FieldName="CarId" Caption="Car">
|
||||
<CellDisplayTemplate>
|
||||
|
||||
<DxGridDataColumn FieldName="CarId" Caption="Car">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
var transferToDriver = (TransferToDriver)context.DataItem;
|
||||
<text>@_cars.FirstOrDefault(x => x.Id == transferToDriver.CarId)?.LicencePlate</text>
|
||||
|
|
@ -86,7 +88,7 @@
|
|||
SearchMode="ListSearchMode.AutoSearch">
|
||||
<Columns>
|
||||
@* <DxListEditorColumn FieldName="Id"/> *@
|
||||
<DxListEditorColumn FieldName="LicencePlate" Caption="LicencePlate"/>
|
||||
<DxListEditorColumn FieldName="LicencePlate" Caption="LicencePlate" />
|
||||
<DxListEditorColumn FieldName="Manufacture" Caption="Manufacture" />
|
||||
<DxListEditorColumn FieldName="CarModel" Caption="Model" />
|
||||
<DxListEditorColumn FieldName="SeatNumber" Caption="SeatNumber" />
|
||||
|
|
@ -95,34 +97,36 @@
|
|||
</CellEditTemplate>
|
||||
</DxGridDataColumn>
|
||||
|
||||
@* <DxGridDataColumn FieldName="CarId">
|
||||
<CellEditTemplate>
|
||||
@{
|
||||
var transferToDriverId = ((TransferToDriver)context.DataItem).Id;
|
||||
}
|
||||
|
||||
<DxDropDownBox QueryDisplayText="QueryText"
|
||||
DropDownWidthMode="DropDownWidthMode.ContentWidth"
|
||||
ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
|
||||
NullText="Select a car...">
|
||||
<DropDownBodyTemplate>
|
||||
<CarDetailGridComponent GetAllTag="SignalRTags.GetAllCars"/>
|
||||
</DropDownBodyTemplate>
|
||||
</DxDropDownBox>
|
||||
</CellEditTemplate>
|
||||
</DxGridDataColumn>
|
||||
*@
|
||||
@* <DxGridDataColumn FieldName="CarId">
|
||||
<EditSettings>
|
||||
<DxComboBoxSettings Data="_cars" SearchMode="ListSearchMode.AutoSearch"
|
||||
ValueFieldName="Id"
|
||||
TextFieldName="LicencePlate" />
|
||||
</EditSettings>
|
||||
<CellEditTemplate>
|
||||
@{
|
||||
var transferToDriverId = ((TransferToDriver)context.DataItem).Id;
|
||||
}
|
||||
|
||||
<DxDropDownBox QueryDisplayText="QueryText"
|
||||
DropDownWidthMode="DropDownWidthMode.ContentWidth"
|
||||
ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
|
||||
NullText="Select a car...">
|
||||
<DropDownBodyTemplate>
|
||||
<CarDetailGridComponent GetAllTag="SignalRTags.GetAllCars"/>
|
||||
</DropDownBodyTemplate>
|
||||
</DxDropDownBox>
|
||||
</CellEditTemplate>
|
||||
</DxGridDataColumn>
|
||||
*@
|
||||
@* <DxGridDataColumn FieldName="CarId">
|
||||
<EditSettings>
|
||||
<DxComboBoxSettings Data="_cars" SearchMode="ListSearchMode.AutoSearch"
|
||||
ValueFieldName="Id"
|
||||
TextFieldName="LicencePlate" />
|
||||
</EditSettings>
|
||||
</DxGridDataColumn>*@
|
||||
|
||||
|
||||
|
||||
|
||||
<DxGridDataColumn FieldName="Price" />
|
||||
@* <DxGridDataColumn FieldName="LicencePlate" ReadOnly="true" /> *@
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
</TransferToDriversDetailGrid>
|
||||
|
||||
|
|
@ -143,7 +147,6 @@
|
|||
|
||||
_logger.Info($"DetailGridData: {ParentData.TransferToDrivers.Count}");
|
||||
|
||||
//EZ NEM JÓ, FILTER-ELNI KELL A PRODUCT-RA!!! - J.
|
||||
_cars.AddRange((await AdminSignalRClient.GetAllAsync<List<Car>>(SignalRTags.GetAllCarsByProductId, TiamConstClient.TransferProductId))!);
|
||||
// AdminSignalRClient.GetAllAsync<List<Car>>(SignalRTags.GetAllCars, response =>
|
||||
// {
|
||||
|
|
@ -151,14 +154,7 @@
|
|||
// return Task.CompletedTask;
|
||||
// }).Forget();
|
||||
|
||||
//EZ NEM JÓ, FILTER-ELNI KELL A PRODUCT-RA!!! - J.
|
||||
_drivers.AddRange(_cars.DistinctBy(x => x.UserProductMappingId).Select(x => x.UserProductMapping));
|
||||
//_drivers.AddRange((await AdminSignalRClient.GetAllAsync<List<UserProductMapping>>(SignalRTags.GetAllDrivers))!);
|
||||
// AdminSignalRClient.GetAllAsync<List<UserProductMapping>>(SignalRTags.GetAllDrivers, response =>
|
||||
// {
|
||||
// _drivers.AddRange(response.ResponseData!);
|
||||
// return Task.CompletedTask;
|
||||
// }).Forget();
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
|
@ -185,6 +181,8 @@
|
|||
|
||||
private void DataItemChanged(GridDataItemChangedEventArgs<TransferToDriver> args)
|
||||
{
|
||||
//ParentData?.TransferToDrivers?.UpdateCollection(args.DataItem, args.TrackingState == TrackingState.Remove);
|
||||
|
||||
OnTransferToDriverChanged.InvokeAsync(args.DataItem);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
CustomizeEditModel="CustomizeEditModel"
|
||||
EditMode="GridEditMode.EditForm"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode"
|
||||
ShowFilterRow="true">
|
||||
DetailExpandButtonDisplayMode="DetailExpandButtonDisplayMode">
|
||||
<Columns>
|
||||
<DxGridCommandColumn Width="135" MinWidth="135" DeleteButtonVisible="AcDomain.IsDeveloperVersion" EditButtonVisible="AcDomain.IsDeveloperVersion" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
|
|
@ -47,6 +46,8 @@
|
|||
@* <DxGridDataColumn FieldName="UserProductMapping.Product.Name" Caption="Service name" /> *@
|
||||
@* <DxGridDataColumn FieldName="@nameof(Product.ServiceProvider.Name)" Caption="Company name" /> *@
|
||||
<DxGridDataColumn FieldName="Permissions" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
<DxGridDataColumn FieldName="Modified" DisplayFormat="g" Width="140" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
</Columns>
|
||||
<DetailRowTemplate>
|
||||
@{
|
||||
|
|
|
|||
|
|
@ -162,6 +162,8 @@ namespace TIAMSharedUI.Shared.Components.Grids
|
|||
|
||||
if (e.IsNew) await AddDataItemAsync(dataItem);
|
||||
else await UpdateDataItemAsync(dataItem);
|
||||
|
||||
_dataSource.UpdateCollection(dataItem, false);
|
||||
}
|
||||
|
||||
private Task SaveChangesToServerAsync()
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@
|
|||
|
||||
@inherits ErrorBoundary
|
||||
|
||||
@* <DxPopup @ref="ErrorPopup" HeaderText="Popup"/> *@
|
||||
|
||||
@code {
|
||||
bool PopupVisible { get; set; } = false;
|
||||
}
|
||||
|
||||
@if (_currentError != null)
|
||||
{
|
||||
|
|
@ -23,6 +28,7 @@ else
|
|||
}
|
||||
|
||||
@code {
|
||||
//public DxPopup ErrorPopup;
|
||||
private Exception? _currentError;
|
||||
private LoggerClient _logger;
|
||||
|
||||
|
|
|
|||
|
|
@ -588,7 +588,7 @@ namespace TIAMWebApp.Server.Controllers
|
|||
[SignalR(SignalRTags.GetAllDrivers)]
|
||||
public async Task<List<UserProductMapping>> GetAllDrivers()
|
||||
{
|
||||
var result = await _adminDal.GetTAllDrivers();
|
||||
var result = await _adminDal.GetAllDriversAsync();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -598,7 +598,7 @@ namespace TIAMWebApp.Server.Controllers
|
|||
[SignalR(SignalRTags.GetAllDriversByProductId)]
|
||||
public async Task<List<UserProductMapping>> GetAllDriversByProductId(Guid productId)
|
||||
{
|
||||
var result = await _adminDal.GetTAllDriversByProductId(productId);
|
||||
var result = await _adminDal.GetAllDriversByProductIdAsync(productId);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -629,6 +629,8 @@ namespace TIAMWebApp.Server.Controllers
|
|||
public async Task<TransferToDriver?> AddTransferDriver([FromBody] TransferToDriver transferToDriver)
|
||||
{
|
||||
var result = await _adminDal.AddTransferToDriverAsync(transferToDriver);
|
||||
//TODO: Send email to driver... - J.
|
||||
|
||||
return result ? transferToDriver : null;
|
||||
}
|
||||
|
||||
|
|
@ -639,6 +641,8 @@ namespace TIAMWebApp.Server.Controllers
|
|||
public async Task<TransferToDriver?> UpdateTransferDriver([FromBody] TransferToDriver transferToDriver)
|
||||
{
|
||||
var result = await _adminDal.UpdateTransferToDriverAsync(transferToDriver);
|
||||
//TODO: Send email to driver/user, ha van változás... - J.
|
||||
|
||||
return result; // ? transferToDriver : null;
|
||||
}
|
||||
|
||||
|
|
@ -649,6 +653,8 @@ namespace TIAMWebApp.Server.Controllers
|
|||
public async Task<TransferToDriver?> RemoveTransferDriver([FromBody] TransferToDriver transferToDriver)
|
||||
{
|
||||
var result = await _adminDal.RemoveTransferToDriverAsync(transferToDriver);
|
||||
//TODO: Send email to driver/user... - J.
|
||||
|
||||
return result ? transferToDriver : null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue