public static ArrayList getAllStudentsFromTheSameStudyField(String field) {//get all the students from the same study field(not from the same degree) List <userTbl> students = getAllScholarshipsStudents().ToList(); ArrayList studentsAL = new ArrayList(); int num = ForeignKeys.getnumberOfFieldByName(field); foreach (var student in students) { if (student.studyField == num) { studentsAL.Add(student); } } return(studentsAL); }
/// <Summary> /// filter students table by academic institue - get all the students from the same academy /// </Summary> public static ArrayList getStudentsFromTheSameInstitution(String institute) { ArrayList students = getAllScholarshipsStudents(); ArrayList studentsAL = new ArrayList(); int num = ForeignKeys.getInstitutionNumberByName(institute); foreach (userTbl student in students) { if (student.academicInstitution == num) { studentsAL.Add(student); } } return(studentsAL); }
/// <Summary> /// give all chosen users in the table that are from a specific city /// </Summary> public static List <userTbl> getAllChosenUsersFromSpecificCity(List <userTbl> usersList, String city) { //get the serial number of the specific city int sn = ForeignKeys.getCityNumberByName(city); List <userTbl> users = usersList; ArrayList usersAL = new ArrayList(); foreach (var user in users) { if (user.cityNumber == sn) { usersAL.Add(user); } } return(users); }