Ejemplo n.º 1
0
        public void InvokGraduationPlanUpdated(string id)
        {
            GraduationPlanInfo oldInfo = null;
            GraduationPlanInfo newInfo = null;

            if (GraduationPlan.GraduationPlan.Instance._Items.ContainsKey(id))
            {
                oldInfo = GraduationPlan.GraduationPlan.Instance._Items[id];
                DSResponse        resp     = QueryGraduationPlan.GetGraduationPlan(id);
                List <XmlElement> SortList = new List <XmlElement>();
                XmlElement        gPlan    = resp.GetContent().GetElement("GraduationPlan");
                if (gPlan != null)
                {
                    newInfo = new GraduationPlanInfo(gPlan);
                    GraduationPlan.GraduationPlan.Instance._Items[id] = newInfo;
                }
                else
                {
                    GraduationPlan.GraduationPlan.Instance._Items.Remove(id);
                }
            }
            if (GraduationPlanUpdated != null)
            {
                GraduationPlanUpdated.Invoke(this, new UpdateGraduationPlanEventArgs(oldInfo, newInfo));
            }
        }
Ejemplo n.º 2
0
 private void _BKWGraduationPlanLoader_DoWork(object sender, DoWorkEventArgs e)
 {
     _LoadGraduationPlanAgain = true;
     while (_LoadGraduationPlanAgain)
     {
         try
         {
             _LoadGraduationPlanAgain = false;
             _Items = new Dictionary <string, GraduationPlanInfo>();
             DSResponse        resp     = QueryGraduationPlan.GetGraduationPlan();
             List <XmlElement> SortList = new List <XmlElement>();
             foreach (XmlElement gPlan in resp.GetContent().GetElements("GraduationPlan"))
             {
                 SortList.Add(gPlan);
             }
             SortList.Sort(new GPlanXmlSorter());
             foreach (XmlElement gPlan in SortList)
             {
                 _Items.Add(gPlan.SelectSingleNode("@ID").InnerText, new GraduationPlanInfo(gPlan));
             }
         }
         catch (Exception exc)
         {
             SmartSchool.ExceptionHandler.BugReporter.ReportException(new Exception("取得課程規劃表資料時發生錯誤。", exc), false);
         }
     }
     _LoadingEvent.Set();
 }
Ejemplo n.º 3
0
        public GPLookup()
        {
            _items = new Dictionary <string, string>();

            XmlElement xmlRecords = QueryGraduationPlan.GetGraduationPlanList().GetContent().BaseElement;

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

                _items.Add(name, id);
            }
        }
Ejemplo n.º 4
0
 private void _BKWStudentReferenceLoader_DoWork(object sender, DoWorkEventArgs e)
 {
     _LoadStudentReferenceAgain = true;
     while (_LoadStudentReferenceAgain)
     {
         try
         {
             _LoadStudentReferenceAgain = false;
             _StudentReference          = new Dictionary <string, string>();
             _StudentReference          = QueryGraduationPlan.GetStudentReference();
         }
         catch (Exception exc)
         {
             SmartSchool.ExceptionHandler.BugReporter.ReportException(new Exception("取得學生使用課程規劃表資料時發生錯誤。", exc), false);
         }
     }
     _LoadingStudentReferenceEvent.Set();
 }
Ejemplo n.º 5
0
 private void _BKWCommonPlanLoader_DoWork(object sender, DoWorkEventArgs e)
 {
     _LoadCommonPlanAgain = true;
     while (_LoadCommonPlanAgain)
     {
         try
         {
             _LoadCommonPlanAgain = false;
             _CommonElement       = null;
             _CommonElement       = QueryGraduationPlan.GetCommon().GetContent().GetElement("GraduationPlan");
             if (_CommonElement == null)
             {
                 _CommonElement = new XmlDocument().CreateElement("GraduationPlan");
             }
         }
         catch (Exception exc)
         {
             SmartSchool.ExceptionHandler.BugReporter.ReportException(new Exception("取得學生使用課程規劃表資料時發生錯誤。", exc), false);
         }
     }
     _LoadingCommonEvent.Set();
 }