예제 #1
0
        public ActionResult Delete(int id)
        {
            try
            {
                service.DeleteTimeslot(id);

                return RedirectToAction("Index");
            }
            catch // (Exception e)
            {
                ViewBag.ErrorMessage = "This Timeslot can not be deleted";

                var timeslot = service.GetTimeslot(id);

                Timeslot model = new Timeslot()
                {
                    ID = timeslot.ID,
                    EventID = timeslot.EventID,
                    Name = timeslot.Name,
                    StartTime = timeslot.StartTime,
                    EndTime = timeslot.EndTime
                };

                return View("Details", model);
            }
        }
예제 #2
0
        public ActionResult Create(Timeslot timeslot)
        {
            try
            {
                service.CreateTimeslot(new CC.Service.Webhost.Services.Timeslot()
                {
                    EventID = timeslot.EventID,
                    Name = timeslot.Name,
                    StartTime = timeslot.StartTime,
                    EndTime = timeslot.EndTime
                });

                return RedirectToAction("Index");
            }
            catch
            {
                return View(timeslot);
            }
        }
예제 #3
0
        //
        // GET: /Timeslot/Details/5
        public ActionResult Details(int id)
        {
            var timeslot = service.GetTimeslot(id);

            Timeslot model = new Timeslot()
            {
                ID = timeslot.ID,
                EventID = timeslot.EventID,
                Name = timeslot.Name,
                StartTime = timeslot.StartTime,
                EndTime = timeslot.EndTime
            };

            return View(model);
        }
예제 #4
0
        public ActionResult Create(int eventid)
        {
            Timeslot model = new Timeslot() { EventID = eventid };

            return View(model);
        }