public UpdatePatient(PatientGrid p) { //var check = sender as CheckBox; //check.IsChecked = p.IsHead; //check.SetCurrentValue(CheckBox.IsCheckedProperty, p.IsHead); //TheHead.SetCurrentValue firstName = p.FirstName; lastName = p.LastName; patientOQ = p.PatientOQ; relationToHead = p.RelationToHead; date = p.Time; pOQ = p.PatientOQ; PatientID = p.PatientID; InitializeComponent(); DetermineProblems(); }
public AddGroupSession(int expenseTypeID, PatientGrid individual, int staffID, DateTime expenseDueDate, DateTime startDateTime, DateTime endDateTime, int appointmentID) { ClientFirstName = individual.FirstName; ClientLastName = individual.LastName; ClientOQNumber = individual.PatientOQ; ExpenseTypeID = expenseTypeID; Individual = individual; StaffID = staffID; AppointmentID = appointmentID; ExpenseDueDate = expenseDueDate; StartDateTime = startDateTime; EndDateTime = endDateTime; InitializeComponent(); Grant.IsEnabled = false; ExpensePaidDate.IsEnabled = false; FN.Focus(); }
/// <summary> /// This creates the dialog to Add or Update a client /// </summary> /// <param name="bAddClientsOnly"></param> public Window_Client(string staffRole, PatientGrid editPatient) { // Pre-initialization of variables HouseholdPopulation = 1; FCS_DBModel db = new FCS_DBModel(); // For only adding clients if (editPatient == null) { InitializeComponent(); check_UpdateHousehold.Visibility = Visibility.Hidden; check_ChangeHousehold.Visibility = Visibility.Hidden; button_DeleteClient.Visibility = Visibility.Hidden; tab_UpdateClient.IsSelected = true; tab_UpdateClient.Visibility = Visibility.Collapsed; tab_ClientSessions.Visibility = Visibility.Collapsed; button_CancelClient.SetValue(Grid.ColumnProperty, 3); // Add Client button stuff button_AddUpdateClient.Content = "Add"; button_AddUpdateClient.Click += new RoutedEventHandler(Add_Client); textblock_Title.Text = "Add New Client"; // Prepopulate the OQ number try { string lastPatientOQ = db.Patients.OrderByDescending(x => x.PatientOQ).Select(x => x.PatientOQ).First(); int newPatientOQ = int.Parse(lastPatientOQ) + 1; textbox_ClientOQ.Text = newPatientOQ.ToString(); patientOQ = newPatientOQ.ToString(); } catch { textbox_ClientOQ.Text = "1"; patientOQ = "1"; } // Prepopulate the date date_ClientCreationDate.SelectedDate = DateTime.Now; // Focus for the dialog textbox_ClientOQ.Focus(); } // For updating clients else { // Get the values from the grid firstName = editPatient.FirstName; lastName = editPatient.LastName; patientOQ = editPatient.PatientOQ; relationToHead = editPatient.RelationToHead; date = editPatient.Time; patientOQ = editPatient.PatientOQ; patientID = editPatient.PatientID; InitializeComponent(); // Hide those UI items that shouldn't exist textbox_FamilyMemberOQ.IsEnabled = false; textbox_ClientOQ.IsEnabled = false; check_FirstHouseholdMember.Visibility = Visibility.Hidden; // Manually set the rest of the data to be displayed if (editPatient.IsHead) { check_HeadOfHousehold.IsChecked = editPatient.IsHead; textbox_RelationToHead.IsEnabled = false; textbox_RelationToHead.Text = ""; } date_ClientCreationDate.SelectedDate = editPatient.Time; combobox_Gender.Text = editPatient.Gender; combobox_AgeGroup.Text = editPatient.AgeGroup; combobox_ethnicity.Text = editPatient.Ethnicity; // Get the problems ShowProblems(); // Get the household information int householdID = db.Patients.Where(x => x.PatientID == patientID).Select(x => x.HouseholdID).Distinct().First(); County = db.PatientHouseholds.Where(x => x.HouseholdID == householdID).Select(x => x.HouseholdCounty).Distinct().First(); Income = db.PatientHouseholds.Where(x => x.HouseholdID == householdID).Select(x => x.HouseholdIncomeBracket).Distinct().First(); HouseholdPopulation = db.PatientHouseholds.Where(x => x.HouseholdID == householdID).Select(x => x.HouseholdPopulation).Distinct().First(); combobox_County.Text = County; combobox_IncomeBracket.Text = Income; textbox_HouseholdPopulation.Text = HouseholdPopulation.ToString(); // Update Client button stuff button_AddUpdateClient.Content = "Update"; button_AddUpdateClient.Click += new RoutedEventHandler(Update_Client); // Change the title textblock_Title.Text = "Update Client"; // Focusing textbox_FirstName.Focus(); } }