Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        //
        // 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);
        }
Exemplo n.º 4
0
        public ActionResult Create(int eventid)
        {
            Track model = new Track() { EventID = eventid };

            return View(model);
        }