public ActionResult DeleteConfirmed(int id) { ElectionStartEnd electionStartEnd = db.ElectionStartEnds.Find(id); db.ElectionStartEnds.Remove(electionStartEnd); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "ID,StartDate,EndDate")] ElectionStartEnd electionStartEnd) { if (ModelState.IsValid) { db.ElectionStartEnds.Add(electionStartEnd); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(electionStartEnd)); }
// GET: ElectionTime/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ElectionStartEnd electionStartEnd = db.ElectionStartEnds.Find(id); if (electionStartEnd == null) { return(HttpNotFound()); } return(View(electionStartEnd)); }