public void ShopUpdate(int id, string name, string Address, string ShopType) { try { Shop Shop = new Shop(); Shop = db.Shop.FirstOrDefault(x => x.Id == id); Shop.Name = name; Shop.Address = Address; var shoptype = GetShopType(ShopType); Shop.ShopTypeId = shoptype.Id; db.Update(Shop); db.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void ProductUpdate(int id, string name, string company, string image_url) //პროდუქტის ძირითადი ინფორმაციის ცვლილება { try { Products product = new Products(); product = db.Products.FirstOrDefault(x => x.Id == id); product.Name = name; product.Company = company; if (image_url != null) { product.ImageUrl = image_url; } db.Update(product); db.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } }