private void AddUserAccount_Load(object sender, EventArgs e) { Controller.Department department = new Controller.Department(); Controller.Role role = new Controller.Role(); department.LoadAllDepartment(comboBoxDepartmentName); role.LoadAllRole(comboBoxRole); CheckFormCall(); }
private void HomeForm_Load(object sender, EventArgs e) { Controller.Role role = new Controller.Role(); //for admin if (role.GetRoleName(userAccount.ua_role) == "Admin") { labelDepartmentTitle.Text = "Welcome to Attandance System.\nRole : " + role.GetRoleName(userAccount.ua_role); addStudentToolStripMenuItem.Visible = false; addTeacherToolStripMenuItem.Visible = false; addSectionToolStripMenuItem.Visible = false; addSubjectToolStripMenuItem.Visible = false; } else { Controller.Department department = new Controller.Department(); labelDepartmentTitle.Text = "Welcome to :" + department.GetDepartmentName(userAccount.ua_department_id) + " department.\nRole : " + role.GetRoleName(userAccount.ua_role); //add addDepartmentToolStripMenuItem.Visible = false; addUserAccountToolStripMenuItem.Visible = false; //view viewDepartmentToolStripMenuItem.Visible = false; viewUserAccountToolStripMenuItem.Visible = false; } }