// // GET: /Conference/Edit/5 public ActionResult Edit(int id) { conference_event ConferenceModel = new conference_event(); using (ModelsCMS db = new ModelsCMS()) { ConferenceModel = db.conference_events.Where(x => x.conferenceID == id).FirstOrDefault(); } return(View(ConferenceModel)); }
public ActionResult Create(conference_event conferenceModel) { using (ModelsCMS db = new ModelsCMS()) { db.conference_events.Add(conferenceModel); db.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Edit(conference_event ConferenceModel) { using (ModelsCMS db = new ModelsCMS()) { db.Entry(ConferenceModel).State = System.Data.EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Delete(int id, FormCollection collection) { using (ModelsCMS db = new ModelsCMS()) { conference_event confModel = db.conference_events.Where(x => x.conferenceID == id).FirstOrDefault(); db.conference_events.Remove(confModel); db.SaveChanges(); } return(RedirectToAction("Index")); }