public ActionResult DeleteConfirmed(int id) { FactorRh factorRh = db.FactorRhs.Find(id); db.FactorRhs.Remove(factorRh); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(FactorRh factorRh) { if (ModelState.IsValid) { db.FactorRhs.Add(factorRh); var response = DBHelper.SaveChanges(db); if (response.Succeeded) { return(RedirectToAction("Index")); } ModelState. AddModelError( string.Empty, response.Message); } return(View(factorRh)); }
public ActionResult Edit(FactorRh factorRh) { if (ModelState.IsValid) { db.Entry(factorRh).State = EntityState.Modified; var response = DBHelper.SaveChanges(db); if (response.Succeeded) { return(RedirectToAction("Index")); } ModelState. AddModelError( string.Empty, response.Message); } return(View(factorRh)); }