Ejemplo n.º 1
0
        public ActionResult Create(Track track)
        {
            try
            {
                _cdModel.AddTrackToCd(track.CDId, track);

                return RedirectToAction("Index", new {track.CDId});
            }
            catch
            {
                return View();
            }
        }
Ejemplo n.º 2
0
        public ActionResult Delete(int id, Track track)
        {
            try
            {
                _cdModel.Delete(track);

                return RedirectToAction("Index", new {id = track.CDId});
            }
            catch
            {
                return View();
            }
        }
Ejemplo n.º 3
0
        public ActionResult Edit(int id, Track track)
        {
            try
            {
                _cdModel.Save(track);

                return RedirectToAction("Index", new {id = track.CDId});
            }
            catch (Exception)
            {
                return View();
            }
        }
Ejemplo n.º 4
0
 // GET: Track/Create
 public ActionResult Create(int? id)
 {
     var cd = _cdModel.GetCdDetails(id);
     var track = new Track {CDId = id, CD = cd};
     return View(track);
 }