bleh
This commit is contained in:
parent
30192cad65
commit
cad2c39389
|
|
@ -95,6 +95,10 @@ namespace TIAM.Database.DataLayers.Admins
|
||||||
public string? GetTransferDestinationToProductJsonById(Guid transferDestinationToProductId) => Session(ctx => ctx.GetTransferDestinationToProductById(transferDestinationToProductId)?.ToJson());
|
public string? GetTransferDestinationToProductJsonById(Guid transferDestinationToProductId) => Session(ctx => ctx.GetTransferDestinationToProductById(transferDestinationToProductId)?.ToJson());
|
||||||
|
|
||||||
public TransferDestinationToProduct? GetTransferDestinationToProduct(Guid productId, Guid transferDestinationId) => Session(ctx=>ctx.GetTransferDestinationToProduct(productId, transferDestinationId));
|
public TransferDestinationToProduct? GetTransferDestinationToProduct(Guid productId, Guid transferDestinationId) => Session(ctx=>ctx.GetTransferDestinationToProduct(productId, transferDestinationId));
|
||||||
|
|
||||||
|
public List<TransferDestinationToProduct>? GetTransferDestinationToProductsByProductId(Guid productId) => Session(ctx => ctx.GetTransferDestinationToProductsByProductId(productId));
|
||||||
|
public List<TransferDestinationToProduct>? GetTransferDestinationToProductsByTransferDestinationId(Guid transferDestinationId) => Session(ctx => ctx.GetTransferDestinationToProductsByTransferDestinationId(transferDestinationId));
|
||||||
|
|
||||||
public string? GetTransferDestinationToProductJson(Guid productId, Guid transferDestinationId) => Session(ctx => ctx.GetTransferDestinationToProduct(productId, transferDestinationId)?.ToJson());
|
public string? GetTransferDestinationToProductJson(Guid productId, Guid transferDestinationId) => Session(ctx => ctx.GetTransferDestinationToProduct(productId, transferDestinationId)?.ToJson());
|
||||||
|
|
||||||
public Task<bool> AddTransferDestinationToProductAsync(TransferDestinationToProduct transferDestinationToProduct) => TransactionAsync(ctx => ctx.AddTransferDestinationToProduct(transferDestinationToProduct));
|
public Task<bool> AddTransferDestinationToProductAsync(TransferDestinationToProduct transferDestinationToProduct) => TransactionAsync(ctx => ctx.AddTransferDestinationToProduct(transferDestinationToProduct));
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,12 @@ public static class TransferDbSetExtensions
|
||||||
public static TransferDestinationToProduct? GetTransferDestinationToProduct(this ITransferDestinationToProductDbSet ctx, Guid productId, Guid transferDestinationId)
|
public static TransferDestinationToProduct? GetTransferDestinationToProduct(this ITransferDestinationToProductDbSet ctx, Guid productId, Guid transferDestinationId)
|
||||||
=> ctx.TransferDestinationToProducts.FirstOrDefault(x => x.ProductId == productId && x.TransferDestinationId == transferDestinationId);
|
=> ctx.TransferDestinationToProducts.FirstOrDefault(x => x.ProductId == productId && x.TransferDestinationId == transferDestinationId);
|
||||||
|
|
||||||
|
public static List<TransferDestinationToProduct>? GetTransferDestinationToProductsByProductId(this ITransferDestinationToProductDbSet ctx, Guid productId)
|
||||||
|
=> ctx.TransferDestinationToProducts.Where(x => x.ProductId == productId).ToList();
|
||||||
|
|
||||||
|
public static List<TransferDestinationToProduct>? GetTransferDestinationToProductsByTransferDestinationId(this ITransferDestinationToProductDbSet ctx, Guid transferDestinationId)
|
||||||
|
=> ctx.TransferDestinationToProducts.Where(x => x.TransferDestinationId == transferDestinationId).ToList();
|
||||||
|
|
||||||
public static bool AddTransferDestinationToProduct(this ITransferDestinationToProductDbSet ctx, TransferDestinationToProduct transferDestinationToProduct)
|
public static bool AddTransferDestinationToProduct(this ITransferDestinationToProductDbSet ctx, TransferDestinationToProduct transferDestinationToProduct)
|
||||||
=> ctx.TransferDestinationToProducts.Add(transferDestinationToProduct).State == EntityState.Added;
|
=> ctx.TransferDestinationToProducts.Add(transferDestinationToProduct).State == EntityState.Added;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,25 @@ namespace TIAMWebApp.Server.Controllers
|
||||||
return result ? transferDestination : null;
|
return result ? transferDestination : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
|
[HttpPost]
|
||||||
|
[Route(APIUrls.GetTransferDestinationToProductByProductIdRouteName)]
|
||||||
|
[SignalR(SignalRTags.GetTransferDestinationToProductByProductId)]
|
||||||
|
public List<TransferDestinationToProduct> GetTransferDestinationToProductByProductId(Guid productId)
|
||||||
|
{
|
||||||
|
if
|
||||||
|
return _adminDal.GetTransferDestinationToProductsByProductId(productId);
|
||||||
|
}
|
||||||
|
|
||||||
|
[AllowAnonymous]
|
||||||
|
[HttpPost]
|
||||||
|
[Route(APIUrls.GetTransferDestinationToProductByTransferDestinationId)]
|
||||||
|
[SignalR(SignalRTags.GetTransferDestinationToProductByTransferDestinationId)]
|
||||||
|
public List<TransferDestinationToProduct> GetTransferDestinationToProductByTransferDestinationId(Guid transferDestinationId)
|
||||||
|
{
|
||||||
|
return _adminDal.GetTransferDestinationToProductsByTransferDestinationId(transferDestinationId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//[AllowAnonymous]
|
//[AllowAnonymous]
|
||||||
//[HttpPost]
|
//[HttpPost]
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,12 @@ namespace TIAMWebApp.Shared.Application.Models
|
||||||
public const string CreateTransferDestinationRouteName = "CreateTransferDestination";
|
public const string CreateTransferDestinationRouteName = "CreateTransferDestination";
|
||||||
public const string CreateTransferDestination = TransferDataAPI + CreateTransferDestinationRouteName;
|
public const string CreateTransferDestination = TransferDataAPI + CreateTransferDestinationRouteName;
|
||||||
|
|
||||||
|
public const string GetTransferDestinationToProductByProductIdRouteName = "GetTransferDestinationToProductByProductId";
|
||||||
|
public const string GetTransferDestinationToProductByProductId = TransferDataAPI + GetTransferDestinationToProductByProductIdRouteName;
|
||||||
|
|
||||||
|
public const string GetTransferDestinationToProductByTransferDestinationIdRouteName = "GetTransferDestinationToProductByTransferDestinationId";
|
||||||
|
public const string GetTransferDestinationToProductByTransferDestinationId = TransferDataAPI + GetTransferDestinationToProductByTransferDestinationIdRouteName;
|
||||||
|
|
||||||
public const string GetTransfersRouteName = "GetTransfers";
|
public const string GetTransfersRouteName = "GetTransfers";
|
||||||
public const string GetTransfers = TransferDataAPI + GetTransfersRouteName;
|
public const string GetTransfers = TransferDataAPI + GetTransfersRouteName;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue