Пример #1
0
        internal void Load()
        {
            ConfigData cd = K12.Data.School.Configuration[Global.ReportName];

            #region 讀取使用者的節權設定
            if (cd.Contains("節權設定") && !string.IsNullOrEmpty(cd["節權設定"]))
            {
                XmlElement config = K12.Data.XmlHelper.LoadXml(cd["節權設定"]);
                PrintPeriod = bool.Parse(config.SelectSingleNode("Period").InnerText);
                PrintCredit = bool.Parse(config.SelectSingleNode("Credit").InnerText);
            }
            else
            {
                PrintPeriod = false;
                PrintCredit = false;
            }
            #endregion

            #region 讀取使用者的假別設定
            if (cd.Contains("假別設定") && !string.IsNullOrEmpty(cd["假別設定"]))
            {
                XmlElement config = K12.Data.XmlHelper.LoadXml(cd["假別設定"]);
                foreach (XmlElement type in config.SelectNodes("Type"))
                {
                    string typeName = type.GetAttribute("Text");
                    if (!PrintTypes.ContainsKey(typeName))
                    {
                        PrintTypes.Add(typeName, new List <string>());
                    }

                    foreach (XmlElement absence in type.SelectNodes("Absence"))
                    {
                        string absenceName = absence.GetAttribute("Text");
                        if (!PrintTypes[typeName].Contains(absenceName))
                        {
                            PrintTypes[typeName].Add(absenceName);
                        }
                    }
                }
            }
            #endregion

            #region 讀取使用者的領域科目設定
            if (cd.Contains("領域科目設定") && !string.IsNullOrEmpty(cd["領域科目設定"]))
            {
                XmlElement xml        = K12.Data.XmlHelper.LoadXml(cd["領域科目設定"]);
                XmlElement staticNode = (XmlElement)xml.SelectSingleNode("Static");
                if (staticNode != null)
                {
                    try
                    {
                        DomainSubjectSetup = (DomainSubjectSetup)Enum.Parse(DomainSubjectSetup.GetType(), staticNode.InnerText, true);
                    }
                    catch (Exception)
                    {
                    }
                }
            }
            #endregion
        }
Пример #2
0
        public void Load()
        {
            ConfigData cd = K12.Data.School.Configuration[_name];

            #region 假別設定
            if (cd.Contains("假別設定") && !string.IsNullOrEmpty(cd["假別設定"]))
            {
                XmlElement config = K12.Data.XmlHelper.LoadXml(cd["假別設定"]);
                foreach (XmlElement type in config.SelectNodes("Type"))
                {
                    string typeName = type.GetAttribute("Text");
                    if (!PrintTypes.ContainsKey(typeName))
                    {
                        PrintTypes.Add(typeName, new List <string>());
                    }

                    foreach (XmlElement absence in type.SelectNodes("Absence"))
                    {
                        string absenceName = absence.GetAttribute("Text");
                        if (!PrintTypes[typeName].Contains(absenceName))
                        {
                            PrintTypes[typeName].Add(absenceName);
                        }
                    }
                }
            }
            #endregion

            _asWithExam.Clear();
            foreach (JHAEIncludeRecord ae in JHAEInclude.SelectAll())
            {
                if (ae.RefExamID == Exam.ID)
                {
                    if (!_asWithExam.Contains(ae.RefAssessmentSetupID))
                    {
                        _asWithExam.Add(ae.RefAssessmentSetupID);
                    }
                }
            }


            // 評分樣板對照
            aeExamName.Clear();
            foreach (JHAEIncludeRecord ae in JHAEInclude.SelectAll())
            {
                if (aeExamName.ContainsKey(ae.RefAssessmentSetupID))
                {
                    if (!aeExamName[ae.RefAssessmentSetupID].Contains(ae.ExamName))
                    {
                        aeExamName[ae.RefAssessmentSetupID].Add(ae.ExamName);
                    }
                }
                else
                {
                    List <string> exList = new List <string>();
                    exList.Add(ae.ExamName);
                    aeExamName.Add(ae.RefAssessmentSetupID, exList);
                }
            }
        }