private void updateBTN_Click(object sender, EventArgs e) { if (r == null) { MessageBox.Show("select Librarian "); } else { bool Isopen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "Librarian_Reg") { Isopen = true; f.BringToFront(); break; } } if (Isopen == false) { Librarian_Reg lr = new Librarian_Reg(librarian, "update"); lr.Show(); } } }
private void admin_Click(object sender, EventArgs e) { Button button = sender as Button; if (button.Name.Equals("register_Btn")) { bool Isopen = false; foreach (Form f in Application.OpenForms) { if (f.Text == "admin_Reg") { Isopen = true; f.BringToFront(); break; } } if (Isopen == false) { Librarian_Reg adr = new Librarian_Reg(); adr.Show(); } } if (button.Name.Equals("changePass_Btn")) { bool Isopen = false; foreach (Form C in Application.OpenForms) { if (C.Text == "Change_Password") { Isopen = true; C.BringToFront(); break; } } if (Isopen == false) { Change_Password cp = new Change_Password(); cp.Show(); } } }