Exemplo n.º 1
0
        public ResponseAppResult AppGetCarInfoByCarno(Dictionary <string, string> inparams)
        {
            ResponseAppResult Result = null;

            if (!inparams.Keys.Contains("carno") || inparams["carno"] == "")
            {
                Result = new ResponseAppResult(ResState.ParamsImperfect, "缺少carno或carno为空!", null);
                return(Result);
            }


            try
            {
                string sysflag = inparams["sysflag"];
                string carno   = inparams["carno"];

                carinfo sdf = GetCarCID(sysflag, carno);
                if (sdf != null)
                {
                    Result = new ResponseAppResult(ResState.Success, "操作成功", sdf);
                }
                else
                {
                    Result = new ResponseAppResult(ResState.OperationFailed, "未查询到相关车辆", sdf);
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteError("AppGetCarInfoByCarno调用异常", ex);
                Result = new ResponseAppResult(ResState.OperationFailed, ex.Message, null);
            }
            return(Result);
        }
Exemplo n.º 2
0
        private carinfo GetCarCID(string sysflag, string carno)
        {
            carinfo      ci  = new carinfo();
            long         cid = -1;
            ComSqlHelper csh = new ComSqlHelper();

            SqlParameter[] Parameters = { new SqlParameter("@carno", carno) };
            DataTable      dt         = csh.FillDataSet(WebProc.GetAppSysflagKey(sysflag), WebProc.Proc("QWGProc_App_GetCarInfoByCarno"), Parameters).Tables[0];

            if (dt.Rows.Count > 0)
            {
                ci.cid   = long.Parse(dt.Rows[0]["CID"].ToString());
                ci.carno = dt.Rows[0]["CarNo"].ToString();
                ci.owner = dt.Rows[0]["CarOwnName"].ToString();
            }
            else
            {
                return(null);
            }
            return(ci);
        }