public ActionResult EditProduct(int ID, string name, int?price, int?categoryID, int?salary) { bool res; using (DBAgent.DBAgent agent = new DBAgent.DBAgent()) { res = agent.EditProduct(ID, name, price, categoryID, salary); } if (res) { return(Redirect("/Home/Index")); } else { return(View("~/Views/Shared/Error.cshtml")); } }