public void UpdateShopLot(ShopLot shopLot) { if (!MyDb.UpdateData(shopLot.Save(), shopLot.Name, "ShopLot")) { throw new ArgumentException("Goods is already exists"); } }
public void RemoveShopLot(ShopLot lot) { if (!MyDb.RemoveData(lot.Name, "ShopLot")) { throw new ArgumentException("Goods is not exists"); } }
public ShopLot GetShopLot(string name) { var buffer = MyDb.GetData(name, "ShopLot"); ShopLot result = new ShopLot("null", "null", "null", 1); result.Load(buffer); return(result); }
public void AddShopLot(ShopLot lot) { if (GetShopLot(lot.Name) != null) { var temp = lot.Save(); if (temp.Length > DataForWrappers.MaxSizeOfShopLot) { throw new ArgumentException("Image too large"); } bool result = MyDb.AddData(temp, lot.Name, "ShopLot"); if (!result) { throw new ArgumentException("Goods is already exists"); } } else { throw new ArgumentNullException(lot.Name); } }