コード例 #1
0
        private XmlSendTask GenerateSendMOXml()
        {
            if (this.ClientCodeRelationID == null)
            {
                return(null);
            }

            if (!this.ClientCodeRelationID.SyncData || this.ClientCodeRelationID.SyncDataSetting == null)
            {
                return(null);
            }

            if (!(this.ClientCodeRelationID.SyncDataSetting.SycnMO.HasValue && this.ClientCodeRelationID.SyncDataSetting.SycnMO.Value))
            {
                return(null);
            }

            XmlSendTask urlSendTask = new XmlSendTask();

            urlSendTask.RecordID   = this.Id;
            urlSendTask.OkMessage  = this.ClientCodeRelationID.SyncDataSetting.SycnMOOkMessage;
            urlSendTask.SendUrl    = this.ClientCodeRelationID.SyncDataSetting.SycnMOUrl;
            urlSendTask.XmlContent = this.GenerateSendMOXmlContent();

            return(urlSendTask);
        }
コード例 #2
0
        public void SycnToClient()
        {
            if (this.ClientCodeRelationID == null)
            {
                return;
            }

            if (this.ClientCodeRelationID.SyncDataSetting == null)
            {
                return;
            }

            if (this.ClientCodeRelationID.SyncDataSetting.SyncType == "xmlpost")
            {
                if (!this.IsStatOK && this.IsSycnToClient)
                {
                    XmlSendTask sendTask = this.GenerateSendMOXml();

                    if (sendTask != null)
                    {
                        sendTask.RecordID = this.Id;
                        ThreadPool.QueueUserWorkItem(XmlSender.SendRequest, sendTask);
                    }
                }
                else if (this.IsStatOK && this.IsSycnToClient)
                {
                    XmlSendTask sendTask = this.GenerateSendMRXml();

                    if (sendTask != null)
                    {
                        sendTask.RecordID = this.Id;
                        ThreadPool.QueueUserWorkItem(XmlSender.SendRequest, sendTask);
                    }
                }

                return;
            }
            else if (this.ClientCodeRelationID.SyncDataSetting.SyncType == "httpget")
            {
                if (this.IsStatOK && this.IsSycnToClient && this.ClientCodeRelationID != null)
                {
                    UrlSendTask sendTask = this.GenerateSendMOUrl();

                    if (sendTask != null)
                    {
                        sendTask.RecordID = this.Id;
                        ThreadPool.QueueUserWorkItem(UrlSender.SendRequest, sendTask);
                    }
                }
            }
        }