Пример #1
0
        public void HandleCarInfo(SendCarInfo sci)
        {
            try
            {
                //Save Database
                //DBSendCarInfo db = new DBSendCarInfo();
                IDBSendCarInfo db = DataAccess.DataAccess.GetDBSendCarInfo();
                db.Add(sci);

                CarInfoManagerDelegateClient client = new CarInfoManagerDelegateClient();
                client.addCarInfoCompleted += new EventHandler <addCarInfoCompletedEventArgs>(Service_Completed);
                CredentialSoapHeader header = new CredentialSoapHeader();
                header.Username = SysParameters.AppAPIUsername;
                header.Password = SysParameters.AppAPIPassword;
                string strJson = ConvertModelToJson(sci);

                WebserviceUserState UserState = new WebserviceUserState();
                UserState.TIMES   = 1;
                UserState.MESSAGE = strJson;

                //{"driverName":"刘豫","doctorPhone":"13871887869","doctorName":"孙光辉","ccsj":"2016-06-13 17:00:09","ssdw":"孝感市中心医院","driverPhone":"13871888610","caseId":"a07aa295-e5f0-41bb-858d-277b1e3479ff","lsh":"2016061300000000005","cph":"鄂K06772","clid":"101","cccc":2}
                client.addCarInfoAsync(header, strJson, UserState);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("", ex);
            }
        }
Пример #2
0
        /// <summary>
        /// 重发消息
        /// </summary>
        /// <param name="UserState"></param>
        private void ReSendCarInfo(WebserviceUserState UserState)
        {
            try
            {
                Thread.Sleep(SysParameters.APIErrorReSendInterval * 1000);

                string strJson = UserState.MESSAGE;

                CarInfoManagerDelegateClient client = new CarInfoManagerDelegateClient();
                client.addCarInfoCompleted += new EventHandler <addCarInfoCompletedEventArgs>(Service_Completed);
                CredentialSoapHeader header = new CredentialSoapHeader();
                header.Username = SysParameters.AppAPIUsername;
                header.Password = SysParameters.AppAPIPassword;

                //{"driverName":"刘豫","doctorPhone":"13871887869","doctorName":"孙光辉","ccsj":"2016-06-13 17:00:09","ssdw":"孝感市中心医院","driverPhone":"13871888610","caseId":"a07aa295-e5f0-41bb-858d-277b1e3479ff","lsh":"2016061300000000005","cph":"鄂K06772","clid":"101","cccc":2}
                client.addCarInfoAsync(header, strJson, UserState);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("", ex);
            }
        }