private void button4_Click(object sender, EventArgs e) { this.Hide(); FacultyInfo fi = new FacultyInfo(selectedItem, loginUserName, department); fi.Show(); }
private void ItemClick(object sender, MouseEventArgs e) { string selectedItem = listBox1.SelectedItem.ToString(); this.Hide(); FacultyInfo fi = new FacultyInfo(selectedItem, loginUserName, department); fi.Show(); }
private void button1_Click(object sender, EventArgs e) { if ((textBox1.Text != selectedItem && fbl.IsExistCSFaculty(textBox1.Text)) || (textBox1.Text != selectedItem && fbl.IsExistEEEFaculty(textBox1.Text)) || (textBox1.Text != selectedItem && fbl.IsExistBBAFaculty(textBox1.Text))) { MessageBox.Show("Faculty with same User Name already exist.\nPlease use another UserName."); } else if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox8.Text == "" || textBox4.Text == "" || textBox5.Text == "" || textBox7.Text == "" || textBox6.Text == "" || comboBox1.SelectedIndex == 0 || textBox12.Text == "" || textBox11.Text == "" || textBox10.Text == "" || pictureBox1.Image == null) { MessageBox.Show("Please fill all the information correctly."); } else if (textBox1.Text.Length != 7) { MessageBox.Show("Please use 7 character for a User Name."); } else { string bloodGroup = comboBox1.Items[comboBox1.SelectedIndex].ToString(); string gender; if (radioButton1.Checked == true) { gender = "Male"; } else { gender = "Female"; } fbl.UpdateFaculty(selectedItem, textBox1.Text, textBox2.Text, textBox3.Text, textBox8.Text, textBox4.Text, textBox5.Text, textBox7.Text, textBox6.Text, gender, bloodGroup, textBox12.Text, textBox11.Text, textBox10.Text, pictureBox1.Image, department); this.Hide(); FacultyInfo fi = new FacultyInfo(selectedItem, loginUserName, department); fi.Show(); MessageBox.Show("Faculty information updated successfully."); } }