private void NewDoctor_Load(object sender, EventArgs e) { try { entries(); //NewDoctor Department comboBox this.comboBoxDepartment.DataSource = DepartmentDoctorManager.getDepartmentList(); this.comboBoxDepartment.DisplayMember = "departmentName"; this.comboBoxDepartment.ValueMember = "departmentId"; //NewDoctor Nationality comboBox this.comboBoxNationality.DataSource = NationalityManager.getNationalityList(); this.comboBoxNationality.DisplayMember = "nationalityName"; this.comboBoxNationality.ValueMember = "nationalityId"; //DoctorShifts Doctor Shifts comboBox this.comboBoxDoctorShift.DataSource = DoctorShiftsManager.getDoctorShifts(); this.comboBoxDoctorShift.DisplayMember = "fullDetails"; this.comboBoxDoctorShift.ValueMember = "shiftId"; //Setting comboboxes to -1 index so no item apperas on load this.comboBoxDepartment.SelectedIndex = -1; this.comboBoxDoctorShift.SelectedIndex = -1; this.comboBoxNationality.SelectedIndex = -1; this.comboBoxSex.SelectedIndex = -1; this.labelHeader.Width = this.Width; } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void BookAppointment_Load(object sender, EventArgs e) { dateTimePickerAppointmentTime.Format = DateTimePickerFormat.Time; //dateTimePickerAppointmentTime.CustomFormat = "MM/ dd/ yyyy | hh:mm:ss"; //displaying Patient list in dataGridViewPatient displayPatient(); setDatagridViewPatientHeaders(); notSortableDataGirdViewPatient(); fullRowSelectDataGridViewPatient(); toUpperCaseLabels(); //Department ComboBox this.comboBoxDepartment.DisplayMember = "departmentName"; this.comboBoxDepartment.ValueMember = "departmentId"; this.comboBoxDepartment.DataSource = DepartmentDoctorManager.getDepartmentList(); //ExistingDoctor Nationality comboBox this.comboBoxNewNationality.DisplayMember = "nationalityName"; this.comboBoxNewNationality.ValueMember = "nationalityId"; this.comboBoxNewNationality.DataSource = NationalityManager.getNationalityList(); //dataGridViewDoctor alternateRow colorChanged this.dataGridViewDoctor.AlternatingRowsDefaultCellStyle.BackColor = Color.SkyBlue; //dataGridViewPatient alternateRow colorChanged this.dataGridViewPatient.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen; //comboBox this.comboBoxDepartment.SelectedIndex = -1; this.comboBoxNewNationality.SelectedIndex = -1; //textBoxTime scrollBars textBoxAppTime.ScrollBars = ScrollBars.Vertical; //dataGridViewDoctor is Visible = False this.dataGridViewDoctor.Visible = false; this.labelHeader.Width = this.Width; }
private void displayDoctorDepartment() { DataTable dt = new DataTable(); dt = DepartmentDoctorManager.doctorDepartmentSelect(); this.dataGridViewDoctorDepartment.DataSource = dt; }
// EVENTS private void ExistingPatient_Load(object sender, EventArgs e) { try { displayPatient(); notSortableDataGridViewExistingPatient(); notSortableDataGridViewAppointmentHistory(); setDataGridViewExistingPatientHeaders(); setDataGridViewAppointmentHeaders(); toUpperCaseLabels(); this.comboBoxDepartment.DataSource = DepartmentDoctorManager.getDepartmentList(); this.comboBoxDepartment.DisplayMember = "departmentName"; this.comboBoxDepartment.ValueMember = "departmentId"; //ExistingPatient Nationality comboBox this.comboBoxNationality.DataSource = NationalityManager.getNationalityList(); this.comboBoxNationality.DisplayMember = "nationalityName"; this.comboBoxNationality.ValueMember = "nationalityId"; //sets colour for alternate rowns for dataGridViewExsitingPatient this.dataGridViewExistingPatient.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen; //sets color for alternate rows for datagridviewappointmenthistory this.dataGridViewAppointmentHistory.AlternatingRowsDefaultCellStyle.BackColor = Color.DodgerBlue; //datagridview row select this.dataGridViewExistingPatient.SelectionMode = DataGridViewSelectionMode.FullRowSelect; this.dataGridViewAppointmentHistory.SelectionMode = DataGridViewSelectionMode.FullRowSelect; //Setting comboboxes to -1 index so no item apperas on load this.comboBoxNationality.SelectedIndex = -1; this.comboBoxSex.SelectedIndex = -1; this.comboBoxDepartment.SelectedIndex = -1; this.labelHeader.Width = this.Width; } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void buttonNewDepartment_Click(object sender, EventArgs e) { try { DepartmentDoctor depDoc = new DepartmentDoctor(); depDoc.departmentName = this.textBoxDepartmentName.Text; DepartmentDoctorManager.doctorDepartmentInsert(depDoc); MessageBox.Show("Success"); displayDoctorDepartment(); clearTextBoxes(); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void buttonDelete_Click(object sender, EventArgs e) { try { DepartmentDoctor depDoc = new DepartmentDoctor(); depDoc.departmentId = doctorDepartmentId; DepartmentDoctorManager.doctorDepartmentDelete(depDoc); MessageBox.Show("Deleted"); displayDoctorDepartment(); clearTextBoxes(); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void AssignDoctorShifts_Load(object sender, EventArgs e) { displayShifts(); displayDoctor(); setDataGridViewDoctorHeaders(); setDataGridViewDoctorShiftHeaders(); notSortableDataGridViewDoctor(); fullRowSelectDataGridViewDoctorShift(); fullRowSelectDataGridViewDoctor(); toUpperCaseLabels(); //dataGridViewDoctor.Columns[0].Visible = false; //dataGridViewDoctorShift.Columns[0].Visible = false; //ExistingDoctor Depertment comboBox this.comboBoxDepartment.DataSource = DepartmentDoctorManager.getDepartmentList(); this.comboBoxDepartment.DisplayMember = "departmentName"; this.comboBoxDepartment.ValueMember = "departmentId"; //ExistingDoctor Nationality comboBox this.comboBoxNationality.DataSource = NationalityManager.getNationalityList(); this.comboBoxNationality.DisplayMember = "nationalityName"; this.comboBoxNationality.ValueMember = "nationalityId"; //DoctorShifts Doctor Shifts comboBox this.comboBoxDoctorShift.DataSource = DoctorShiftsManager.getDoctorShifts(); this.comboBoxDoctorShift.DisplayMember = "fullDetails"; this.comboBoxDoctorShift.ValueMember = "shiftId"; //sets colour for alternate rowns for dataGridViewDoctor this.dataGridViewDoctor.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen; //sets color for alternate rows for datagridviewdoctorshifts this.dataGridViewDoctorShift.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen; //hide Doctor Id column this.dataGridViewDoctor.Columns[0].Visible = false; //hide shift Id column this.dataGridViewDoctorShift.Columns[0].Visible = false; //allowUsersToAddRows =false this.dataGridViewDoctor.AllowUserToAddRows = false; this.dataGridViewDoctorShift.AllowUserToAddRows = false; //make datagridview readonly this.dataGridViewDoctor.ReadOnly = true; this.dataGridViewDoctorShift.ReadOnly = true; //For flickering problem this.DoubleBuffered = true; this.labelHeader.Width = this.Width; }
private void ExistingDoctor_Load(object sender, EventArgs e) { try { displayDoctor(); notSortableDataGridViewExistingDoctor(); notSortableDataGridViewAppointmentHistory(); setdatGridViewEixsitngHeaders(); fullRowSelectDataGridViewExistingDoctor(); fullRowSelectDataGridViewAppointmentHistory(); toUpperCaseLabels(); //this.dataGridViewExistingDoctor.Columns[0].Visible = false; //ExistingDoctor Depertment comboBox this.comboBoxDepartment.DataSource = DepartmentDoctorManager.getDepartmentList(); this.comboBoxDepartment.DisplayMember = "departmentName"; this.comboBoxDepartment.ValueMember = "departmentId"; //ExistingDoctor Nationality comboBox this.comboBoxNationality.DataSource = NationalityManager.getNationalityList(); this.comboBoxNationality.DisplayMember = "nationalityName"; this.comboBoxNationality.ValueMember = "nationalityId"; //DoctorShifts Doctor Shifts comboBox this.comboBoxDoctorShift.DataSource = DoctorShiftsManager.getDoctorShifts(); this.comboBoxDoctorShift.DisplayMember = "fullDetails"; this.comboBoxDoctorShift.ValueMember = "shiftId"; //sets colour for alternate rowns for dataGridViewExsitingDoctor this.dataGridViewExistingDoctor.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen; this.dataGridViewAppointmentHistory.AlternatingRowsDefaultCellStyle.BackColor = Color.LightGreen; //Setting comboboxes to -1 index so no item apperas on load this.comboBoxDepartment.SelectedIndex = -1; this.comboBoxNationality.SelectedIndex = -1; this.comboBoxSex.SelectedIndex = -1; this.comboBoxDoctorShift.SelectedIndex = -1; //For flickering problem this.DoubleBuffered = true; 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; }