public void UpdateTimeslots() { AvaliableTimes = StaffDBConverter.GetAvaliableTimeslots(SelectedDate, RequestedDoctor, RequestedGender); if (AvaliableTimes.Rows.Count <= 0) { NoAvaliableTime = "No Avaliable Times."; } else { NoAvaliableTime = ""; } }
public ReservationAppointmentViewModel() { _dialogService = new DialogBoxService(); if (IsInDesignMode) { SelectedDate = DateTime.Parse("17/02/2000"); } else { if (DateTime.Today.Date.DayOfWeek == DayOfWeek.Friday) { SelectedDate = DateTime.Now.AddDays(3).Date; } else if (DateTime.Today.Date.DayOfWeek == DayOfWeek.Saturday) { SelectedDate = DateTime.Now.AddDays(2).Date; } else { SelectedDate = DateTime.Now.AddDays(1).Date; } } AvaliableTimes = StaffDBConverter.GetAvaliableTimeslots(SelectedDate, RequestedDoctor, RequestedGender); if (AvaliableTimes.Rows.Count <= 0) { NoAvaliableTime = "No Avaliable Times."; } else { NoAvaliableTime = ""; } MessengerInstance.Register <DateTime> ( this, (action) => UpdateTimeslots() ); MessengerInstance.Register <int>(this, UpdateTimeslotIndex); // When patientID message is received (from PatientDBConverter), set patient ID in VM. MessengerInstance.Register <double>(this, SetPatientID); BookAppointmentCommand = new RelayCommand(BookAppointment); }