private void button1_Click(object sender, EventArgs e)
        {
            StudentScore.SetClassMapping();

            JHClassRecord cls = JHClass.SelectByID("24");//正興 301 班。

            txtMsg.Text = string.Empty;
            txtMsg.AppendText("計算班級:" + cls.Name + "\n");

            ThreadPool.QueueUserWorkItem(new WaitCallback(ReadAttendScore), cls);
        }
        private void SubjectScoreCalculate_Load(object sender, EventArgs e)
        {
            Program.ScoreTextMap.Clear();
            Program.ScoreValueMap.Clear();
            #region 取得評量成績缺考暨免試設定
            Framework.ConfigData cd = JHSchool.School.Configuration["評量成績缺考暨免試設定"];
            if (!string.IsNullOrEmpty(cd["評量成績缺考暨免試設定"]))
            {
                XmlElement element = Framework.XmlHelper.LoadXml(cd["評量成績缺考暨免試設定"]);

                foreach (XmlElement each in element.SelectNodes("Setting"))
                {
                    var     UseText          = each.SelectSingleNode("UseText").InnerText;
                    var     AllowCalculation = bool.Parse(each.SelectSingleNode("AllowCalculation").InnerText);
                    decimal Score;
                    decimal.TryParse(each.SelectSingleNode("Score").InnerText, out Score);
                    var Active   = bool.Parse(each.SelectSingleNode("Active").InnerText);
                    var UseValue = decimal.Parse(each.SelectSingleNode("UseValue").InnerText);

                    if (Active)
                    {
                        if (!Program.ScoreTextMap.ContainsKey(UseText))
                        {
                            Program.ScoreTextMap.Add(UseText, new ScoreStruct.ScoreMap
                            {
                                UseText          = UseText,          //「缺」或「免」
                                AllowCalculation = AllowCalculation, //是否計算成績
                                Score            = Score,            //計算成績時,應以多少分來計算
                                Active           = Active,           //此設定是否啟用
                                UseValue         = UseValue,         //代表「缺」或「免」的負數
                            });
                        }
                        if (!Program.ScoreValueMap.ContainsKey(UseValue))
                        {
                            Program.ScoreValueMap.Add(UseValue, new ScoreStruct.ScoreMap
                            {
                                UseText          = UseText,
                                AllowCalculation = AllowCalculation,
                                Score            = Score,
                                Active           = Active,
                                UseValue         = UseValue,
                            });
                        }
                    }
                }
            }
            #endregion
            Util.SetSemesterDefaultItems(intSchoolYear, intSemester);
            StudentScore.SetClassMapping();
        }
        private void DomainScoreCalculateByGradeyear_Load(object sender, EventArgs e)
        {
            Util.SetSemesterDefaultItems(intSchoolYear, intSemester);

            StudentScore.SetClassMapping(); //裡面會對 Class 做 SelectAll 動作。

            int min = 9, max = 1;

            foreach (JHClassRecord each in JHClass.SelectAll())
            {
                if (!each.GradeYear.HasValue)
                {
                    continue;
                }

                min = Math.Min(each.GradeYear.Value, min);
                max = Math.Max(each.GradeYear.Value, max);
            }
            intGradeyear.MinValue = min;
            intGradeyear.MaxValue = max;
            intGradeyear.Value    = min;
        }
 private void DomainScoreCalculate_Load(object sender, EventArgs e)
 {
     Util.SetSemesterDefaultItems(intSchoolYear, intSemester);
     StudentScore.SetClassMapping();
 }
 private void DomainScoreCalculate_Load(object sender, EventArgs e)
 {
     StudentScore.SetClassMapping();
 }