public void HandleCarLocation(CarLocation cl) { try { //Save Database // DBCarLocation db = new DBCarLocation(); //20160802 修改人:朱星汉 修改内容:速度字符串过长 cl.SD = Math.Round((Decimal)cl.SD, 2); IDBCarLocation db = DataAccess.DataAccess.GetDBCarLocation(); db.Add(cl); CarLocationManagerDelegateClient client = new CarLocationManagerDelegateClient(); client.addCarLocationCompleted += new EventHandler <addCarLocationCompletedEventArgs>(Service_Completed); CredentialSoapHeader header = new CredentialSoapHeader(); header.Username = SysParameters.AppAPIUsername; header.Password = SysParameters.AppAPIPassword; string strJson = ConvertModelToJson(cl); WebserviceUserState UserState = new WebserviceUserState(); UserState.TIMES = 1; UserState.MESSAGE = strJson; client.addCarLocationAsync(header, strJson, UserState); } catch (Exception ex) { LogHelper.WriteLog("", ex); } }
public void HandleCarStep(CarState cs) { try { //Save Database IDBCarState db = DataAccess.DataAccess.GetDBCarState(); db.Add(cs); CarStepManagerDelegateClient client = new CarStepManagerDelegateClient(); client.addCarStepCompleted += new EventHandler <addCarStepCompletedEventArgs>(Service_Completed); CredentialSoapHeader header = new CredentialSoapHeader(); header.Username = SysParameters.AppAPIUsername; header.Password = SysParameters.AppAPIPassword; string strJson = ConvertModelToJson(cs); WebserviceUserState UserState = new WebserviceUserState(); UserState.TIMES = 1; UserState.MESSAGE = strJson; //{"caseId":"a07aa295-e5f0-41bb-858d-277b1e3479ff","lsh":"2016061300000000005","sj":"2016-06-13 17:19:41","zt":"病人上车","reason":"","clid":"101","cccc":2} client.addCarStepAsync(header, strJson, UserState); } catch (Exception ex) { LogHelper.WriteLog("", ex); } }
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); } }
public void HandleCallError(HandleCallError hce) { try { //Save Database IDBHandleCallError db = DataAccess.DataAccess.GetDBHandleCallError(); db.Add(hce); CallErrorManagerDelegateClient client = new CallErrorManagerDelegateClient(); client.addCallErrorCompleted += new EventHandler <addCallErrorCompletedEventArgs>(Service_Completed); CredentialSoapHeader header = new CredentialSoapHeader(); header.Username = SysParameters.AppAPIUsername; header.Password = SysParameters.AppAPIPassword; string strJson = ConvertModelToJson(hce); WebserviceUserState UserState = new WebserviceUserState(); UserState.TIMES = 1; UserState.MESSAGE = strJson; client.addCallErrorAsync(header, strJson, UserState); } catch (Exception ex) { LogHelper.WriteLog("", ex); } }
/// <summary> /// 重发消息 /// </summary> /// <param name="UserState"></param> private void ReSendCarLocation(WebserviceUserState UserState) { try { Thread.Sleep(SysParameters.APIErrorReSendInterval * 1000); string strJson = UserState.MESSAGE; CarLocationManagerDelegateClient client = new CarLocationManagerDelegateClient(); client.addCarLocationCompleted += new EventHandler <addCarLocationCompletedEventArgs>(Service_Completed); CredentialSoapHeader header = new CredentialSoapHeader(); header.Username = SysParameters.AppAPIUsername; header.Password = SysParameters.AppAPIPassword; client.addCarLocationAsync(header, strJson, UserState); } catch (Exception ex) { LogHelper.WriteLog("", ex); } }
/// <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); } }