예제 #1
0
 private void buttonPrescription_Click(object sender, RoutedEventArgs e)
 {
     Content = new PrescriptionMainView(patient.HealthCareNo);
 }
예제 #2
0
 private void buttonSave_Click(object sender, RoutedEventArgs e)
 {
     buttonSave.Focus(); //This is to lose focus on the last text field as data binding will not grab the last piece of data because textchanged is not fired off until focus is lost
     prescription.Status = "Upcoming";
     if (boxDoctors.SelectedIndex > 0)
         prescription.Doctor = employeeIDs[boxDoctors.SelectedIndex];
     if (DateTime.Compare(dpStartDate.SelectedDate.Value,dpEndDate.SelectedDate.Value) > 0)
     {
         MessageBox.Show("The start date must occur before the end date");
     }
     else if ((Caller == "New" && prescription.Insert()))
     {
         Content = new PrescriptionMainView(patient.HealthCareNo);
     }
     else if (prescription.Update())
     {
         Content = new PrescriptionMainView(patient.HealthCareNo);
     }
     else
     {
         MessageBox.Show("Error Occured");
     }
 }