예제 #1
0
        public ActionResult Reschedule(int?id)
        {
            AppointmentRepository appRepo = new AppointmentRepository();
            Appointment           app     = appRepo.GetByID(id.Value);

            AppointmentReschedule model = new AppointmentReschedule()
            {
                Date = app.Date
            };

            return(View(model));
        }
예제 #2
0
        public ActionResult Reschedule(AppointmentReschedule model)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            AppointmentRepository appRepo = new AppointmentRepository();
            Appointment           app     = appRepo.GetByID(model.ID);

            app.Date   = model.Date;
            app.Status = StatusEnum.Unknown;
            appRepo.Save(app);

            return(RedirectToAction("Index"));
        }