//set department data from database public void setRegisterDepartment() { registerDepartmentcomboBox.Items.Add("--Select Department--"); registerDepartmentcomboBox.SelectedIndex = 0; DBConnector dbC = new DBConnector(); dbC.connect(); RoleHandler roleHandler = new RoleHandler(); List <Role> rolesList = new List <Role>(); rolesList = roleHandler.getAllRole(dbC.getConn()); for (int i = 0; i < rolesList.Count; i++) { registerDepartmentcomboBox.Items.Add(rolesList[i].Position); } }
public static List <Role> getAllRole() { return(RoleHandler.getAllRole()); }