private void Open_CreateNewPatient(object sender, RoutedEventArgs e) { Window_Client ch = new Window_Client(StaffRole, null); ch.combobox_Gender.SelectedIndex = 0; ch.combobox_AgeGroup.SelectedIndex = 0; ch.combobox_ethnicity.SelectedIndex = 0; ch.ShowDialog(); // Refresh the grid after closing the create new patient Refresh_ClientGrid(sender, e); }
// ----------------------------------------------------------------------------- /// <summary> /// This method is for when the EditPatient button is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void EditPatient(object sender, RoutedEventArgs e) { try { DataGrid dg = sender as DataGrid; PatientGrid p = (PatientGrid)dg.SelectedItems[0]; // OR: Patient p = (Patient)dg.SelectedItem; Window_Client clientWindow = new Window_Client(StaffRole, p); clientWindow.ShowDialog(); } catch (Exception error) { } // Refresh the grid Refresh_ClientGrid(sender, e); }
/// <summary> /// Opens CreateNewPatient dialog, then returns the object /// </summary> /// <returns></returns> private Window_Client OpenCreateNewPatient() { Window_Client window = null; ThreadUtilities.RunOnUIThread(new Action(() => { window = new Window_Client(Definition.Admin, null); window.Show(); window.Activate(); })); GeneralUtilities.WaitUntil(() => (bool)Application.Current.Dispatcher.Invoke(new Func<bool>(() => window.IsLoaded))); return window; }
// Used in the TestButtonDisable test private void CheckAddPatientButtonState(Window_Client window, bool isEnabled) { GeneralUtilities.WaitUntil(() => (bool)Application.Current.Dispatcher.Invoke(new Func<bool>(() => window.button_AddUpdateClient.IsLoaded))); ThreadUtilities.RunOnUIThread(new Action(() => { Assert.AreEqual(isEnabled, (bool)window.button_AddUpdateClient.IsEnabled); })); }