public ActionResult Create(Track track) { try { _cdModel.AddTrackToCd(track.CDId, track); return RedirectToAction("Index", new {track.CDId}); } catch { return View(); } }
public ActionResult Delete(int id, Track track) { try { _cdModel.Delete(track); return RedirectToAction("Index", new {id = track.CDId}); } catch { return View(); } }
public ActionResult Edit(int id, Track track) { try { _cdModel.Save(track); return RedirectToAction("Index", new {id = track.CDId}); } catch (Exception) { return View(); } }
// GET: Track/Create public ActionResult Create(int? id) { var cd = _cdModel.GetCdDetails(id); var track = new Track {CDId = id, CD = cd}; return View(track); }