public bool UpdateBagLocation(int BagLocationId, int BagInventoryId, string LocationName, int StorageTypeId, int StorageId, int BagQuantity) { bool isSaved = true; try { using (WTCCeresEntities dbContext = new WTCCeresEntities()) { blt = dbContext.BagLocation.Find(BagLocationId); blt.BagInventoryId = BagInventoryId; blt.StorageId = StorageId; blt.LocationName = LocationName; blt.StorageTypeId = StorageTypeId; blt.BagQuantity = BagQuantity; dbContext.BagLocation.AddOrUpdate(blt); dbContext.SaveChanges(); } } catch (Exception ex) { isSaved = false; } return(isSaved); }
public bool DeleteBagLocation(int BagLocationId) { bool isSaved = true; try { using (WTCCeresEntities db = new WTCCeresEntities()) { blt = db.BagLocation.Find(BagLocationId); db.BagLocation.Remove(blt); db.SaveChanges(); } } catch (Exception ex) { isSaved = false; } return(isSaved); }
public void SetPreviousBag(BagLocation bagLocation) { this.previousLocation = bagLocation; }
public void RemoveBag(BagLocation bagLocation) { currentBagNumber -= 1; }