public ActionResult DeleteConfirmed(int id) { CenterAchievement centerAchievement = db.CenterAchievements.Find(id); db.CenterAchievements.Remove(centerAchievement); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "CenterAchievementId,Label,Text,Code")] CenterAchievement centerAchievement) { if (ModelState.IsValid) { centerAchievement.Code = 2; db.Entry(centerAchievement).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(centerAchievement)); }
public ActionResult Create([Bind(Include = "CenterAchievementId,Label,Text,Code")] CenterAchievement centerAchievement) { if (ModelState.IsValid) { centerAchievement.Code = 2; db.CenterAchievements.Add(centerAchievement); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(centerAchievement)); }
// GET: UniDecision/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CenterAchievement centerAchievement = db.CenterAchievements.Find(id); if (centerAchievement == null) { return(HttpNotFound()); } return(View(centerAchievement)); }