/// <summary> /// Implemented method. /// </summary> public void DeleteElement() { int id = FinderID.FindID(Shop.products.Select(t => t.ID).ToList()); Product product = Shop.products.Where(t => t.ID == id).First(); Shop.DeleteElement(Shop.products, product); UpdateData?.Invoke(this); }
/// <summary> /// Implemented method. /// </summary> public void DeleteElement() { int id = FinderID.FindID(Shop.wareHouses.Select(t => t.ID).ToList()); if (Shop.products.Where(t => t.WareHouseID == id).Count() == 0) { WareHouse wareHouse = Shop.wareHouses.Where(t => t.ID == id).First(); Shop.DeleteElement(Shop.wareHouses, wareHouse); UpdateData?.Invoke(this); } else { Console.WriteLine("Sorry, this id using in products, before delete product!"); } }
/// <summary> /// Implemented method. /// </summary> public void DeleteElement() { int id = FinderID.FindID(Shop.manufacturers.Select(t => t.ID).ToList()); if (Shop.products.Where(t => t.ManufacturerID == id).Count() == 0) { Manufacturer manufacturer = Shop.manufacturers.Where(t => t.ID == id).First(); Shop.DeleteElement(Shop.manufacturers, manufacturer); UpdateData?.Invoke(this); } else { Console.WriteLine("Sorry, this id using in products, before delete product!"); } }