private string readlist(string yonghuming, HttpContext context) { zhangte.BLL.zt_dingdan bll1 = new zhangte.BLL.zt_dingdan(context); zhangte.Model.zt_dingdan model1 = new zhangte.Model.zt_dingdan(); DataSet ds1 = bll1.GetList(" 用户名 = '" + yonghuming + "'"); string strif = " order by id desc"; if (yonghuming != "") { strif = " where 用户名 like '%" + yonghuming + "%' order by id desc"; } string strret = "<table cellspacing='0' cellpadding='4' id='GridView1' style='color:#333333;width:100%;border-collapse:collapse;'><tr style='color:White;background-color:#5D7B9D;font-weight:bold;'>\r\n"; strret += "<th scope='col'>订单编号</th><th scope='col'>企业标识代码</th><th scope='col'>用户名</th><th scope='col'>产品名称</th><th scope='col'>总价</th><th scope='col'>订单状态</th><th scope='col'>查看明细</th></tr>\r\n"; for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { if (i % 2 == 0) { strret += "<tr align='center' style='color:#333333;background-color:#F7F6F3;'> <td>" + ds1.Tables[0].Rows[i]["订单编号"].ToString() + "</td> <td>" + ds1.Tables[0].Rows[i]["企业标识代码"].ToString() + "</td><td>" + ds1.Tables[0].Rows[i]["用户名"].ToString() + "</td><td>" + ds1.Tables[0].Rows[i]["总价"].ToString() + "</td><td>" + ds1.Tables[0].Rows[i]["产品名称"].ToString() + "</td><td>" + ds1.Tables[0].Rows[i]["订单状态"].ToString() + "</td><td><a onclick=\"mbedit('" + ds1.Tables[0].Rows[i]["id"].ToString() + "'); href='#cpedit'\">查看明细</a></td> </tr>\r\n"; } else { strret += "<tr align='center' style='color:#333333;background-color:#F7F6F3;'> <td>" + ds1.Tables[0].Rows[i]["订单编号"].ToString() + "</td> <td>" + ds1.Tables[0].Rows[i]["企业标识代码"].ToString() + "</td><td>" + ds1.Tables[0].Rows[i]["用户名"].ToString() + "</td><td>" + ds1.Tables[0].Rows[i]["总价"].ToString() + "</td><td>" + ds1.Tables[0].Rows[i]["产品名称"].ToString() + "</td><td>" + ds1.Tables[0].Rows[i]["订单状态"].ToString() + "</td><td><a onclick=\"mbedit('" + ds1.Tables[0].Rows[i]["id"].ToString() + "'); href='#cpedit'\">查看明细</a></td> </tr>\r\n"; } } strret += "</table>\r\n"; return(strret); }
private string savecp(string dingdanbianhao, HttpContext context) { zhangte.BLL.zt_dingdan bll22 = new zhangte.BLL.zt_dingdan(context); zhangte.Model.zt_dingdan model22 = new zhangte.Model.zt_dingdan(); DataSet ds22 = bll22.GetList(" 订单编号 = '" + dingdanbianhao + "'"); model22.Id = int.Parse(ds22.Tables[0].Rows[0]["id"].ToString()); model22.订单编号 = ds22.Tables[0].Rows[0]["订单编号"].ToString(); model22.企业标识代码 = ds22.Tables[0].Rows[0]["企业标识代码"].ToString(); model22.用户名 = ds22.Tables[0].Rows[0]["用户名"].ToString(); model22.产品名称 = ds22.Tables[0].Rows[0]["产品名称"].ToString(); model22.单价 = ds22.Tables[0].Rows[0]["单价"].ToString(); model22.数量 = ds22.Tables[0].Rows[0]["数量"].ToString(); model22.总价 = ds22.Tables[0].Rows[0]["总价"].ToString(); model22.订单时间 = ds22.Tables[0].Rows[0]["订单时间"].ToString(); model22.收货地址 = ds22.Tables[0].Rows[0]["收货地址"].ToString(); model22.联系方式 = ds22.Tables[0].Rows[0]["联系方式"].ToString(); model22.订单状态 = "已收货"; bll22.Update1(model22); string strret = "OK"; return(strret); }
private string readedit(string dingdanbianhao, HttpContext context) { zhangte.BLL.zt_dingdan bll1 = new zhangte.BLL.zt_dingdan(context); zhangte.Model.zt_dingdan model1 = new zhangte.Model.zt_dingdan(); DataSet ds1 = bll1.GetList(" Id = '" + dingdanbianhao + "'"); string strif = " order by id desc"; if (dingdanbianhao != "") { strif = " where 订单编号 = " + dingdanbianhao + " order by id desc"; } string strret = ""; if (ds1.Tables[0].Rows.Count > 0) { strret = ds1.Tables[0].Rows[0]["订单编号"].ToString() + "|" + ds1.Tables[0].Rows[0]["企业标识代码"].ToString() + "|" + ds1.Tables[0].Rows[0]["用户名"].ToString() + "|" + ds1.Tables[0].Rows[0]["产品名称"].ToString() + "|" + ds1.Tables[0].Rows[0]["单价"].ToString() + "|" + ds1.Tables[0].Rows[0]["数量"].ToString() + "|" + ds1.Tables[0].Rows[0]["总价"].ToString() + "|" + ds1.Tables[0].Rows[0]["订单时间"].ToString() + "|" + ds1.Tables[0].Rows[0]["收货地址"].ToString() + "|" + ds1.Tables[0].Rows[0]["联系方式"].ToString() + "|" + ds1.Tables[0].Rows[0]["订单状态"].ToString() + "|"; } return(strret); }
public override void ProcessRequest(HttpContext context) { zhangte.BLL.zt_dingdan bll = new zhangte.BLL.zt_dingdan(context); base.ProcessRequest(context); context.Response.ContentType = "text/plain"; mycommonClass mycommonClassobj = new mycommonClass(); context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); if (context.Request.QueryString["type"] == "edit")//获取编辑信息 { if (context.Request.QueryString["Id"] != null) { string strret = bll.Geteditdata(context.Request.QueryString["Id"].ToString());//aa1 context.Response.Write(strret); } } else if (context.Request.QueryString["type"] == "del")//删除信息 { if (context.Request.QueryString["Id"] == null) { return; } string Id = context.Request.QueryString["Id"].ToString(); bll.Delete(int.Parse(Id)); } else if (context.Request.QueryString["type"] == "combox")//保存修改或添加 信息 aa2 { } else if (context.Request.QueryString["type"] == "save")//保存修改或添加 { string dingdanbianhao = context.Request.QueryString["dingdanbianhao"]; string qiyebiaoshiDM = context.Request.QueryString["qiyebiaoshiDM"]; string yonghuming = context.Request.QueryString["yonghuming"]; string chanpinmingcheng = context.Request.QueryString["chanpinmingcheng"]; string danjia = context.Request.QueryString["danjia"]; string shuliang = context.Request.QueryString["shuliang"]; string zongjia = context.Request.QueryString["zongjia"]; string dingdanshijian = context.Request.QueryString["dingdanshijian"]; string shouhuodizhi = context.Request.QueryString["shouhuodizhi"]; string lianxifangshi = context.Request.QueryString["lianxifangshi"]; string dingdanzhuangtai = context.Request.QueryString["dingdanzhuangtai"]; if (context.Request.QueryString["Id"] != null && context.Request.QueryString["Id"] != "") { bll.Update(context.Request.QueryString["Id"].ToString(), dingdanbianhao, qiyebiaoshiDM, yonghuming, chanpinmingcheng, danjia, shuliang, zongjia, dingdanshijian, shouhuodizhi, lianxifangshi, dingdanzhuangtai); } else { bll.Add(dingdanbianhao, qiyebiaoshiDM, yonghuming, chanpinmingcheng, danjia, shuliang, zongjia, dingdanshijian, shouhuodizhi, lianxifangshi, dingdanzhuangtai); } context.Response.Write("true"); } else if (Convert.ToString(context.Request.Form["action"]) == "query") { pagestrif = "企业标识代码=(select 企业标识代码 from zt_qiyebiao where 企业名称 ='" + HttpContext.Current.Session["account"].ToString() + "')"; string strret = bll.GetListByPageColumns_tojson("Id,订单编号,企业标识代码,用户名,产品名称,单价,数量,总价,订单时间,收货地址,联系方式,订单状态", pagestrif, "Id"); context.Response.Write(strret); return; } else { } }