Extra utility-page created , putting all stockgroups in place

This commit is contained in:
2022-10-12 21:05:33 +02:00
parent 6e2eb207a3
commit 0cb51d70cb
8 changed files with 63 additions and 7 deletions

View File

@ -176,6 +176,25 @@ namespace StockDAL
return result;
}
public bool EmptyStockGroups()
{
using var context = new StockContext();
try
{
var groupRows = from g in context.StockGroups
select g;
foreach (var row in groupRows)
{
context.StockGroups.Remove(row);
}
context.SaveChanges();
return true;
}
catch (Exception ex)
{
return false;
}
}
public StockGroupModel SaveStockGroup(StockGroupModel stockGroup)
{