public CourseExamValidator(StudentCourseInfo studentCourseInfo, List <JHAEIncludeRecord> aeList, List <JHExamRecord> examList)
        {
            _studentCourseInfo = studentCourseInfo;
            _aeTable           = new Dictionary <string, List <string> >();

            Dictionary <string, string> examNames = new Dictionary <string, string>();

            foreach (JHExamRecord exam in examList)
            {
                if (!examNames.ContainsKey(exam.ID))
                {
                    examNames.Add(exam.ID, exam.Name);
                }
            }

            foreach (JHAEIncludeRecord 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]);
                }
            }
        }
Пример #2
0
        public SCValidatorCreator(List <JHStudentRecord> studentList, List <JHCourseRecord> courseList, List <JHSCAttendRecord> scaList)
        {
            _studentDict       = new StudentNumberDictionary();
            _courseDict        = new Dictionary <string, JHCourseRecord>();
            _studentCourseInfo = new StudentCourseInfo();
            _attendCourseIDs   = new List <string>();

            foreach (JHStudentRecord student in studentList)
            {
                string studentNumber = student.StudentNumber;

                studentNumber = GetStudentNumberFormat(studentNumber);

                if (!_studentDict.ContainsKey(studentNumber))
                {
                    _studentDict.Add(studentNumber, student);
                }

                _studentCourseInfo.Add(student);
            }

            foreach (JHCourseRecord 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 (JHSCAttendRecord 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;
 }