public void Update(OrderDetails orderDetails) { var orderDetailsFromDb = _db.OrderDetails.FirstOrDefault(m => m.Id == orderDetails.Id); _db.OrderDetails.Update(orderDetailsFromDb); _db.SaveChanges(); }
public void Update(ProductType productType) { var productTypeObj = db.ProductType.FirstOrDefault(s => s.Id == productType.Id); productTypeObj.Name = productType.Name; db.SaveChanges(); }
public void Update(OrderHeader orderHeader) { var orderHeaderDb = _db.OrderHeaders.FirstOrDefault(m => m.Id == orderHeader.Id); _db.OrderHeaders.Update(orderHeaderDb); _db.SaveChanges(); }
public void Update(Category category) { var categoryObj = db.Category.FirstOrDefault(s => s.Id == category.Id); categoryObj.Name = category.Name; categoryObj.DisplayOrder = category.DisplayOrder; db.SaveChanges(); }
public void Update(Catalog catalog) { var catalogObj = db.Catalog.FirstOrDefault(m => m.Id == catalog.Id); catalogObj.Name = catalog.Name; catalogObj.CategoryId = catalog.CategoryId; catalogObj.Specifications = catalog.Specifications; catalogObj.ProductTypeId = catalog.ProductTypeId; catalogObj.Price = catalog.Price; if (catalog.Image != null) { catalogObj.Image = catalog.Image; } db.SaveChanges(); }
public void Save() { _db.SaveChanges(); }