Example #1
0
 public ActionResult OrderStep2(int specializationId, int doctorId = -1, int policlinicId = -1)
 {
     var repository = new Repository();
     var avaliableDates = repository.GetAvailableTimesByDoctorId(doctorId).Where(t => t.Time > DateTime.Now).Select(t => t.Time);
     ViewBag.PoliclinicId = policlinicId;
     ViewBag.SpecializationId = specializationId;
     ViewBag.DoctorId = doctorId;
     ViewBag.Dates = avaliableDates.DistinctBy(t => t.Date).ToList();
     return View();
 }
Example #2
0
 public ActionResult OrderStep3(string date, int specializationId, int doctorId = -1, int policlinicId = -1)
 {
     var repository = new Repository();
     var availableTimes = repository.GetAvailableTimesByDoctorId(doctorId).Where(t => t.Time > DateTime.Now).Select(t => t.Time);
     var toView = new Dictionary<int, List<DateTime>>();
     var res = availableTimes.GroupBy(t => t.Hour);
     foreach (var re in res)
     {
         var minutes = new List<DateTime>();
         foreach (var minute in re)
         {
             minutes.Add(minute);
         }
         toView.Add(re.Key, minutes);
     }
     ViewBag.PoliclinicId = policlinicId;
     ViewBag.SpecializationId = specializationId;
     ViewBag.DoctorId = doctorId;
     ViewBag.Date = date;
     ViewBag.Times = toView;
     return View();
 }