コード例 #1
0
        //GET DETAIL DOUBLE CHECK THIS
        public ActionResult Details(int id)
        {
            var service = new ScheduleAdminService(id);
            var model   = service.GetScheduleAdminById(id);

            return(View(model));
        }
コード例 #2
0
        public ActionResult DeletePost(int id, int ShopID) //added in ShopDetail Model
        {
            var service = new ScheduleAdminService(id);

            service.DeleteScheduleAdmin(id); //added in ShopDetail Model

            TempData["SaveResult"] = "Your Admin Event was deleted";

            return(RedirectToAction("Index", "ScheduleAdmin", new { ShopID = ShopID })); //figure this out send to shop schedule!!!!!!!
        }
コード例 #3
0
        // GET: ScheduleAdmin
        public ActionResult Index(int ShopID)
        {
            ViewBag.ShopID = ShopID;
            var service = new ScheduleAdminService(ShopID);
            var model   = service.GetScheduleAdmin();

            var service2 = new ScheduleUserService(Guid.Parse(User.Identity.GetUserId()));

            ViewBag.ScheduleUser = service2.GetAllScheduleUser(ShopID);



            return(View(model));
        }
コード例 #4
0
        public ActionResult Edit(int id)
        {
            var service = new ScheduleAdminService(id);
            var detail  = service.GetScheduleAdminById(id);
            var model   =
                new ScheduleAdminEdit
            {
                EventID     = detail.EventID,
                ShopID      = detail.ShopID,
                EventName   = detail.EventName,
                StartTime   = detail.StartTime,
                EndTime     = detail.EndTime,
                ModifiedUtc = detail.ModifiedUtc
            };

            return(View(model));
        }
コード例 #5
0
        public ActionResult Create(ScheduleAdminCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = new ScheduleAdminService(model.ShopID);

            var result = service.CreateScheduleAdmin(model);

            if (result != 0)
            {
                TempData["SaveResult"] = "Your Admin Event was created.";
                return(RedirectToAction("Details", "ScheduleAdmin", new { id = result })); //figure this out send to shop schedule!!!!!!!
            }
            ;
            ModelState.AddModelError("", "Admin Event could not be created.");

            return(View(model));
        }
コード例 #6
0
        public ActionResult Edit(int id, ScheduleAdminEdit model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (model.EventID != id)
            {
                ModelState.AddModelError("", "Id Mismatch");
                return(View(model));
            }

            var service = new ScheduleAdminService(id);

            if (service.UpdateScheduleAdmin(model))
            {
                TempData["SaveResult"] = "Your Admin Event was updated.";
                return(RedirectToAction("Details", "ScheduleAdmin", new { id = model.EventID }));//figure this out send to shop schedule!!!!!!!
            }

            ModelState.AddModelError("", "Your Admin Event could not be updated.");
            return(View(model));
        }