public IActionResult ShowAppointmentsAdvanced(ShowAppointmentViewModel model) { int DoctorId = repository.GetDoctorIdByUserId(model.DoctorId); List <Appointment> list = repository.GetUserAppointments(DoctorId); return(View("ShowAppointments", list)); }
public IActionResult ShowAppointments(ShowAppointmentViewModel model) { int DoctorId = repository.GetDoctorIdByUserId(model.DoctorId); List <Appointment> list = new List <Appointment>(); if (String.IsNullOrEmpty(model.Country) && String.IsNullOrEmpty(model.City)) { list = repository.GetUserAppointments(DoctorId).Where(x => x.AppointmentDate >= time.GetTime()).OrderByDescending(d => d.AppointmentDate).ToList(); } else { list = repository.GetUserAppointments(DoctorId).Where(a => a.Place.Country == model.Country && a.Place.City == model.City && a.AppointmentDate >= time.GetTime()).ToList(); } return(View(list)); }