public static void PurgeAutomaticallyEnteredInventory(int itemID, int storeID, int year) { YearEnd yearEnd = new YearEnd(); yearEnd.Where.ItemID.Value = itemID; yearEnd.Where.StoreID.Value = storeID; yearEnd.Where.Year.Value = year; yearEnd.Where.AutomaticallyEntered.Value = true; yearEnd.Query.Load(); yearEnd.DeleteAll(); yearEnd.Save(); }
public static void PurgeAutomaticallyEnteredInventoryForUnit(int itemID, int storeID, int year, int unitID) { YearEnd yearEnd = new YearEnd(); yearEnd.Where.ItemID.Value = itemID; yearEnd.Where.StoreID.Value = storeID; yearEnd.Where.Year.Value = year; yearEnd.Where.AutomaticallyEntered.Value = true; yearEnd.Where.UnitID.Value = unitID; yearEnd.Query.Load(); DataTable dt = yearEnd.DefaultView.ToTable(); PurgeAutomaticallyEnteredInventoryDetail(dt); yearEnd.DeleteAll(); yearEnd.Save(); }