Exemplo n.º 1
0
        public int Execute(List<string> cmds)
        {
            FISCA.DSAClient.XmlHelper req = new FISCA.DSAClient.XmlHelper("<Request/>");

            foreach (string cmd in cmds)
                req.AddElement(".", "Command", cmd);

            //呼叫 Service。
            Envelope rsp = Connection.SendRequest("UDTService.DML.Command", new Envelope(req));

            return 0;
        }
        private void CallTransferInWS()
        {
            TransferInRecord record = Record;

            try
            {
                string contract = "StudentTransferHsinchuSpecial";
                string service  = "SyncTransferIn";

                SecurityToken token    = (DSAServices.DefaultDataSource.SecurityToken as SessionToken).OriginToken;
                Connection    conn     = DSAServices.DefaultDataSource.AsContract(contract, token);
                XElement      econtent = XElement.Parse(record.ModifiedContent);

                FISCA.DSAClient.XmlHelper req = new FISCA.DSAClient.XmlHelper("<Request/>");
                req.AddElement(".", "TargetSchool", GetSchoolCode());
                req.AddElement(".", "Writer", string.Format("{0}:{1}", DSAServices.AccessPoint, DSAServices.UserAccount));
                req.AddElement(".", "StudentID", econtent.XPathSelectElement("Student").ElementText("IDNumber"));
                req.AddElement(".", "StudentNumber", SRecord.StudentNumber);
                req.AddElement(".", "Grade", SRecord.Class.GradeYear + "");
                req.AddElement(".", "ClassName", SRecord.Class.Name.Substring(1));

                RTOut.WriteLine(req.XmlString);
                RTOut.WriteLine(conn.SendRequest(service, new Envelope(req)).XmlString);
            }
            catch (Exception ex)
            {
                RTOut.WriteError(ex);
            }
        }
        /// <summary>
        /// 取得學生學年度學期社團參與記錄
        /// </summary>
        static public FISCA.DSAClient.XmlHelper GetSCJoinRequest(string SchoolYear, string Semester, List <string> ClubNameList)
        {
            FISCA.DSAClient.XmlHelper _xml;
            _xml = new FISCA.DSAClient.XmlHelper("<Reqluest/>");
            _xml.AddElement("Field");
            _xml.AddElement("Field", "All");
            _xml.AddElement("Condition");

            if (!string.IsNullOrEmpty(SchoolYear) && !string.IsNullOrEmpty(Semester))
            {
                _xml.AddElement("Condition", "SchoolYear", SchoolYear);
                _xml.AddElement("Condition", "Semester", Semester);
                foreach (string each in ClubNameList)
                {
                    _xml.AddElement("Condition", "ClubName", each);
                }
            }

            return(_xml);
        }
Exemplo n.º 4
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();
        }