Exemplo n.º 1
0
        /// <summary>
        /// 取得 ischool 的學生基本資料清單
        /// </summary>
        /// <returns></returns>
        private bool GetDSAStudents()
        {
            bool isPass = JudgetDSAConnected();
            LogUtil.LogToTransferSummary(Constants.STEP_SyncData, "開始讀取 ischool 的『學生資料』。", isPass);
            try
            {
                dsaStuds = new Dictionary<string, string>();
                FISCA.DSAClient.Envelope resp = dsaCn.SendRequest(Constants.DSAServiceName_GetStudentList,
                                                                  new FISCA.DSAClient.Envelope());
                FISCA.DSAClient.XmlHelper helper = new FISCA.DSAClient.XmlHelper(resp.Body);
                foreach (XmlElement elm in helper.GetElements("Student"))
                {
                    string studID = Util.GetNodeValue(elm, "ID");
                    string studNo = Util.GetNodeValue(elm, "StudentNumber").ToUpper();
                    if (!dsaStuds.ContainsKey(studNo.ToUpper()))
                        dsaStuds.Add(studNo.ToUpper(), studID);
                }
                LogUtil.LogToTransferSummary(Constants.STEP_SyncData, string.Format("成功讀取 {0} 筆 ischool 的『學生資料』。",dsaStuds.Count.ToString()), isPass);
            }
            catch (Exception ex)
            {
                LogUtil.LogToTransferSummary(Constants.STEP_SyncData, "讀取 ischool『學生資料』時發生錯誤!" + ex.Message , isPass);
                isPass = false;
            }

            return isPass;
        }
Exemplo n.º 2
0
        private int TagUseCount(string tagId)
        {
            XHelper xreq = new XHelper("<Request/>");
            xreq.AddElement("Field");
            xreq.AddElement("Field", "ID");
            xreq.AddElement("Field", EntityIdField);
            xreq.AddElement("Condition");
            xreq.AddElement("Condition", "TagID", tagId);

            Envelope rsp = DSAServices.DefaultDataSource.SendRequest(CounterService, new Envelope(xreq));
            XHelper xrsp = new XHelper(rsp.Body);

            return xrsp.GetElements("Tag").Count();
        }
Exemplo n.º 3
0
 /// <summary>
 /// 取得 ischool 的系所組別清單
 /// </summary>
 /// <returns></returns>
 private bool GetDeptGroups()
 {
     bool isPass = JudgetDSAConnected();
     LogUtil.LogToTransferSummary(Constants.STEP_SyncData, "開始讀取 ischool 的『系所組別』。", isPass);
     try
     {
         dsaDeptGrps = new Dictionary<string, string>();
         FISCA.DSAClient.Envelope resp = dsaCn.SendRequest(Constants.DSAServiceName_GetDeptGroupList,
                                                           new FISCA.DSAClient.Envelope());
         FISCA.DSAClient.XmlHelper helper = new FISCA.DSAClient.XmlHelper(resp.Body);
         foreach (XmlElement elm in helper.GetElements("DeptGroup"))
         {
             string id = Util.GetNodeValue(elm, "ID");
             string code = Util.GetNodeValue(elm, "Code");
             if (!this.dsaDeptGrps.ContainsKey(code))
                 dsaDeptGrps.Add(code, id);
         }
         LogUtil.LogToTransferSummary(Constants.STEP_SyncData, string.Format("成功讀取 {0} 筆 ischool 的『系所組別』。", this.dsaDeptGrps.Keys.Count.ToString()), isPass);
     }
     catch (Exception ex)
     {
         LogUtil.LogToTransferSummary(Constants.STEP_SyncData, "讀取 ischool『系所組別』時發生錯誤!" + ex.Message, isPass);
         isPass = false;
     }
     return isPass;
 }