/// <summary> /// 增加一条数据 /// </summary> public void Add(System.Model.V_order_details model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into V_order_details("); strSql.Append("id,duration,ftype,portno,fno,phone,sname,serialNumber,facility,port,price,discount,customid,pudate,paydate,paystatus,types,typename,ctype"); strSql.Append(") values ("); strSql.Append("@id,@duration,@ftype,@portno,@fno,@phone,@sname,@serialNumber,@facility,@port,@price,@discount,@customid,@pudate,@paydate,@paystatus,@types,@typename,@ctype"); strSql.Append(") "); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4), new SqlParameter("@duration", SqlDbType.Int, 4), new SqlParameter("@ftype", SqlDbType.NVarChar, 50), new SqlParameter("@portno", SqlDbType.NVarChar, 50), new SqlParameter("@fno", SqlDbType.NVarChar, 50), new SqlParameter("@phone", SqlDbType.NVarChar, 50), new SqlParameter("@sname", SqlDbType.NVarChar, 50), new SqlParameter("@serialNumber", SqlDbType.NVarChar, 200), new SqlParameter("@facility", SqlDbType.Int, 4), new SqlParameter("@port", SqlDbType.Int, 4), new SqlParameter("@price", SqlDbType.Money, 8), new SqlParameter("@discount", SqlDbType.Float, 8), new SqlParameter("@customid", SqlDbType.NVarChar, 50), new SqlParameter("@pudate", SqlDbType.DateTime), new SqlParameter("@paydate", SqlDbType.NVarChar, 50), new SqlParameter("@paystatus", SqlDbType.Int, 4), new SqlParameter("@types", SqlDbType.Int, 4), new SqlParameter("@typename", SqlDbType.NVarChar, 50), new SqlParameter("@ctype", SqlDbType.Int, 4) }; parameters[0].Value = model.id; parameters[1].Value = model.duration; parameters[2].Value = model.ftype; parameters[3].Value = model.portno; parameters[4].Value = model.fno; parameters[5].Value = model.phone; parameters[6].Value = model.sname; parameters[7].Value = model.serialNumber; parameters[8].Value = model.facility; parameters[9].Value = model.port; parameters[10].Value = model.price; parameters[11].Value = model.discount; parameters[12].Value = model.customid; parameters[13].Value = model.pudate; parameters[14].Value = model.paydate; parameters[15].Value = model.paystatus; parameters[16].Value = model.types; parameters[17].Value = model.typename; parameters[18].Value = model.ctype; DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { main_menu.menu1 = "6"; if (RolePermissions("5001") == false) { Response.Write("<script language='javascript'>window.location.href='errorQx.aspx?menu1=2&menu2=4';</script>"); } else { string id = Request["id"] != null?Utility.Helper.Checkstr(Request["id"]) : ""; string strwhere = " serialNumber='" + id + "' "; List <System.Model.V_order_details> sqlist = _bll.vobll.GetModelList(strwhere); if (sqlist.Count > 0) { System.Model.V_order_details sq = sqlist[0]; this.duration_p.InnerText = sq.duration.ToString() + "分钟"; this.ftype_p.InnerText = sq.ftype.ToString(); this.fno_p.InnerText = sq.fno.ToString(); this.phone_p.InnerText = sq.phone.ToString(); this.sname_p.InnerText = sq.sname.ToString(); this.serialNumber_p.InnerText = sq.serialNumber.ToString(); this.price_p.InnerText = sq.price.ToString("0.00") + "元"; this.discount_p.InnerText = sq.discount.ToString(); this.pudate_p.InnerText = sq.pudate.ToString(); this.paystatus_p.InnerText = getpaystatic(sq.paystatus.ToString()); this.typename_p.InnerText = sq.typename.ToString(); } else { } } } }
/// <summary> /// 得到一个对象实体 /// </summary> public System.Model.V_order_details GetModel() { StringBuilder strSql = new StringBuilder(); strSql.Append("select id, duration, ftype, portno, fno, phone, sname, serialNumber, facility, port, price, discount, customid, pudate, paydate, paystatus, types, typename, ctype "); strSql.Append(" from V_order_details "); strSql.Append(" where "); SqlParameter[] parameters = { }; System.Model.V_order_details model = new System.Model.V_order_details(); 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()); } if (ds.Tables[0].Rows[0]["duration"].ToString() != "") { model.duration = int.Parse(ds.Tables[0].Rows[0]["duration"].ToString()); } model.ftype = ds.Tables[0].Rows[0]["ftype"].ToString(); model.portno = ds.Tables[0].Rows[0]["portno"].ToString(); model.fno = ds.Tables[0].Rows[0]["fno"].ToString(); model.phone = ds.Tables[0].Rows[0]["phone"].ToString(); model.sname = ds.Tables[0].Rows[0]["sname"].ToString(); model.serialNumber = ds.Tables[0].Rows[0]["serialNumber"].ToString(); if (ds.Tables[0].Rows[0]["facility"].ToString() != "") { model.facility = int.Parse(ds.Tables[0].Rows[0]["facility"].ToString()); } if (ds.Tables[0].Rows[0]["port"].ToString() != "") { model.port = int.Parse(ds.Tables[0].Rows[0]["port"].ToString()); } if (ds.Tables[0].Rows[0]["price"].ToString() != "") { model.price = decimal.Parse(ds.Tables[0].Rows[0]["price"].ToString()); } if (ds.Tables[0].Rows[0]["discount"].ToString() != "") { model.discount = decimal.Parse(ds.Tables[0].Rows[0]["discount"].ToString()); } model.customid = ds.Tables[0].Rows[0]["customid"].ToString(); if (ds.Tables[0].Rows[0]["pudate"].ToString() != "") { model.pudate = DateTime.Parse(ds.Tables[0].Rows[0]["pudate"].ToString()); } model.paydate = ds.Tables[0].Rows[0]["paydate"].ToString(); if (ds.Tables[0].Rows[0]["paystatus"].ToString() != "") { model.paystatus = int.Parse(ds.Tables[0].Rows[0]["paystatus"].ToString()); } if (ds.Tables[0].Rows[0]["types"].ToString() != "") { model.types = int.Parse(ds.Tables[0].Rows[0]["types"].ToString()); } model.typename = ds.Tables[0].Rows[0]["typename"].ToString(); if (ds.Tables[0].Rows[0]["ctype"].ToString() != "") { model.ctype = int.Parse(ds.Tables[0].Rows[0]["ctype"].ToString()); } return(model); } else { return(null); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(System.Model.V_order_details model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update V_order_details set "); strSql.Append(" id = @id , "); strSql.Append(" duration = @duration , "); strSql.Append(" ftype = @ftype , "); strSql.Append(" portno = @portno , "); strSql.Append(" fno = @fno , "); strSql.Append(" phone = @phone , "); strSql.Append(" sname = @sname , "); strSql.Append(" serialNumber = @serialNumber , "); strSql.Append(" facility = @facility , "); strSql.Append(" port = @port , "); strSql.Append(" price = @price , "); strSql.Append(" discount = @discount , "); strSql.Append(" customid = @customid , "); strSql.Append(" pudate = @pudate , "); strSql.Append(" paydate = @paydate , "); strSql.Append(" paystatus = @paystatus , "); strSql.Append(" types = @types , "); strSql.Append(" typename = @typename , "); strSql.Append(" ctype = @ctype "); strSql.Append(" where "); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4), new SqlParameter("@duration", SqlDbType.Int, 4), new SqlParameter("@ftype", SqlDbType.NVarChar, 50), new SqlParameter("@portno", SqlDbType.NVarChar, 50), new SqlParameter("@fno", SqlDbType.NVarChar, 50), new SqlParameter("@phone", SqlDbType.NVarChar, 50), new SqlParameter("@sname", SqlDbType.NVarChar, 50), new SqlParameter("@serialNumber", SqlDbType.NVarChar, 200), new SqlParameter("@facility", SqlDbType.Int, 4), new SqlParameter("@port", SqlDbType.Int, 4), new SqlParameter("@price", SqlDbType.Money, 8), new SqlParameter("@discount", SqlDbType.Float, 8), new SqlParameter("@customid", SqlDbType.NVarChar, 50), new SqlParameter("@pudate", SqlDbType.DateTime), new SqlParameter("@paydate", SqlDbType.NVarChar, 50), new SqlParameter("@paystatus", SqlDbType.Int, 4), new SqlParameter("@types", SqlDbType.Int, 4), new SqlParameter("@typename", SqlDbType.NVarChar, 50), new SqlParameter("@ctype", SqlDbType.Int, 4) }; parameters[0].Value = model.id; parameters[1].Value = model.duration; parameters[2].Value = model.ftype; parameters[3].Value = model.portno; parameters[4].Value = model.fno; parameters[5].Value = model.phone; parameters[6].Value = model.sname; parameters[7].Value = model.serialNumber; parameters[8].Value = model.facility; parameters[9].Value = model.port; parameters[10].Value = model.price; parameters[11].Value = model.discount; parameters[12].Value = model.customid; parameters[13].Value = model.pudate; parameters[14].Value = model.paydate; parameters[15].Value = model.paystatus; parameters[16].Value = model.types; parameters[17].Value = model.typename; parameters[18].Value = model.ctype; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(System.Model.V_order_details model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(System.Model.V_order_details model) { dal.Add(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <System.Model.V_order_details> DataTableToList(DataTable dt) { List <System.Model.V_order_details> modelList = new List <System.Model.V_order_details>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { System.Model.V_order_details model; for (int n = 0; n < rowsCount; n++) { model = new System.Model.V_order_details(); if (dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } if (dt.Rows[n]["duration"].ToString() != "") { model.duration = int.Parse(dt.Rows[n]["duration"].ToString()); } model.ftype = dt.Rows[n]["ftype"].ToString(); model.portno = dt.Rows[n]["portno"].ToString(); model.fno = dt.Rows[n]["fno"].ToString(); model.phone = dt.Rows[n]["phone"].ToString(); model.sname = dt.Rows[n]["sname"].ToString(); model.serialNumber = dt.Rows[n]["serialNumber"].ToString(); if (dt.Rows[n]["facility"].ToString() != "") { model.facility = int.Parse(dt.Rows[n]["facility"].ToString()); } if (dt.Rows[n]["port"].ToString() != "") { model.port = int.Parse(dt.Rows[n]["port"].ToString()); } if (dt.Rows[n]["price"].ToString() != "") { model.price = decimal.Parse(dt.Rows[n]["price"].ToString()); } if (dt.Rows[n]["discount"].ToString() != "") { model.discount = decimal.Parse(dt.Rows[n]["discount"].ToString()); } model.customid = dt.Rows[n]["customid"].ToString(); if (dt.Rows[n]["pudate"].ToString() != "") { model.pudate = DateTime.Parse(dt.Rows[n]["pudate"].ToString()); } model.paydate = dt.Rows[n]["paydate"].ToString(); if (dt.Rows[n]["paystatus"].ToString() != "") { model.paystatus = int.Parse(dt.Rows[n]["paystatus"].ToString()); } if (dt.Rows[n]["types"].ToString() != "") { model.types = int.Parse(dt.Rows[n]["types"].ToString()); } model.typename = dt.Rows[n]["typename"].ToString(); if (dt.Rows[n]["ctype"].ToString() != "") { model.ctype = int.Parse(dt.Rows[n]["ctype"].ToString()); } modelList.Add(model); } } return(modelList); }
protected void Page_Load(object sender, EventArgs e) { //安卓循环获取订单号码 if (!IsPostBack) { string res = ""; JsonData jsonResult = new JsonData(); try { //条件 string identifying = Request["identifying"] != null?Utility.Helper.Checkstr(Request["identifying"]) : ""; if (!string.IsNullOrEmpty(identifying)) { List <checkStatus> sd = publicData.orderlist; if (sd.Count > 0) { sd = (from s in sd where s.identifying == identifying select s).ToList(); string serialnumber = ""; if (sd.Count > 0 && !string.IsNullOrEmpty(sd[0].orderid)) { serialnumber = sd[0].orderid; jsonResult["res"] = (int)MyEnum.ResultEnum.成功; jsonResult["msg"] = "成功"; jsonResult["code"] = ""; jsonResult["serialnumber"] = serialnumber; string strwhere = " serialNumber='" + serialnumber + "' "; jsonResult["stipplename"] = ""; jsonResult["servertype"] = "快充"; jsonResult["price"] = "0"; List <System.Model.V_order_details> volist = _bll.vobll.GetModelList(strwhere); if (volist.Count > 0) { System.Model.V_order_details fs = volist[0]; jsonResult["stipplename"] = fs.sname; jsonResult["servertype"] = "快充"; jsonResult["price"] = Math.Round(fs.price, 2).ToString(); } } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "未找到该订单"; jsonResult["code"] = ""; jsonResult["serialnumber"] = ""; } } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "系统错误"; jsonResult["code"] = "参数有误"; } } else { jsonResult["res"] = (int)MyEnum.ResultEnum.失败; jsonResult["msg"] = "系统错误"; jsonResult["code"] = "参数有误"; } } 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); } }