//public List<object[]> GetExpelledStudents_linq() //{ // //IEnumerable<object[]> objSorted; // //if (isString == false) // //{ // // objSorted = obj.OrderBy(i => i[column]); // //} // //else // //{ // // objSorted = obj.OrderBy(i => i[column]); // // //todo nead to use IComparer for good string sort // } // List<object[]> objSort = objSorted.ToList(); // return new List<object[]>(); //} public List <object[]> GetExpelledStudents(int SessionNumber) { //find inadmissible marks if (results == null) { results = resultController.Reed(out ColumnsNamesResult); } List <Result> ModifyResults = new List <Result>(); foreach (Result r in results) { if (r.Mark < 4 || r.Mark == null) { ModifyResults.Add(r); } } //find right session List <Schedule> schedules = GetSession(SessionNumber, ModifyResults); List <Result> ModyfiModifyResults = ModyfyResults(ModifyResults, schedules); ModifyResults.Clear(); //find expelleds student List <Student> Expelledstudents = new List <Student>(); foreach (Result r in ModyfiModifyResults) { Expelledstudents.Add(studentController.Reed(r.StudentsID)); } //delete dublicate List <Student> ExpelledstudentsMod = Expelledstudents.Distinct().ToList <Student>(); //find name team List <Team> teams = new List <Team>(); foreach (Student s in ExpelledstudentsMod) { teams.Add(teamController.Reed(s.TeamID)); } List <object[]> objs = new List <object[]>(); objs.Add(new object[] { "Team", "ExpelledStudents" }); for (int i = 0; i < ExpelledstudentsMod.Count; i++) { objs.Add(new object[] { teams[i].Name, ExpelledstudentsMod[i].Name }); } return(objs); }