public ActionResult Delete(int id, FormCollection collection) { evente e = serviceEv.GetById(id); serviceEv.Delete(e); serviceEv.Commit(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id, evente eventt) { evente e = serviceEv.GetById(id); e.avaibility = eventt.avaibility; e.dateEvent = eventt.dateEvent; e.localisation = eventt.localisation; e.MyCategory_id = eventt.MyCategory_id; serviceEv.Update(e); serviceEv.Commit(); return(RedirectToAction("Index")); }
// GET: Event/Edit/5 public ActionResult Edit(int id) { EventViewModel evm = new EventViewModel(); List <category> lc = new List <category>(); lc = catsev.GetMany().ToList(); evente e = serviceEv.GetById(id); evm.idEvent = e.idEvent; evm.localisation = e.localisation; evm.category = e.category; evm.avaibility = e.avaibility; e.MyCategory_id = e.MyCategory_id; evm.categories = lc.ToSelectListItems(); return(View(evm)); }
// GET: Event/Delete/5 public ActionResult Delete(int id) { evente e = serviceEv.GetById(id); return(View(e)); }