public ActionResult DeleteConfirmed(int id) { Wellfare wellfare = db.Wellfares.Find(id); db.Wellfares.Remove(wellfare); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "WellfareId,Name,detail")] Wellfare wellfare) { if (ModelState.IsValid) { db.Entry(wellfare).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(wellfare)); }
public ActionResult Create([Bind(Include = "WellfareId,Name,detail")] Wellfare wellfare) { if (ModelState.IsValid) { db.Wellfares.Add(wellfare); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(wellfare)); }
// GET: Wellfares/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Wellfare wellfare = db.Wellfares.Find(id); if (wellfare == null) { return(HttpNotFound()); } return(View(wellfare)); }