//clicking on a day private void DayBox_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { MonthDayBoxControl dayClicked = (MonthDayBoxControl)sender; NewApptDay dayWindow = new NewApptDay(dayClicked.getDay(), this.currentMonth, this.currentYear, potentialLength, apptType, targetPatient); dayWindow.Owner = this; dayWindow.Show(); this.Hide(); }
//creates a new day public NewApptDay(int day, int month, int year, int potentialLength, string apptType, Patient targetPatient) { NewApptDay.newWindowOpened += handleNewWindow; MainWindow.mainClosed += handleMainClose; NewApptDay.newWindowOpened(this, null); InitializeComponent(); this.potentialLength = potentialLength; this.apptType = apptType; this.patient = targetPatient; this.time = new DateTime(year, month, day); this.dateText.Text = time.ToString("d MMM yyyy"); MediSchedData.dbChanged += handleDbChange; loadDaySchedules(); }