protected override void OnActive()
        {
            //MotherForm.SetWaitCursor();
            _MoralConductElement = QueryScoreCalcRule.GetMoralConductCalcRule();
            if (_MoralConductElement == null)
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml("<MoralConductScoreCalcRule/>");
                _MoralConductElement = doc.DocumentElement;
            }
            DSXmlHelper helper = new DSXmlHelper(_MoralConductElement);

            foreach (IMoralConductInstance item in _Instances)
            {
                item.SetSource(helper.GetElement(item.XPath));
                item.GetDependenceData();

                if (!item.IsValidate)
                {
                    SetWarring(item, (GroupPanel)((Control)item).Parent);
                }
                item.IsValidateChanged += new EventHandler(item_IsValidateChanged);
            }
            //MotherForm.ResetWaitCursor();
        }
Ejemplo n.º 2
0
        protected override Dictionary <string, ScoreCalcRuleRecord> GetData(IEnumerable <string> primaryKeys)
        {
            Dictionary <string, ScoreCalcRuleRecord> records = new Dictionary <string, ScoreCalcRuleRecord>();

            foreach (ScoreCalcRuleRecord each in QueryScoreCalcRule.GetScoreCalcRules(primaryKeys))
            {
                records.Add(each.ID, each);
            }

            return(records);
        }
Ejemplo n.º 3
0
        protected override Dictionary <string, ScoreCalcRuleRecord> GetAllData()
        {
            Dictionary <string, ScoreCalcRuleRecord> records = new Dictionary <string, ScoreCalcRuleRecord>();

            foreach (ScoreCalcRuleRecord each in QueryScoreCalcRule.GetAllScoreCalcRules())
            {
                records.Add(each.ID, each);
            }

            return(records);
        }
Ejemplo n.º 4
0
        public SCRLookup()
        {
            _items = new Dictionary <string, string>();

            XmlElement xmlRecords = QueryScoreCalcRule.GetScoreCalcRuleList().GetContent().BaseElement;

            foreach (XmlElement each in xmlRecords.SelectNodes("ScoreCalcRule"))
            {
                string name = each.SelectSingleNode("Name").InnerText;
                string id   = each.GetAttribute("ID");

                _items.Add(name, id);
            }
        }
Ejemplo n.º 5
0
 void _BGWStudentReferenceLoader_DoWork(object sender, DoWorkEventArgs e)
 {
     _LoadStudentReferenceAgain = true;
     while (_LoadStudentReferenceAgain)
     {
         try
         {
             _LoadStudentReferenceAgain = false;
             _StudentReference          = new Dictionary <string, string>();
             _StudentReference          = QueryScoreCalcRule.GetStudentReference();
         }
         catch (Exception exc)
         {
             SmartSchool.ExceptionHandler.BugReporter.ReportException(new Exception("取得學生採用成績計算規則資料時發生錯誤。", exc), false);
         }
     }
     _LoadingStudentReferenceEvent.Set();
 }
Ejemplo n.º 6
0
 void _BGWScoreCalcRuleLoader_DoWork(object sender, DoWorkEventArgs e)
 {
     _LoadScoreCalcRuleAgain = true;
     while (_LoadScoreCalcRuleAgain)
     {
         try
         {
             _LoadScoreCalcRuleAgain = false;
             _Items = new Dictionary <string, ScoreCalcRuleInfo>();
             DSResponse resp = QueryScoreCalcRule.GetList();
             foreach (XmlElement scr in resp.GetContent().GetElements("ScoreCalcRule"))
             {
                 _Items.Add(scr.SelectSingleNode("@ID").InnerText, new ScoreCalcRuleInfo(scr));
             }
         }
         catch (Exception exc)
         {
             SmartSchool.ExceptionHandler.BugReporter.ReportException(new Exception("取得成績計算規則資料時發生錯誤。", exc), false);
         }
     }
     _LoadingEvent.Set();
 }
Ejemplo n.º 7
0
        public AngelDemonComputer()
        {
            //取得德行成績計算規則
            _MoralConductElement = QueryScoreCalcRule.GetMoralConductCalcRule();
            if (_MoralConductElement != null)
            {
                _MoralConductHelper = new DSXmlHelper(_MoralConductElement);
            }
            else
            {
                _MoralConductHelper = new DSXmlHelper();
            }
            #region 取得記分缺曠項目

            #region 取得節次類別與缺曠對照表
            List <string> periodList  = new List <string>();
            List <string> absenceList = new List <string>();

            //取得對照表並且對照出節次->類別的清單(99/11/24 by dylan)
            periodDic.Clear();

            //取得節次對照表
            foreach (XmlElement var in SmartSchool.Feature.Basic.Config.GetPeriodList().GetContent().GetElements("Period"))
            {
                string name = var.GetAttribute("Type");
                if (!periodList.Contains(name))
                {
                    periodList.Add(name);
                }

                //取得對照表並且對照出節次->類別的清單(99/11/24 by dylan)
                if (!periodDic.ContainsKey(var.GetAttribute("Name")))
                {
                    periodDic.Add(var.GetAttribute("Name"), var.GetAttribute("Type"));
                }
            }
            //取得假別對照表
            foreach (XmlElement var in SmartSchool.Feature.Basic.Config.GetAbsenceList().GetContent().GetElements("Absence"))
            {
                //假別清單
                string name = var.GetAttribute("Name");
                if (!absenceList.Contains(name))
                {
                    absenceList.Add(name);
                }
                //建立不影響全勤清單
                bool noabsence;
                if (bool.TryParse(var.GetAttribute("Noabsence"), out noabsence) && noabsence && !_NoabsenceList.Contains(name))
                {
                    _NoabsenceList.Add(name);
                }
            }
            #endregion
            _UsefulPeriodAbsences = new List <UsefulPeriodAbsence>();
            foreach (XmlElement element in _MoralConductHelper.GetElements("PeriodAbsenceCalcRule/Rule"))
            {
                string  absence = element.GetAttribute("Absence");
                string  period  = element.GetAttribute("Period");
                decimal subtract;
                decimal.TryParse(element.GetAttribute("Subtract"), out subtract);
                int aggregated;
                int.TryParse(element.GetAttribute("Aggregated"), out aggregated);
                if (aggregated > 0 && subtract > 0 && periodList.Contains(period) && absenceList.Contains(absence))
                {
                    _UsefulPeriodAbsences.Add(new UsefulPeriodAbsence(absence, period, subtract, aggregated));
                }
            }
            #endregion

            SystemInformation.getField("Degree");
            _degreeList = (Dictionary <string, decimal>)SystemInformation.Fields["Degree"];
        }