private void SetUser(Object user) { Person[] p = { new Lecturer(), new Tutor(), new Student(), new Secretary(), new DepartmentManager(), new Junior(), new Professor(), new Doctor() }; if (user.GetType() == p[0].GetType() || user.GetType() == p[5].GetType() || user.GetType() == p[6].GetType() || user.GetType() == p[7].GetType()) { pnl_User_Select.Visible = false; pnl_Update_Main.Visible = false; Set_Lecturer((Lecturer)user); } else if (user.GetType() == p[1].GetType()) { pnl_User_Select.Visible = false; pnl_Update_Main.Visible = false; Set_Tutor((Tutor)user); } else if (user.GetType() == p[2].GetType()) { pnl_User_Select.Visible = false; pnl_Update_Main.Visible = false; Set_Student((Student)user); } else if (user.GetType() == p[3].GetType()) { pnl_User_Select.Visible = false; pnl_Update_Main.Visible = false; Set_Secretary((Secretary)user); admin = true; pnl_Update_Main.Visible = true; pnl_User_Select.Visible = true; } else if (user.GetType() == p[4].GetType()) { deptMngr = (DepartmentManager)user; cbo_Choose_User.Items.Add("מזכירה"); admin = true; pnl_Update_Main.Visible = true; pnl_User_Select.Visible = true; } }
public void CreateDepartmentManager(/*string fname, string lname, string id, string address, string user, string pass*/) { deptManager = new DepartmentManager(/*fname, lname, id, address, user, pass*/); }