/* * public static List<Student> getAllStudents() * { * students = new List<Student>(); * * students.Add(new Student("Pesho", "Peshov", "Peshov", "FKSU", "KSI", "bachelor", Status.CERTIFIED, "121217001", 3, 9, 36)); * students.Add(new Student("Gosho", "Goshov", "Goshov", "FKSU", "KSI", "bachelor", Status.DISCONTINUED, "121223456", 3, 9, 37)); * students.Add(new Student("Stoyanka", "Ivanova", "Dimitrova", "FKSU", "KSI", "bachelor", Status.SEMESTERS_COMPLETED, "121213285", 3, 9, 38)); * * return students; * }*/ public static StudentsList getAllStudents() { students = new StudentsList(); students.Add(new Student("Pesho", "Peshov", "Peshov", "FKSU", "KSI", "bachelor", Status.CERTIFIED, "121217001", 3, 9, 36)); students.Add(new Student("Gosho", "Goshov", "Goshov", "FKSU", "KSI", "bachelor", Status.DISCONTINUED, "121223456", 3, 9, 37)); students.Add(new Student("Stoyanka", "Ivanova", "Dimitrova", "FKSU", "KSI", "bachelor", Status.SEMESTERS_COMPLETED, "121213285", 3, 9, 38)); return(students); }
private void btnShowStudents_Click(object sender, RoutedEventArgs e) { MainWindow mainWindow = new MainWindow(); StudentsList studentsListWindow = new StudentsList(); studentsListWindow.Height = mainWindow.Height; studentsListWindow.Width = mainWindow.Width; studentsListWindow.ShowDialog(); this.Close(); }
public StudentsList GetByFstAndLstName(string fname, string lname) { StudentsList stList = new StudentsList(); for (int i = 0; i <= Count; i++) { if (_students[i].FirstName.Equals(fname) && (_students[i].LastName.Equals(lname))) { stList.Add(_students[i]); } } return(stList); }
/* * public Student GetByLastName(string name) * { * foreach(Student st in _students) * { * if (st.LastName.Equals(name)) return st; * } * return null; * }*/ public StudentsList GetByLastName(string name) { StudentsList stList = new StudentsList(); for (int i = 0; i <= Count; i++) { if (_students[i].LastName.Equals(name)) { stList.Add(_students[i]); } } return(stList); }
public StudentsList GetByStatus(Status status) { StudentsList stList = new StudentsList(); for (int i = 0; i <= Count; i++) { if (_students[i].Status == status) { stList.Add(_students[i]); } } return(stList); }
public StudentsList GetByCourse(string degree, int course) { StudentsList stList = new StudentsList(); for (int i = 0; i <= Count; i++) { if (_students[i].Degree.Equals(degree)) { if (_students[i].Course == course) { stList.Add(_students[i]); } } } return(stList); }