private void NewStaff_Load(object sender, EventArgs e) { try { entries(); //NewPatient Department comboBox this.comboBoxDepartment.DataSource = DepartmentStaffManager.getDepartmentList(); this.comboBoxDepartment.DisplayMember = "departmentName"; this.comboBoxDepartment.ValueMember = "departmentId"; //NewPatient Nationality comboBox this.comboBoxNationality.DataSource = NationalityManager.getNationalityList(); this.comboBoxNationality.DisplayMember = "nationalityName"; this.comboBoxNationality.ValueMember = "nationalityId"; //Staff shifts combobox this.comboBoxStaffShift.DataSource = StaffShiftsManager.getStaffShifts(); this.comboBoxStaffShift.DisplayMember = "fullDetails"; this.comboBoxStaffShift.ValueMember = "shiftId"; //Setting comboboxes to -1 index so no item apperas on load this.comboBoxDepartment.SelectedIndex = -1; this.comboBoxNationality.SelectedIndex = -1; this.comboBoxSex.SelectedIndex = -1; this.comboBoxStaffShift.SelectedIndex = -1; this.labelHeader.Width = this.Width; } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void ExistingStaff_Load(object sender, EventArgs e) { //display staff in dataGridView displayStaff(); //sets header for dataGridViewExistingStaff setDataGridViewStaffHeaders(); notSortableDataGridViewExsitingStaff(); toUpperCaseLabels(); //ExistingStaff Department comboBox this.comboBoxDepartment.DisplayMember = "departmentName"; this.comboBoxDepartment.ValueMember = "departmentId"; this.comboBoxDepartment.DataSource = DepartmentDoctorManager.getDepartmentList(); //ExistingStaff Nationality comboBox this.comboBoxNationality.DisplayMember = "nationalityName"; this.comboBoxNationality.ValueMember = "nationalityId"; this.comboBoxNationality.DataSource = NationalityManager.getNationalityList(); //Staff shifts combobox this.comboBoxStaffShift.DataSource = StaffShiftsManager.getStaffShifts(); this.comboBoxStaffShift.DisplayMember = "fullDetails"; this.comboBoxStaffShift.ValueMember = "shiftId"; //sets colour for alternate rowns for dataGridViewExsitingDoctor this.dataGridViewExistingStaff.AlternatingRowsDefaultCellStyle.BackColor = Color.Bisque; //hide shift ID column //this.dataGridViewExistingStaff.Columns[0].Visible = false; //datagridview full row select fullRowSelectDataGridViewExistingStaff(); //allowUsersToAddRows = false; this.dataGridViewExistingStaff.AllowUserToAddRows = false; //make dataGriDViewExistingStaff read only this.dataGridViewExistingStaff.ReadOnly = true; //Setting comboboxes to -1 index so no item apperas on load this.comboBoxDepartment.SelectedIndex = -1; this.comboBoxNationality.SelectedIndex = -1; this.comboBoxSex.SelectedIndex = -1; this.comboBoxStaffShift.SelectedIndex = -1; this.labelHeader.Width = this.Width; }
private void AssignStaffShifts_Load(object sender, EventArgs e) { try { //display staff in dataGridView displayStaff(); displayShifts(); toUpperCaseLabels(); // Department comboBox this.comboBoxDepartment.DisplayMember = "departmentName"; this.comboBoxDepartment.ValueMember = "departmentId"; this.comboBoxDepartment.DataSource = DepartmentStaffManager.getDepartmentList(); // Nationality comboBox this.comboBoxNationality.DisplayMember = "nationalityName"; this.comboBoxNationality.ValueMember = "nationalityId"; this.comboBoxNationality.DataSource = NationalityManager.getNationalityList(); // shift combobox this.comboBoxStaffShift.DataSource = StaffShiftsManager.getStaffShifts(); this.comboBoxStaffShift.DisplayMember = "fullDetails"; this.comboBoxStaffShift.ValueMember = "shiftId"; //sets colour for alternate rowns for dataGridViewStaff this.dataGridViewStaff.AlternatingRowsDefaultCellStyle.BackColor = Color.Bisque; //sets colour for laternate rows for datagridviewstaffshift this.dataGridViewStaffShift.AlternatingRowsDefaultCellStyle.BackColor = Color.Bisque; //Setting comboboxes to -1 index so no item apperas on load this.comboBoxDepartment.SelectedIndex = -1; this.comboBoxNationality.SelectedIndex = -1; this.comboBoxSex.SelectedIndex = -1; this.comboBoxStaffShift.SelectedIndex = -1; this.labelHeader.Width = this.Width; } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }