Da testare ma completato porting OrderRows
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using EgwCoreLib.Lux.Data.DbModel.Sales;
|
||||
using EgwCoreLib.Lux.Data.DbModel.Items;
|
||||
using EgwCoreLib.Lux.Data.DbModel.Sales;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using static EgwCoreLib.Lux.Core.Enums;
|
||||
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
{
|
||||
@@ -22,7 +24,6 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
|
||||
public async Task<bool> DeleteAsync(OfferRowModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -30,13 +31,12 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
|
||||
public async Task<OfferRowModel?> GetByUidAsync(string offerRowUid)
|
||||
public async Task<List<ItemModel>> GetBomItemsAsync()
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetOfferRow
|
||||
.Include(r => r.SellingItemNav)
|
||||
.FirstOrDefaultAsync(x => x.OfferRowUID == offerRowUid);
|
||||
return await dbCtx.DbSetItem
|
||||
.Where(x => x.ItemType == ItemClassType.Bom || x.ItemType == ItemClassType.BomAlt)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<OfferRowModel?> GetByIdAsync(int offerRowId)
|
||||
@@ -47,7 +47,6 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
.FirstOrDefaultAsync(x => x.OfferRowID == offerRowId);
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<OfferRowModel>> GetByParentAsync(int offerId)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -57,6 +56,20 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<OfferRowModel?> GetByUidAsync(string offerRowUid)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetOfferRow
|
||||
.Include(r => r.SellingItemNav)
|
||||
.FirstOrDefaultAsync(x => x.OfferRowUID == offerRowUid);
|
||||
}
|
||||
|
||||
public async Task<List<ItemGroupModel>> GetItemGroupsAsync()
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetItemGroup.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> SaveRowsAsync(List<OfferRowModel> rows)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -86,4 +99,4 @@ namespace EgwCoreLib.Lux.Data.Repository.Sales
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user