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)); }
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")); }