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