private void textBox20_TextChanged(object sender, EventArgs e) { if (textBox20.Text == "") { label36.Text = "Validate Medical Staff ID"; label36.ForeColor = Color.Black; label36.Visible = false; } else { DbConnector dbConn = new DbConnector(); dbConn.connect(); MedicalStaffHandler mStaffHnd = new MedicalStaffHandler(); bool goCheckStaffId = mStaffHnd.checkStaffId(dbConn.getConn(), textBox20.Text); if (goCheckStaffId == true) { label36.Text = "Valid Staff ID"; label36.ForeColor = Color.Green; label36.Visible = true; dateTimePicker1_ValueChanged(null, e); } else if (goCheckStaffId == false) { label36.Text = "Invalid Staff ID"; label36.ForeColor = Color.Red; label36.Visible = true; } } }
private void textBox21_TextChanged(object sender, EventArgs e) { if (textBox21.Text == "") { label41.Text = "Validate Medical Staff ID"; label41.ForeColor = Color.Black; label41.Visible = false; comboBox7.Enabled = false; comboBox8.Enabled = false; } else { DbConnector dbConn = new DbConnector(); dbConn.connect(); MedicalStaffHandler mStaffHnd = new MedicalStaffHandler(); bool goCheckStaffId = mStaffHnd.checkStaffId(dbConn.getConn(), textBox21.Text); if (goCheckStaffId == true) { label41.Text = "Valid Staff ID"; label41.ForeColor = Color.Green; label41.Visible = true; comboBox7.Enabled = true; OnShift oShift = new OnShift(); OnShiftHandler oShiftHnd = new OnShiftHandler(); oShift.StaffId = textBox21.Text; comboBox7.DataSource = oShiftHnd.showDate(dbConn.getConn(), oShift); } else if (goCheckStaffId == false) { label41.Text = "Invalid Staff ID"; label41.ForeColor = Color.Red; label41.Visible = true; comboBox7.Enabled = false; comboBox8.Enabled = false; comboBox7.SelectedIndex = 0; comboBox8.SelectedIndex = 0; } } }