コード例 #1
0
        public SCETakePackingLoader(IProgressUI progress, string[] courseIds)
        {
            _progress = progress;

            _packings = new List <List <string> >();
            List <string> package = new List <string>();

            for (int i = 0; i < courseIds.Length; i++)
            {
                if (i % PackingSize == 0)
                {
                    package = new List <string>();
                    _packings.Add(package);
                }
                package.Add(courseIds[i]);
            }
        }
コード例 #2
0
 public StudentScoreRank(RankProgressForm rankForm, DoWorkEventArgs workArgs)
 {
     //排名相關參數,由主畫面選項決定。
     _parameters = rankForm.RatingParams;
     //BackgroundWorker 事件物件。
     _work_args = workArgs;
     //工作進度權重管理物件。
     _weights = new JobWeightTable();
     //畫面進度回報物件。
     _progress = new MainProgress(rankForm.ProgressUI, rankForm.MessageLabel);
     //要排名的學生集合。
     _students = new StudentCollection();
     //填入資料的 Adapter 集合。
     _adapters = new AdapterCollection();
     //是否不儲存,只試排看結果。
     _save_required = !rankForm.IsViewMode;
 }
コード例 #3
0
        public CourseScoreUpdater(CourseCollection courses, IProgressUI progress, bool clearData)
        {
            _courses    = courses;
            _progress   = progress;
            _clear_data = clearData;

            _packings = new List <List <Course> >();
            List <Course> package      = new List <Course>();
            int           currentIndex = 0;

            foreach (Course each in courses.Values)
            {
                if (currentIndex % PackingSize == 0)
                {
                    package = new List <Course>();
                    _packings.Add(package);
                }

                package.Add(each);
                currentIndex++;
            }
        }
コード例 #4
0
 public SubProgress(IProgressUI mainProgress, int percentage)
 {
     _main_progress     = mainProgress;
     _percentage        = percentage;
     _previous_progress = 0;
 }
コード例 #5
0
        private static void LogDuplicateSubject(IProgressUI progressUI, Student student, YearSubjectScore objScore)
        {
            string msg = "學生「{0}(編號:{1})」的科目成績「{2}」重覆 (學年)。";

            //progressUI.LogMessage(string.Format(msg, student.Name, student.Identity, objScore.ScoreName));
        }
コード例 #6
0
        public static SCETakeCollection GetSCETakes(IProgressUI progress, params string[] courseIds)
        {
            SCETakePackingLoader loader = new SCETakePackingLoader(progress, courseIds);

            return(loader.LoadData());
        }
コード例 #7
0
 public LackScoreExporter(CourseCollection courses, IProgressUI progress)
 {
     _courses  = courses;
     _progress = progress;
 }
コード例 #8
0
        public void LoadCalculationData(IProgressUI progressUI)
        {
            _progress_ui = progressUI;
            _courses     = new CourseCollection();

            List <string> courseIds = new List <string>();

            foreach (CourseRecord each in JHSchool.Course.Instance.SelectedList)
            {
                courseIds.Add(each.ID);
            }

            CurrentStep = 1;
            ReportProgress("下載課程相關資料...", 0);
            CourseCollection courses = Course.GetCourses(courseIds.ToArray());

            if (_progress_ui.Cancellation)
            {
                return;
            }

            CurrentStep++;
            ReportProgress("下載評量相關資料...", 0);
            ExamTemplateCollection templates = ExamTemplate.GetExamTemplates();

            if (_progress_ui.Cancellation)
            {
                return;
            }

            TEIncludeCollection teincludes = TEInclude.GetTEIncludes();

            if (_progress_ui.Cancellation)
            {
                return;
            }

            CurrentStep++;
            SCAttendCollection scattends = SCAttend.GetSCAttends(_progress_ui, courseIds.ToArray());

            if (_progress_ui.Cancellation)
            {
                return;
            }

            CurrentStep++;
            SCETakeCollection scetakes = SCETake.GetSCETakes(_progress_ui, courseIds.ToArray());

            if (_progress_ui.Cancellation)
            {
                return;
            }

            //建立 ExamTemplate 的 TEInclude。
            CreateTemplateExamReference(templates, teincludes);

            //建立 Course 的 ExamTemplate。
            CreateCourseTemplateReference(courses, templates);

            //建立 Course 的 SCAttend。
            CreateCourseStudentTwoWayReference(courses, scattends);

            //建立 SCAttend  的 SCETake。
            CreateSCAttendSCETakeReference(scattends, scetakes);

            _courses = courses;
        }
コード例 #9
0
 public void SetProgressUI(IProgressUI progress, JobWeightTable weightTable)
 {
     _progress_ui  = progress;
     _weight_table = weightTable;
     RegisterJobs();
 }
コード例 #10
0
ファイル: MainForm.cs プロジェクト: soheilpro/Rhapsody
 public void StopProgress(IProgressUI progressUI)
 {
     Enabled = true;
     ((ProgressForm)progressUI).Close();
 }
コード例 #11
0
        public void LoadCalculationData(IProgressUI progressUI, IEnumerable <StudentRecord> students, int schoolYear, int semester)
        {
            _progress_ui = progressUI;
            _courses     = new CourseCollection();

            List <string> courseIds = new List <string>();

            //foreach (CourseRecord each in JHSchool.Course.Instance.SelectedList)
            //    courseIds.Add(each.ID);
            foreach (StudentRecord each in students)
            {
                foreach (CourseRecord attend_course in GetAttendCourses(each))
                {
                    if (attend_course.SchoolYear != schoolYear)
                    {
                        continue;
                    }
                    if (attend_course.Semester != semester)
                    {
                        continue;
                    }

                    if (!courseIds.Contains(attend_course.ID))
                    {
                        courseIds.Add(attend_course.ID);
                    }
                }
            }

            CurrentStep = 1;
            //ReportProgress("下載課程相關資料...", 0);
            CourseCollection courses = Course.GetCourses(courseIds.ToArray());

            if (_progress_ui.Cancellation)
            {
                return;
            }

            CurrentStep++;
            //ReportProgress("下載評量相關資料...", 0);
            ExamTemplateCollection templates = ExamTemplate.GetExamTemplates();

            if (_progress_ui.Cancellation)
            {
                return;
            }

            TEIncludeCollection teincludes = TEInclude.GetTEIncludes();

            if (_progress_ui.Cancellation)
            {
                return;
            }

            CurrentStep++;
            SCAttendCollection scattends = SCAttend.GetSCAttends(_progress_ui, courseIds.ToArray());

            if (_progress_ui.Cancellation)
            {
                return;
            }

            CurrentStep++;
            SCETakeCollection scetakes = SCETake.GetSCETakes(_progress_ui, courseIds.ToArray());

            if (_progress_ui.Cancellation)
            {
                return;
            }

            //建立 ExamTemplate 的 TEInclude。
            CreateTemplateExamReference(templates, teincludes);

            //建立 Course 的 ExamTemplate。
            CreateCourseTemplateReference(courses, templates);

            //建立 Course 的 SCAttend。
            CreateCourseStudentTwoWayReference(courses, scattends);

            //建立 SCAttend  的 SCETake。
            CreateSCAttendSCETakeReference(scattends, scetakes);

            _courses = courses;
        }