Ejemplo n.º 1
0
 public static void ClearLearningDomainScore(this IEnumerable <StudentScore> students, SemesterData semester)
 {
     foreach (StudentScore each in students)
     {
         if (each.SemestersScore.Contains(semester))
         {
             each.SemestersScore[semester].LearnDomainScore = null;
         }
     }
 }
        private void btnCalc_Click(object sender, EventArgs e)
        {
            if (_BackgroundWorker.IsBusy)
            {
                return;
            }

            // 因為成績已經處理所以移除
            //if (Program.Mode == ModuleMode.KaoHsiung)
            //{
            //    //因為平時評量儲存結構調整,98-1以前的科目成績不給算(包含98-1)
            //    SemesterData denySemesterData = new SemesterData(0, 98, 1);
            //    SemesterData selectedSemesterData = new SemesterData(0, intSchoolYear.Value, intSemester.Value);
            //    if (selectedSemesterData <= denySemesterData)
            //    {
            //        MsgBox.Show("因評量設定調整後尚未完成981「平時評量」及「文字評量」資料處理,故暫不開放981科目成績計算功能。\n若須重新計算,請與我們聯絡。");
            //        return;
            //    }
            //}

            // 103-1 與 之後的定期、平時計算比例不同。
            if (Program.Mode == ModuleMode.KaoHsiung)
            {
                //因為評量計算比例調整,提示使用者。
                SemesterData denySemesterData     = new SemesterData(0, 102, 2);
                SemesterData selectedSemesterData = new SemesterData(0, intSchoolYear.Value, intSemester.Value);
                if (selectedSemesterData <= denySemesterData)
                {
                    //MsgBox.Show("因評量計算比例在  103-1 之後有所調整,故暫不開放重新計算 102-2(含) 之前的成績。若須重新計算,請與我們聯絡。");
                    //return;

                    if (MsgBox.Show("103-1以前的學年度學期將採計50:50評量計算比例(現行制度為60:40),確認繼續?", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
                    {
                        return;
                    }
                }
            }

            DialogResult dr = MsgBox.Show("您確定要計算學生學期科目成績?", MessageBoxButtons.YesNo);

            if (dr == DialogResult.No)
            {
                return;
            }

            if (Control.ModifierKeys == Keys.Shift)
            {
                string msg = "您確定要刪掉本學期所有科目成績重算?";
                if (MsgBox.Show(msg, "密技", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    RecalculateAll = true;
                }
            }
            else
            {
                RecalculateAll = false;
            }

            SchoolYear = intSchoolYear.Value;
            Semester   = intSemester.Value;

            btnCalc.Enabled = false;
            _BackgroundWorker.RunWorkerAsync();
            Close();
        }
Ejemplo n.º 3
0
 public static void ClearSubjectScore(this IEnumerable <StudentScore> students, SemesterData semester)
 {
     foreach (StudentScore each in students)
     {
         if (each.SemestersScore.Contains(semester))
         {
             each.SemestersScore[semester].Subject.Clear();
         }
     }
 }