示例#1
0
 public static void SetStudentProvider(StudentInformationProvider provider)
 {
     _StudentProvider = provider;
     foreach (AccessHelper var in _NonStudentProviderHelperList)
     {
         StudentInformationProvider studentProvider = (StudentInformationProvider)_StudentProvider.Clone();
         studentProvider.AccessHelper = var;
         studentProvider.CachePool    = var._CachePool;
         var._StudentHelper           = new StudentHelper(studentProvider, var);
     }
     _NonStudentProviderHelperList.Clear();
 }
示例#2
0
        /// <summary>
        /// 建構子
        /// </summary>
        public AccessHelper()
        {
            _CachePool = new System.Collections.Hashtable();
            if (_StudentProvider != null)
            {
                StudentInformationProvider studentProvider = (StudentInformationProvider)_StudentProvider.Clone();
                studentProvider.AccessHelper = this;
                studentProvider.CachePool    = _CachePool;
                _StudentHelper = new StudentHelper(studentProvider, this);
            }
            else
            {
                _NonStudentProviderHelperList.Add(this);
            }

            if (_ClassProvider != null)
            {
                ClassInformationProvider classProvider = (ClassInformationProvider)_ClassProvider.Clone();
                classProvider.AccessHelper = this;
                classProvider.CachePool    = _CachePool;
                _ClassHelper = new ClassHelper(classProvider, this);
            }
            else
            {
                _NonClassProviderHelperList.Add(this);
            }

            if (_CourseProvider != null)
            {
                CourseInformationProvider courseProvider = (CourseInformationProvider)_CourseProvider.Clone();
                courseProvider.AccessHelper = this;
                courseProvider.CachePool    = _CachePool;
                _CourseHelper = new CourseHelper(courseProvider, this);
            }
            else
            {
                _NonCourseProviderHelperList.Add(this);
            }

            if (_TeacherProvider != null)
            {
                TeacherInformationProvider teacherProvider = (TeacherInformationProvider)_TeacherProvider.Clone();
                teacherProvider.AccessHelper = this;
                teacherProvider.CachePool    = _CachePool;
                _TeacherHelper = new TeacherHelper(teacherProvider, this);
            }
            else
            {
                _NonTeacherProviderHelperList.Add(this);
            }
        }
示例#3
0
 internal StudentHelper(StudentInformationProvider provider, AccessHelper accesshelper)
 {
     _Provider     = provider;
     _AccessHelper = accesshelper;
 }