Exemplo n.º 1
0
        /// <summary>
        /// 设置参数
        /// </summary>
        /// <param name="inparams">初始参数</param>
        /// <returns>成功结果</returns>
        public ResponseResult set(Dictionary <string, string> inparams)
        {
            ResponseResult Result      = null;
            string         uid         = string.Empty;
            long           cid         = 0;
            long           tno         = 0;
            string         datevalue   = string.Empty;
            string         dayvalue    = string.Empty;
            string         minutevalue = string.Empty;
            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("datevalue") ||
                    !inparams.Keys.Contains("dayvalue") ||
                    !inparams.Keys.Contains("minutevalue") ||
                    !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"]);
                }
                datevalue   = inparams["datevalue"];
                dayvalue    = inparams["dayvalue"];
                minutevalue = inparams["minutevalue"];
                CarNo       = inparams["CarNo"];
                OrgNo       = inparams["OrgNo"];
                Lockstatus  = inparams["Lockstatus"];
                #endregion 取参数

                #region 调用WebService接口
                WebGIS.WebGISService.WebGISServiceSoap           soap        = new WebGIS.WebGISService.WebGISServiceSoapClient();
                WebGIS.WebGISService.XD_setParamOrderRequest     request     = new WebGIS.WebGISService.XD_setParamOrderRequest();
                WebGIS.WebGISService.XD_setParamOrderRequestBody requestBody = new WebGIS.WebGISService.XD_setParamOrderRequestBody();
                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.datevalue   = datevalue;
                requestBody.dayvalue    = dayvalue;
                requestBody.minutevalue = minutevalue;
                request.Body            = requestBody;
                WebGIS.WebGISService.XD_setParamOrderResponse     response     = soap.XD_setParamOrder(request);
                WebGIS.WebGISService.XD_setParamOrderResponseBody responseBody = response.Body;
                WebGIS.WebGISService.ResponseResult result = responseBody.XD_setParamOrderResult;
                #endregion 调用WebService接口

                #region 调用存储过程
                if (result.state == 100)
                {
                    int iMinuteValue = Convert.ToInt32(minutevalue);
                    iMinuteValue = iMinuteValue / 24 / 60;
                    string parameter = "设置" + "到期还款日为" + datevalue + ",还款到期日提前提醒天数" + dayvalue + ",无通讯连接最长连续时间为" + iMinuteValue + "天";
                    sysflag = inparams["sysflag"];
                    //int iResult = daoSaveSysLog(sysflag, cid.ToString(), CarNo, OrgNo, uid, parameter, Lockstatus);
                    Result = new ResponseResult(ResState.Success, result.msg, 0);
                }
                else
                {
                    Result = new ResponseResult(ResState.OperationFailed, result.msg, result.result);
                }
                #endregion 调用存储过程
            }
            catch (Exception ex)
            {
                Result = new ResponseResult(ResState.OperationFailed, ex.Message, "");
            }
            return(Result);
        }
Exemplo n.º 2
0
 public XD_setParamOrderRequest(WebGIS.WebGISService.XD_setParamOrderRequestBody Body)
 {
     this.Body = Body;
 }