//event for clicking the appointment block private void ApptBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { ApptBlockControl apptBlock = (ApptBlockControl)sender; if (apptBlock.isEnabled()) { ApptWindow apptWindow = new ApptWindow(apptBlock, apptBlock.getApptRepresenting()); apptWindow.Owner = Window.GetWindow(this); apptWindow.Show(); } else { //save and close string apptStatus = "Not Arrived"; apptBlock.setApptRepresenting(new Appointment(patient, apptType, apptStatus, potentialLength, this.startBlock, this.time)); //saves the appointment to the block (probably dont need this) daySched.setAppointmentAtTime(apptBlock.getApptRepresenting(), Array.IndexOf(apptBlocks, apptBlock)); //save the appointment to the schedule //add the appointment to the patient as well this.patient.addAppointment(apptBlock.getApptRepresenting()); //MessageBox.Show("SAVED"); Window.GetWindow(this).Close(); //force the windows to update MediSchedData.forceRefresh(); } }
//selected an appointment from the past/future tabs private void appt_Selected(object sender, RoutedEventArgs e) { //get the appointment from the list somehow Appointment apptSelected = ((sender as ListBox).SelectedItem as Appointment); if (apptSelected != null) { ApptWindow apptWindow = new ApptWindow(apptSelected); //apptWindow.Owner = this; //TODO idk if i should do this owner stuff apptWindow.Show(); } }