Esempio n. 1
0
 public ActionResult EditSchedule(ScheduleForm form)
 {
     if (ModelState.IsValid)
     {
         form.WorkWeek.Doctor = Get<IDoctorRepository>().GetById(form.WorkWeek.Doctor.Id);
         Get<IWorkWeekRepository>().Update(form.WorkWeek);
         return RedirectTo<DoctorController>(a => a.ShowSchedule(form.WorkWeek.Doctor.Id), "Admin_default");
     }
     return RedirectTo<DoctorController>(a => a.EditSchedule(form.WorkWeek.Doctor.Id, form));
 }
Esempio n. 2
0
 public ActionResult ShowSchedule([PRGInRoute]int id)
 {
     var form = new ScheduleForm { WorkWeek = Get<IWorkWeekRepository>().GetByDoctorId(id) };
     return View("ShowSchedule", form);
 }
Esempio n. 3
0
 public ActionResult EditSchedule([PRGInRoute]int id, ScheduleForm form)
 {
     form.WorkWeek = form.WorkWeek ?? Get<IWorkWeekRepository>().GetByDoctorId(id);
     return View("EditSchedule", form);
 }