Spostamento servizi warehouse + inserimento prime funzioni calcolo fabbisogni
This commit is contained in:
@@ -22,6 +22,13 @@
|
||||
/// <param name="entity">Record da eliminare</param>
|
||||
Task<bool> DeleteAsync(MatReqModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Elimina un set di record MatReq dato OrderRowId.
|
||||
/// </summary>
|
||||
/// <param name="orderRowId">ID dell'OrderRow relativo</param>
|
||||
/// <param name="force">forza cancellazione anche per già ordinati</param>
|
||||
Task<bool> DeleteByOrderRowAsync(int orderRowId, bool force = false);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera un record MatReq specifico per ID.
|
||||
/// </summary>
|
||||
|
||||
@@ -30,6 +30,19 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> DeleteByOrderRowAsync(int orderRowId, bool force = false)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
// registro eliminazione diretta dei record eliminabilii...
|
||||
var list2del = await dbCtx
|
||||
.DbSetMaterialReq
|
||||
.Where(x => x.OrderRowID == orderRowId && (!x.Processed || force))
|
||||
.ExecuteDeleteAsync();
|
||||
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<MatReqModel?> GetByIdAsync(int recId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user