public ActionResult DeleteConfirmed(int id) { PFTApp.Models.Attribute attribute = db.Attributes.Find(id); db.Attributes.Remove(attribute); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Attribute/Delete/5 public ActionResult Delete(int id = 0) { PFTApp.Models.Attribute attribute = db.Attributes.Find(id); if (attribute == null) { return(HttpNotFound()); } return(View(attribute)); }
public ActionResult Edit(PFTApp.Models.Attribute attribute) { if (ModelState.IsValid) { db.Entry(attribute).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(attribute)); }
public ActionResult Create(PFTApp.Models.Attribute attribute) { if (ModelState.IsValid) { db.Attributes.Add(attribute); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(attribute)); }