public ActionResult Delete(int id) { try { service.DeleteTimeslot(id); return RedirectToAction("Index"); } catch // (Exception e) { ViewBag.ErrorMessage = "This Timeslot can not be deleted"; var timeslot = service.GetTimeslot(id); Timeslot model = new Timeslot() { ID = timeslot.ID, EventID = timeslot.EventID, Name = timeslot.Name, StartTime = timeslot.StartTime, EndTime = timeslot.EndTime }; return View("Details", model); } }
public ActionResult Create(Timeslot timeslot) { try { service.CreateTimeslot(new CC.Service.Webhost.Services.Timeslot() { EventID = timeslot.EventID, Name = timeslot.Name, StartTime = timeslot.StartTime, EndTime = timeslot.EndTime }); return RedirectToAction("Index"); } catch { return View(timeslot); } }
// // GET: /Timeslot/Details/5 public ActionResult Details(int id) { var timeslot = service.GetTimeslot(id); Timeslot model = new Timeslot() { ID = timeslot.ID, EventID = timeslot.EventID, Name = timeslot.Name, StartTime = timeslot.StartTime, EndTime = timeslot.EndTime }; return View(model); }
public ActionResult Create(int eventid) { Timeslot model = new Timeslot() { EventID = eventid }; return View(model); }