private void button3_Click(object sender, RoutedEventArgs e) { employeeeid = id.Text; Edit_Employee eee = new SFS.Edit_Employee(); eee.Show(); }
private void button3_Click(object sender, RoutedEventArgs e) { bool noo = false; bool find = false; for (int i = 0; i < Containers.Employee_list.Count; i++) { if (Containers.Employee_list[i].getId() == id.Text) { if (Containers.Employee_list[i].GetDepartment() == "Coach") { coaach = true; } find = true; } } if (find == false) { MessageBox.Show("Wrong ID"); } else { for (int i = 0; i < Containers.Employee_list.Count; i++) { if (Containers.Employee_list[i].getId() == id.Text) { if ((Containers.Employee_list[i].GetDepartment() == "HR" && employeelogin.hrid == true) || (Containers.Employee_list[i].GetDepartment() == "HR" && Edit_EmployeePassword.ggg == true)) { MessageBox.Show("You are not allowed to edit or delete HR Employee"); noo = true; break; } } } if (noo == false) { employeeeid = id.Text; Edit_Employee eee = new SFS.Edit_Employee(); eee.Show(); this.Close(); } } }