/// <summary> /// 得到一个对象实体 /// </summary> public System.Model.facility_stipple GetModel(int id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select id, name, no, referral, longitude, latitude, statuses, city1, city2, city3, pudate, isdel, img "); strSql.Append(" from facility_stipple "); strSql.Append(" where id=@id"); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4) }; parameters[0].Value = id; System.Model.facility_stipple model = new System.Model.facility_stipple(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["id"].ToString() != "") { model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } model.name = ds.Tables[0].Rows[0]["name"].ToString(); model.no = ds.Tables[0].Rows[0]["no"].ToString(); model.referral = ds.Tables[0].Rows[0]["referral"].ToString(); if (ds.Tables[0].Rows[0]["longitude"].ToString() != "") { model.longitude = decimal.Parse(ds.Tables[0].Rows[0]["longitude"].ToString()); } if (ds.Tables[0].Rows[0]["latitude"].ToString() != "") { model.latitude = decimal.Parse(ds.Tables[0].Rows[0]["latitude"].ToString()); } if (ds.Tables[0].Rows[0]["statuses"].ToString() != "") { model.statuses = int.Parse(ds.Tables[0].Rows[0]["statuses"].ToString()); } model.city1 = ds.Tables[0].Rows[0]["city1"].ToString(); model.city2 = ds.Tables[0].Rows[0]["city2"].ToString(); model.city3 = ds.Tables[0].Rows[0]["city3"].ToString(); if (ds.Tables[0].Rows[0]["pudate"].ToString() != "") { model.pudate = DateTime.Parse(ds.Tables[0].Rows[0]["pudate"].ToString()); } if (ds.Tables[0].Rows[0]["isdel"].ToString() != "") { model.isdel = int.Parse(ds.Tables[0].Rows[0]["isdel"].ToString()); } model.img = ds.Tables[0].Rows[0]["img"].ToString(); return(model); } else { return(null); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(System.Model.facility_stipple model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into facility_stipple("); strSql.Append("name,no,referral,longitude,latitude,statuses,city1,city2,city3,pudate,isdel,img"); strSql.Append(") values ("); strSql.Append("@name,@no,@referral,@longitude,@latitude,@statuses,@city1,@city2,@city3,@pudate,@isdel,@img"); strSql.Append(") "); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@name", SqlDbType.NVarChar, 50), new SqlParameter("@no", SqlDbType.NVarChar, 50), new SqlParameter("@referral", SqlDbType.NVarChar, 500), new SqlParameter("@longitude", SqlDbType.Decimal, 9), new SqlParameter("@latitude", SqlDbType.Decimal, 9), new SqlParameter("@statuses", SqlDbType.Int, 4), new SqlParameter("@city1", SqlDbType.NVarChar, 50), new SqlParameter("@city2", SqlDbType.NVarChar, 50), new SqlParameter("@city3", SqlDbType.NVarChar, 50), new SqlParameter("@pudate", SqlDbType.DateTime), new SqlParameter("@isdel", SqlDbType.Int, 4), new SqlParameter("@img", SqlDbType.NVarChar, 200) }; parameters[0].Value = model.name; parameters[1].Value = model.no; parameters[2].Value = model.referral; parameters[3].Value = model.longitude; parameters[4].Value = model.latitude; parameters[5].Value = model.statuses; parameters[6].Value = model.city1; parameters[7].Value = model.city2; parameters[8].Value = model.city3; parameters[9].Value = model.pudate; parameters[10].Value = model.isdel; parameters[11].Value = model.img; object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 获得数据列表 /// </summary> public List <System.Model.facility_stipple> DataTableToList(DataTable dt) { List <System.Model.facility_stipple> modelList = new List <System.Model.facility_stipple>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { System.Model.facility_stipple model; for (int n = 0; n < rowsCount; n++) { model = new System.Model.facility_stipple(); if (dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } model.name = dt.Rows[n]["name"].ToString(); model.no = dt.Rows[n]["no"].ToString(); model.referral = dt.Rows[n]["referral"].ToString(); if (dt.Rows[n]["longitude"].ToString() != "") { model.longitude = decimal.Parse(dt.Rows[n]["longitude"].ToString()); } if (dt.Rows[n]["latitude"].ToString() != "") { model.latitude = decimal.Parse(dt.Rows[n]["latitude"].ToString()); } if (dt.Rows[n]["statuses"].ToString() != "") { model.statuses = int.Parse(dt.Rows[n]["statuses"].ToString()); } model.city1 = dt.Rows[n]["city1"].ToString(); model.city2 = dt.Rows[n]["city2"].ToString(); model.city3 = dt.Rows[n]["city3"].ToString(); if (dt.Rows[n]["pudate"].ToString() != "") { model.pudate = DateTime.Parse(dt.Rows[n]["pudate"].ToString()); } if (dt.Rows[n]["isdel"].ToString() != "") { model.isdel = int.Parse(dt.Rows[n]["isdel"].ToString()); } model.img = dt.Rows[n]["img"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 返回结果 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string res = ""; JsonData jsonResult = new JsonData(); try { //结果类型 string resulttype = Request["resulttype"] != null?Utility.Helper.Checkstr(Request["resulttype"]) : ""; //结果 string result = Request["result"] != null?Utility.Helper.Checkstr(Request["result"]) : ""; //标识 string identify = Request["identify"] != null?Utility.Helper.Checkstr(Request["identify"]) : ""; //接口标识 string requestCode = Request["requetCode"] != null?Utility.Helper.Checkstr(Request["requetCode"]) : ""; //requestCode = Request.Form.ToString(); // //log.setlog("地址", Request.Url.ToString()); //log.setlog("地址", Request.RawUrl); #region 提供服务回调 if (!string.IsNullOrEmpty(resulttype) && !string.IsNullOrEmpty(result) && !string.IsNullOrEmpty(identify)) { log.setlog("服务回调", "resulttype:" + resulttype + " result:" + result + " identify:" + identify + " requestCode:" + requestCode); //标识 string resultNO = result; List <checkStatus> sd = publicData.orderlist; log.setlog("静态变量数据量", sd.Count.ToString()); try { if (sd.Count > 0) { sd = (from s in sd where s.identifying == requestCode select s).ToList(); if (sd.Count > 0) { checkStatus sd_0 = sd[0]; if (sd_0.types == 0) { #region 自检结果 string customId = sd_0.customId; System.Model.facility_port fp = _bll.fpbll.GetModel(sd_0.portid); System.Model.facility_stipple fs = new System.Model.facility_stipple(); System.Model.facility fa = new System.Model.facility(); if (resultNO == "2") //if (resultNO == "0") //if (true) { fa = _bll.fbll.GetModel(sd[0].facilityid); //查询网点 fs = _bll.fsbll.GetModel(fa.fid); //查询设备 折扣 System.Model.facility_type ftype = _bll.ftbll.GetModel(fa.types); //生成订单 string serialNumber = System.DateTime.Now.ToString("yyyyMMddHHmmss") + Utility.Helper.rnds(8); //折后价 decimal prices = ftype.price * ftype.discount; System.Model.order_info oi = new System.Model.order_info(); oi.customid = customId; oi.serialNumber = serialNumber; oi.discount = ftype.discount; oi.price = prices; oi.port = fp.id; oi.pudate = System.DateTime.Now; oi.statuses = 1; oi.facility = Utility.Helper.gerInt(fa.id); oi.duration = ftype.time; oi.stippleid = fs.id; oi.types = 1;//1快充 if (_bll.oibll.Add(oi) > 0) { //生成支付信息 System.Model.Member_Charge_Withdraw mcw = new System.Model.Member_Charge_Withdraw(); mcw.memberid = customId; mcw.moneyes = prices; mcw.serialNumber = serialNumber; mcw.paystatus = 1; mcw.statusname = "未支付"; //mcw.paytype = "";//支付方式 支付宝 微信 钱包 //paystatus 1 未支付 2已支付 //types 1订单 2充值 3...... mcw.types = 1; mcw.pudate = System.DateTime.Now; if (_bll.mcwbll.Add(mcw) > 0) { for (int i = 0; i < publicData.orderlist.Count; i++) { if (publicData.orderlist[i].identifying == requestCode) { publicData.orderlist[i].orderid = serialNumber; log.setlog("订单产生成功", publicData.orderlist[i].orderid); } } //jsonResult["res"] = (int)MyEnum.ResultEnum.成功; //jsonResult["msg"] = "下单成功"; //jsonResult["code"] = ""; // //jsonResult["stipplename"] = fs.name; //jsonResult["servertype"] = "快充"; //jsonResult["price"] = Math.Round(prices, 2).ToString(); //jsonResult["serialnumber"] = serialNumber;//订单号 } else { //jsonResult["res"] = (int)MyEnum.ResultEnum.失败; //jsonResult["msg"] = "错误"; //jsonResult["code"] = "下单失败"; } } else { //jsonResult["res"] = (int)MyEnum.ResultEnum.失败; //jsonResult["msg"] = "错误"; //jsonResult["code"] = "下单失败"; } } else { //错误 //添加自检错误记录 // System.Model.self_test st = new System.Model.self_test(); string name = ""; string typeno; switch (resultNO) { case "0": name = "正常"; typeno = "0"; break; case "2": name = "充电桩和充电枪运行正常"; typeno = "2"; break; case "3": name = "充电桩运行异常"; typeno = "3"; break; case "4": name = "充电枪运行异常"; typeno = "4"; break; case "5": name = "外网电压工作异常"; typeno = "5"; break; case "6": name = "电池工作不正常"; typeno = "6"; break; case "7": name = "充电枪与电池接触良"; typeno = "7"; break; default: name = "系统未知错误"; typeno = "xxxx"; break; } st.facility = Utility.Helper.gerInt(fa.id); st.isdispose = 0; st.port = Utility.Helper.gerInt(fp.fid); st.errortype = "1"; st.stipple = Utility.Helper.gerInt(fs.id); st.pudate = System.DateTime.Now; _bll.stbll.Add(st); //jsonResult["res"] = (int)MyEnum.ResultEnum.失败; //jsonResult["msg"] = "设备故障"; //jsonResult["code"] = "设备故障"; } #endregion } else if (sd_0.types == 1) { #region 充电是否开始 if (!string.IsNullOrEmpty(sd_0.orderid)) { //修改订单充电状态 //开始充电 string strwhere = " serialNumber='" + sd_0.orderid + "' "; List <System.Model.order_info> oilist = _bll.oibll.GetModelList(strwhere); if (oilist.Count == 1) { System.Model.order_info oi = oilist[0]; oi.statuses = 2;//充电中 _bll.oibll.Update(oi); } else { } } #endregion } else if (sd_0.types == 2) { #region 充电是否结束 if (!string.IsNullOrEmpty(sd_0.orderid)) { //修改订单充电状态 //结束充电 string strwhere = " serialNumber='" + sd_0.orderid + "' "; List <System.Model.order_info> oilist = _bll.oibll.GetModelList(strwhere); if (oilist.Count == 1) { System.Model.order_info oi = oilist[0]; oi.statuses = 3;//已完成充电 _bll.oibll.Update(oi); } else { } } #endregion } else if (sd_0.types == 3) { #region 系统故障类型 #endregion } else if (sd_0.types == 4) { #region 充电数据 #endregion } } } } catch (Exception ex) { log.setlog("错误", ex.Message); } jsonResult["res"] = (int)MyEnum.ResultEnum.成功; jsonResult["msg"] = ""; jsonResult["code"] = ""; } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = ""; jsonResult["code"] = "参数缺失"; } #endregion } catch (Exception ex) { jsonResult["result"] = (int)MyEnum.ResultEnum.系统错误; jsonResult["msg"] = "服务器繁忙,请稍后再试"; jsonResult["code"] = ex.Message; log.setlog("错误", ex.Message); } res = JsonMapper.ToJson(jsonResult); res = MyString.UnicodeToString(res); Response.Write(res); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(System.Model.facility_stipple model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update facility_stipple set "); strSql.Append(" name = @name , "); strSql.Append(" no = @no , "); strSql.Append(" referral = @referral , "); strSql.Append(" longitude = @longitude , "); strSql.Append(" latitude = @latitude , "); strSql.Append(" statuses = @statuses , "); strSql.Append(" city1 = @city1 , "); strSql.Append(" city2 = @city2 , "); strSql.Append(" city3 = @city3 , "); strSql.Append(" pudate = @pudate , "); strSql.Append(" isdel = @isdel , "); strSql.Append(" img = @img "); strSql.Append(" where id=@id "); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4), new SqlParameter("@name", SqlDbType.NVarChar, 50), new SqlParameter("@no", SqlDbType.NVarChar, 50), new SqlParameter("@referral", SqlDbType.NVarChar, 500), new SqlParameter("@longitude", SqlDbType.Decimal, 9), new SqlParameter("@latitude", SqlDbType.Decimal, 9), new SqlParameter("@statuses", SqlDbType.Int, 4), new SqlParameter("@city1", SqlDbType.NVarChar, 50), new SqlParameter("@city2", SqlDbType.NVarChar, 50), new SqlParameter("@city3", SqlDbType.NVarChar, 50), new SqlParameter("@pudate", SqlDbType.DateTime), new SqlParameter("@isdel", SqlDbType.Int, 4), new SqlParameter("@img", SqlDbType.NVarChar, 200) }; parameters[0].Value = model.id; parameters[1].Value = model.name; parameters[2].Value = model.no; parameters[3].Value = model.referral; parameters[4].Value = model.longitude; parameters[5].Value = model.latitude; parameters[6].Value = model.statuses; parameters[7].Value = model.city1; parameters[8].Value = model.city2; parameters[9].Value = model.city3; parameters[10].Value = model.pudate; parameters[11].Value = model.isdel; parameters[12].Value = model.img; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(System.Model.facility_stipple model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(System.Model.facility_stipple model) { return(dal.Add(model)); }
protected void btnBc_Click(object sender, EventArgs e) { try { string imgUrl = ""; HttpPostedFile hp = fileLogo.PostedFile; if (hp.FileName.ToString() != "") { string hz = hp.FileName.ToString().Substring(hp.FileName.ToString().LastIndexOf(".") + 1); if (hz == "jpg" || hz == "png") { string Filename1 = Guid.NewGuid().ToString() + "." + hz; String path = Server.MapPath("Upload/stipple/"); hp.SaveAs(Path.Combine(path, Filename1)); imgUrl = "/Upload/stipple/" + Filename1; } else { ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "Test", "alert('请选择jpg或png格式的图片');", true); return; } } else { imgUrl = hidImg.Value; } string id = Request.QueryString["id"]; if (!string.IsNullOrEmpty(id)) { System.Model.facility_stipple fs = _bll.fsbll.GetModel(Utility.Helper.gerInt(id)); if (fs != null) { fs.img = imgUrl; fs.city1 = this.city1.SelectedValue; fs.city2 = this.city2.SelectedValue; fs.city3 = this.city3.SelectedValue; fs.statuses = Utility.Helper.gerInt(this.ddlstatuses.SelectedValue); fs.name = this.txtname.Text; fs.latitude = Utility.Helper.gerDecimal(this.txtlatitude.Text); fs.longitude = Utility.Helper.gerDecimal(this.txtlongitude.Text); fs.referral = this.txtreferral.Text; if (_bll.fsbll.Update(fs)) { ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "Test", "alert('编辑成功!');window.location.href='admin_stipple.aspx';", true); } else { ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "Test", "alert('编辑失败!');window.location.href='admin_stipple.aspx';", true); } } } else { System.Model.facility_stipple fs = new System.Model.facility_stipple(); fs.img = imgUrl; fs.city1 = this.city1.SelectedValue; fs.city2 = this.city2.SelectedValue; fs.city3 = this.city3.SelectedValue; fs.statuses = Utility.Helper.gerInt(this.ddlstatuses.SelectedValue); fs.name = this.txtname.Text; fs.latitude = Utility.Helper.gerDecimal(this.txtlatitude.Text); fs.longitude = Utility.Helper.gerDecimal(this.txtlongitude.Text); fs.referral = this.txtreferral.Text; fs.no = ""; fs.isdel = 0; fs.pudate = System.DateTime.Now; if (_bll.fsbll.Add(fs) > 0) { ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "Test", "alert('添加成功!');window.location.href='admin_stipple.aspx';", true); } else { ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "Test", "alert('添加失败!');window.location.href='admin_stipple.aspx';", true); } } } catch { Response.Redirect(ConfigurationManager.AppSettings["VirturlPath"] + "/error500.aspx?menu1=2&menu2=4"); } }
//开始扫一扫 protected void Page_Load(object sender, EventArgs e) { //网点id //string stippleid = Request["stippleid"] != null ? Utility.Helper.Checkstr(Request["stippleid"]) : ""; //设备id //string facilityid = Request["facilityid"] != null ? Utility.Helper.Checkstr(Request["stippleid"]) : ""; //网点编号 //string stippleno = Request["stippleno"] != null ? Utility.Helper.Checkstr(Request["stippleno"]) : ""; //设备编号 //string facilityno = Request["facilityno"] != null ? Utility.Helper.Checkstr(Request["facilityno"]) : ""; //接口编号 //string portno = Request["portno"] != null ? Utility.Helper.Checkstr(Request["portno"]) : ""; if (!IsPostBack) { string res = ""; JsonData jsonResult = new JsonData(); try { //接口id string portid = Request["portid"] != null?Utility.Helper.Checkstr(Request["portid"]) : ""; //用户编号 string customId = _bll.getUserToke(Utility.Helper.gerString(Request["memberid"])); #region 扫一扫 if (!string.IsNullOrEmpty(customId)) { //充电中的 3天以内的订单 string strwhere = " customid='" + customId + "' and statuses=2 and pudate >DATEADD( DAY,-1,GETDATE()) "; List <System.Model.order_info> orlist = _bll.oibll.GetModelList(strwhere); //没有以上条件订单的用户可以下单 if (orlist.Count == 0) { //接口 System.Model.facility_port fp = new System.Model.facility_port(); //设备 System.Model.facility fa = new System.Model.facility(); //网点 System.Model.facility_stipple fs = new System.Model.facility_stipple(); strwhere = " toid='" + portid + "' and isdel=0 "; List <System.Model.facility_port> fplist = _bll.fpbll.GetModelList(strwhere); if (fplist.Count > 0) { fp = fplist[0]; #region 获取充电桩设备数据信息,验证 //正常 充电设备正常并且设备没有被使用 if (fp != null && fp.isEmploy == 0) { fa = _bll.fbll.GetModel(fp.fid); if (fa != null) { #region 检测设备是否正常 bool isUsable = false; //调用设备检测接口 var manager = new ApiManager(); string jsonstr = manager.GetChargingPileInfo(fa.identitycode); ChargingPileStatusResult jsond = JsonMapper.ToObject <ChargingPileStatusResult>(jsonstr); if (jsond != null) { List <RechargShotStatusResult> statuslist = jsond.RechargeShotStatus; statuslist = (from s in statuslist where s.Identity == fp.identitycode select s).ToList(); if (statuslist.Count > 0 && Convert.ToInt32(statuslist[0].Status) == Convert.ToInt32(RunningStatus.OnLine)) { #region 发送设备自检 //发送设备自检 var dic = new Dictionary <string, string>(); dic.Add("ShotIndentity", fp.identitycode); var parsStr = JsonConvert.SerializeObject(dic); var selfTestModel = new CommandPostViewModel(); selfTestModel.CommandName = "SelfTest"; selfTestModel.TargetIdentity = fa.identitycode; selfTestModel.Pars = parsStr; //添加标识 checkStatus cs = new checkStatus(); //自检编号 cs.identifying = manager.PostCommand(selfTestModel).Replace("\"", ""); //状态 cs.status = false; //类型 cs.types = 0; //是否产生订单 cs.orderid = ""; cs.datetime = System.DateTime.Now; cs.portid = fp.id; cs.porttoid = fp.toid; cs.facilityid = fp.fid; cs.customId = customId; //log.setlog("设备自检", cs.identifying); publicData.orderlist.Add(cs); isUsable = true; //等待回调 #endregion jsonResult["res"] = (int)MyEnum.ResultEnum.成功; jsonResult["identifying"] = cs.identifying; jsonResult["msg"] = "发送自检成功"; jsonResult["code"] = "发送自检成功"; } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "错误"; jsonResult["code"] = "自检失败"; } } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "错误"; jsonResult["code"] = "自检失败"; } #endregion //返回设备自检标示 #region 注释 //if (isUsable) //{ // //查询网点 // fs = _bll.fsbll.GetModel(fa.fid); // //查询设备 折扣 // System.Model.facility_type ftype = _bll.ftbll.GetModel(fa.types); // // //生成订单 // string serialNumber = System.DateTime.Now.ToString("yyyyMMddHHmmss") + Utility.Helper.rnds(8); // //折后价 // decimal prices = ftype.price * ftype.discount; // // System.Model.order_info oi = new System.Model.order_info(); // // oi.customid = customId; // oi.serialNumber = serialNumber; // oi.discount = ftype.discount; // // oi.price = prices; // // oi.port = fp.id; // oi.pudate = System.DateTime.Now; // oi.statuses = 1; // oi.facility = Utility.Helper.gerInt(fa.id); // oi.duration = ftype.time; // oi.stippleid = fs.id; // oi.types = 1;//1快充 // if (_bll.oibll.Add(oi) > 0) // { // //生成支付信息 // // System.Model.Member_Charge_Withdraw mcw = new System.Model.Member_Charge_Withdraw(); // // mcw.memberid = customId; // mcw.moneyes = prices; // mcw.serialNumber = serialNumber; // mcw.paystatus = 1; // mcw.statusname = "未支付"; // //mcw.paytype = "";//支付方式 支付宝 微信 钱包 // //paystatus 1 未支付 2已支付 // //types 1订单 2充值 3...... // mcw.types = 1; // mcw.pudate = System.DateTime.Now; // if (_bll.mcwbll.Add(mcw) > 0) // { // jsonResult["res"] = (int)MyEnum.ResultEnum.成功; // jsonResult["msg"] = "下单成功"; // jsonResult["code"] = ""; // // jsonResult["stipplename"] = fs.name; // jsonResult["servertype"] = "快充"; // jsonResult["price"] = Math.Round(prices, 2).ToString(); // jsonResult["serialnumber"] = serialNumber;//订单号 // } // else // { // jsonResult["res"] = (int)MyEnum.ResultEnum.失败; // jsonResult["msg"] = "错误"; // jsonResult["code"] = "下单失败"; // } // } // else // { // jsonResult["res"] = (int)MyEnum.ResultEnum.失败; // jsonResult["msg"] = "错误"; // jsonResult["code"] = "下单失败"; // } //} //else //{ // //错误 // //添加自检错误记录 // // // System.Model.self_test st = new System.Model.self_test(); // // st.ername = ""; // st.errortype = ""; // st.facility = Utility.Helper.gerInt(fa.id); // st.isdispose = 0; // st.port = Utility.Helper.gerInt(portid); // st.errortype = "1"; // st.stipple = Utility.Helper.gerInt(fs.id); // st.pudate = System.DateTime.Now; // _bll.stbll.Add(st); // // // jsonResult["res"] = (int)MyEnum.ResultEnum.失败; // jsonResult["msg"] = "设备故障"; // jsonResult["code"] = "设备故障"; //} #endregion } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "错误"; jsonResult["code"] = "自检失败"; } } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "设备故障或设备已被使用"; jsonResult["code"] = "设备故障或设备已被使用"; } #endregion //提示支付 } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "设备已不可用"; jsonResult["code"] = "未找到该设备信息"; } } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "用户有订单未完成"; jsonResult["code"] = ""; } } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "错误"; jsonResult["code"] = "参数有误"; } #endregion } catch (Exception ex) { jsonResult["res"] = (int)MyEnum.ResultEnum.系统错误; jsonResult["msg"] = "服务器繁忙,请稍后再试"; jsonResult["code"] = ex.Message; } res = JsonMapper.ToJson(jsonResult); res = MyString.UnicodeToString(res); Response.Write(res); } }