public void SoldProduct(SoldModel sold) { var product = db.Products.Find(sold.ProductID); if (product != null) { product.SoldPrice = sold.soldPrice; product.SoldDate = sold.soldeDate; product.IsSold = true; product.UpdatedBy = User.Identity.Name; product.UpdatedDate = DateTime.Now; db.Entry(product).State = EntityState.Modified; db.SaveChanges(); } }
public ActionResult SoldProductGet(int id) { SoldModel sd = new SoldModel() { ProductID = id }; return PartialView("SoldProduct",sd); }