public CourseExamValidator(StudentCourseInfo studentCourseInfo, List <SHAEIncludeRecord> aeList, List <SHExamRecord> examList) { _studentCourseInfo = studentCourseInfo; _aeTable = new Dictionary <string, List <string> >(); Dictionary <string, string> examNames = new Dictionary <string, string>(); foreach (SHExamRecord exam in examList) { if (!examNames.ContainsKey(exam.ID)) { examNames.Add(exam.ID, exam.Name); } } foreach (SHAEIncludeRecord ae in aeList) { if (!_aeTable.ContainsKey(ae.RefAssessmentSetupID)) { _aeTable.Add(ae.RefAssessmentSetupID, new List <string>()); } if (examNames.ContainsKey(ae.RefExamID)) { _aeTable[ae.RefAssessmentSetupID].Add(examNames[ae.RefExamID]); } } }
public SCValidatorCreator(List <SHStudentRecord> studentList, List <SHCourseRecord> courseList, List <SHSCAttendRecord> scaList) { _studentDict = new StudentNumberDictionary(); _courseDict = new Dictionary <string, SHCourseRecord>(); _studentCourseInfo = new StudentCourseInfo(); _attendCourseIDs = new List <string>(); foreach (SHStudentRecord student in studentList) { string studentNumber = student.StudentNumber; //studentNumber = GetStudentNumberFormat(studentNumber); if (!_studentDict.ContainsKey(studentNumber)) { _studentDict.Add(studentNumber, student); } _studentCourseInfo.Add(student); } foreach (SHCourseRecord course in courseList) { if (!_courseDict.ContainsKey(course.ID)) { _courseDict.Add(course.ID, course); } } //Linq var student_ids = from student in studentList select student.ID; //foreach (JHSCAttendRecord sc in JHSCAttend.Select(student_ids.ToList<string>(), null, null, "" + schoolYear, "" + semester)) foreach (SHSCAttendRecord sc in scaList) { if (!_studentCourseInfo.ContainsID(sc.RefStudentID)) { continue; } if (!_courseDict.ContainsKey(sc.RefCourseID)) { continue; } if (!_attendCourseIDs.Contains(sc.RefCourseID)) { _attendCourseIDs.Add(sc.RefCourseID); } _studentCourseInfo.AddCourse(sc.RefStudentID, _courseDict[sc.RefCourseID]); } }
public SCAttendValidator(StudentCourseInfo sudentCourseInfo) { _studentCourseInfo = sudentCourseInfo; }