public ActionResult Delete(int id) { try { service.DeleteTrack(id); return RedirectToAction("Index"); } catch // (Exception e) { ViewBag.ErrorMessage = "This track can not be deleted"; var track = service.GetTrack(id); Track model = new Track() { ID = track.ID, EventID = track.EventID, Name = track.Name, Description = track.Description }; return View("Details", model); } }
public ActionResult Create(Track track) { try { service.CreateTrack(new CC.Service.Webhost.Services.Track() { EventID = track.EventID, Name = track.Name, Description = track.Description }); return RedirectToAction("Index"); } catch { return View(track); } }
// // GET: /Track/Details/5 public ActionResult Details(int id) { var track = service.GetTrack(id); Track model = new Track() { ID = track.ID, EventID = track.EventID, Name = track.Name, Description = track.Description }; return View(model); }
public ActionResult Create(int eventid) { Track model = new Track() { EventID = eventid }; return View(model); }