public ActionResult DeleteProductMaterial(int materialID, int productID) { bool res; using (DBAgent.DBAgent agent = new DBAgent.DBAgent()) { res = agent.DeleteProductMaterial(materialID, productID); } if (res) { return(Redirect("/Home/ProductMaterials")); } else { return(View("~/Views/Shared/Error.cshtml")); } }