/// <summary> /// 设置激活 /// </summary> /// <param name="inparams">初始参数</param> /// <returns>成功结果</returns> public ResponseResult active(Dictionary <string, string> inparams) { ResponseResult Result = null; string uid = string.Empty; long cid = 0; long tno = 0; string vin = string.Empty; string energytype = string.Empty; int orderType = 0; string CarNo = string.Empty; string OrgNo = string.Empty; string Lockstatus = string.Empty; try { #region 取参数 if (!inparams.Keys.Contains("sid") || !inparams.Keys.Contains("sysuid") || !inparams.Keys.Contains("token") || !inparams.Keys.Contains("sysflag") || !inparams.Keys.Contains("uid") || !inparams.Keys.Contains("cid") || !inparams.Keys.Contains("tno") || !inparams.Keys.Contains("vin") || !inparams.Keys.Contains("energytype") || !inparams.Keys.Contains("orderType") || !inparams.Keys.Contains("CarNo") || !inparams.Keys.Contains("OrgNo") || !inparams.Keys.Contains("Lockstatus")) { Result = new ResponseResult(ResState.ParamsImperfect, "缺少参数", null); return(Result); } uid = inparams["uid"]; if (!string.IsNullOrWhiteSpace(inparams["cid"])) { cid = Convert.ToInt64(inparams["cid"]); } if (!string.IsNullOrWhiteSpace(inparams["tno"])) { tno = Convert.ToInt64(inparams["tno"]); } vin = inparams["vin"]; energytype = inparams["energytype"]; if (!inparams["orderType"].ToString().Equals(string.Empty)) { orderType = Convert.ToInt32(inparams["orderType"]); } CarNo = inparams["CarNo"]; OrgNo = inparams["OrgNo"]; Lockstatus = inparams["Lockstatus"]; #endregion 取参数 #region 调用WebService接口 WebGIS.WebGISService.WebGISServiceSoap soap = new WebGIS.WebGISService.WebGISServiceSoapClient(); WebGIS.WebGISService.XD_activateOrderRequest request = new WebGIS.WebGISService.XD_activateOrderRequest(); WebGIS.WebGISService.XD_activateOrderRequestBody requestBody = new WebGIS.WebGISService.XD_activateOrderRequestBody(); string basepath = HttpRuntime.AppDomainAppPath.ToString(); DataSet ds = new DataSet(); ds.ReadXml(basepath + "ALConfig.xml"); DataTable dt = ds.Tables[0]; string sysflag = dt.Rows[0]["WebServiceSysFlag"].ToString(); sysflag = sysflag.Replace("\r\n", "").Trim(); requestBody.sysflag = sysflag; requestBody.cid = cid; requestBody.tno = tno; requestBody.vin = vin; requestBody.energytype = energytype; requestBody.orderType = orderType; request.Body = requestBody; WebGIS.WebGISService.XD_activateOrderResponse response = soap.XD_activateOrder(request); WebGIS.WebGISService.XD_activateOrderResponseBody responseBody = response.Body; WebGIS.WebGISService.ResponseResult result = responseBody.XD_activateOrderResult; #endregion 调用WebService接口 #region 调用存储过程 if (result.state == 100) { string parameter = "设置激活状态为"; if (orderType == 0xAA) { parameter += "激活"; } else if (orderType == 0x55) { parameter += "关闭"; } sysflag = inparams["sysflag"]; //int iResult = daoSaveSysLog(sysflag, cid.ToString(), CarNo, OrgNo, uid, parameter, Lockstatus); Result = new ResponseResult(ResState.Success, result.msg, 1); } else { Result = new ResponseResult(ResState.OperationFailed, result.msg, result.result); } #endregion 调用存储过程 } catch (Exception ex) { Result = new ResponseResult(ResState.OperationFailed, ex.Message, ""); } return(Result); }
public XD_activateOrderResponse(WebGIS.WebGISService.XD_activateOrderResponseBody Body) { this.Body = Body; }