Example #1
0
        private void execute(string schoolYear, string semester, int weekNo, DateTime startDate, DateTime endDate)
        {
            // 1. 統計當週各班成績
            WeeklyStatsCalculator calOne = new WeeklyStatsCalculator(schoolYear, semester, weekNo, startDate, endDate);

            calOne.Execute();

            // 2. 計算各年級班排名
            WeeklyRankCalculator calTwo = new WeeklyRankCalculator(schoolYear, semester, weekNo, startDate, endDate);

            calTwo.Execute();

            // 3. 找出當週排名
            DataTable dt = DAO.WeeklyRank.GetWeekltRank(schoolYear, semester, weekNo);

            DialogResult result = MsgBox.Show("週排名已計算完成,確定產出排名報表?", "提醒", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                print(dt);
            }
        }
Example #2
0
        private void execute(string schoolYear, string semester, int weekNo, DateTime startDate, DateTime endDate, DoWorkEventArgs e)
        {
            this._bgw.ReportProgress(15);
            // 1. 統計當週各班成績
            WeeklyStatsCalculator calOne = new WeeklyStatsCalculator(schoolYear, semester, weekNo, startDate, endDate);

            calOne.Execute();
            this._bgw.ReportProgress(30);

            // 2. 計算各年級班排名
            WeeklyRankCalculator calTwo = new WeeklyRankCalculator(schoolYear, semester, weekNo, startDate, endDate);

            calTwo.Execute();
            this._bgw.ReportProgress(60);

            // 3. 找出當週排名
            DataTable dt = DAO.WeeklyRank.GetWeekltRank(schoolYear, semester, weekNo);

            this._bgw.ReportProgress(90);

            e.Result = dt;
        }