private RequestsViewModel CreateRequestsViewModel(AddRequestViewModel addRequestViewModel = null) { var model = new RequestsViewModel(); model.AppointmentsWait = _appointmentsService.GetWaitingAppointments(CurrentUserType, CurrentUserId); model.AppointmentsAccepted = _appointmentsService.GetAcceptedAppointments(CurrentUserType, CurrentUserId); model.AppointmentsRefused = _appointmentsService.GetRefusedAppointments(CurrentUserType, CurrentUserId); model.CanAcceptOrRefuseAppointments = IsCurrentUserStaff; if (addRequestViewModel != null) { model.AddRequestViewModel = addRequestViewModel; model.OpenAddRequestModal = true; } model.AddRequestViewModel.Doctors = _staffService.GetStaffs(); return(model); }