示例#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);
            }
        }
示例#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);
            }
        }
示例#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);
        }
示例#4
0
        public ActionResult Create(int eventid)
        {
            Track model = new Track() { EventID = eventid };

            return View(model);
        }