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