Ejemplo 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));
 }
Ejemplo n.º 2
0
 public ActionResult ShowSchedule([PRGInRoute]int id)
 {
     var form = new ScheduleForm { WorkWeek = Get<IWorkWeekRepository>().GetByDoctorId(id) };
     return View("ShowSchedule", form);
 }
Ejemplo n.º 3
0
 public ActionResult EditSchedule([PRGInRoute]int id, ScheduleForm form)
 {
     form.WorkWeek = form.WorkWeek ?? Get<IWorkWeekRepository>().GetByDoctorId(id);
     return View("EditSchedule", form);
 }