private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); if (this.status > 0) { this.ddlStatus.SelectedValue = this.status.ToString(); } if (this.payment_status > 0) { this.ddlPaymentStatus.SelectedValue = this.payment_status.ToString(); } if (this.distribution_status > 0) { this.ddlDistributionStatus.SelectedValue = this.distribution_status.ToString(); } this.txtKeywords.Text = this.keywords; BLL.orders bll = new BLL.orders(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("order_list.aspx", "status={0}&payment_status={1}&distribution_status={2}&keywords={3}&page={4}", this.status.ToString(), this.payment_status.ToString(), this.distribution_status.ToString(), this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void RptBind(string _strWhere, string _orderby) { Model.wx_userweixin weixin = GetWeiXinCode(); this.page = MXRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; BLL.orders bll = new BLL.orders(); DataSet ds = bll.GetList(weixin.id,this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); ; if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i]; dr["statusName"] = GetOrderStatus(MyCommFun.Obj2Int(dr["id"]), MyCommFun.Obj2Int(dr["status"]), MyCommFun.Obj2Int(dr["payment_status"]), MyCommFun.Obj2Int(dr["express_status"])); } } this.rptList.DataSource = ds; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("order_confirm.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; BLL.orders bll = new BLL.orders(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("order_confirm.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void RptBind(string _strWhere, string _orderby) { Model.wx_userweixin weixin = GetWeiXinCode(); this.page = MXRequest.GetQueryInt("page", 1); if (this.status > 0) { this.ddlStatus.SelectedValue = this.status.ToString(); } if (this.payment_status > 0) { this.ddlPaymentStatus.SelectedValue = this.payment_status.ToString(); } if (this.express_status > 0) { this.ddlExpressStatus.SelectedValue = this.express_status.ToString(); } txtKeywords.Text = this.keywords; BLL.orders bll = new BLL.orders(); DataSet ds = bll.GetList(weixin.id, this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);; if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow dr; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { dr = ds.Tables[0].Rows[i]; dr["statusName"] = GetOrderStatus(MyCommFun.Obj2Int(dr["id"]), MyCommFun.Obj2Int(dr["status"]), MyCommFun.Obj2Int(dr["payment_status"]), MyCommFun.Obj2Int(dr["express_status"])); } } this.rptList.DataSource = ds; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("order_list.aspx", "status={0}&payment_status={1}&express_status={2}&keywords={3}&page={4}", this.status.ToString(), this.payment_status.ToString(), this.express_status.ToString(), this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
public void ProcessRequest(HttpContext context) { int page = DTRequest.GetQueryInt("page"); int pagesize = DTRequest.GetQueryInt("pagesize"); string where = DTRequest.GetQueryString("where"); string order = DTRequest.GetQueryString("order"); BLL.orders bll = new BLL.orders(); int totalCount; DataTable dt = bll.GetList(pagesize, page, where, order, out totalCount).Tables[0]; //DataTable new_dt = new DataTable(); //new_dt.Columns.Add("网店订单编号"); //new_dt.Columns.Add("商品名称"); //new_dt.Columns.Add("商品编码"); //new_dt.Columns.Add("数量"); //new_dt.Columns.Add("单价"); //new_dt.Columns.Add("订单日期"); //new_dt.Columns.Add("收货人名称"); //new_dt.Columns.Add("收货人电话"); //new_dt.Columns.Add("收货人手机"); //new_dt.Columns.Add("省份"); //new_dt.Columns.Add("市"); //new_dt.Columns.Add("区"); //new_dt.Columns.Add("收货地址"); //new_dt.Columns.Add("买家帐号"); //new_dt.Columns.Add("物流公司"); //new_dt.Columns.Add("物流单号"); //new_dt.Columns.Add("买家运费"); //new_dt.Columns.Add("买家留言"); //new_dt.Columns.Add("卖家备注"); //new_dt.Columns.Add("发票抬头"); string str_table = "<table border=\"1\"><tr>" + "<td>网店订单编号</td>" + "<td>商品名称</td>" + "<td>商品编码</td>" + "<td>数量</td>" + "<td>单价</td>" + "<td>订单日期</td>" + "<td>收货人名称</td>" + "<td>收货人电话</td>" + "<td>收货人手机</td>" + "<td>省份</td>" + "<td>市</td>" + "<td>区</td>" + "<td>收货地址</td>" + "<td>买家帐号</td>" + "<td>物流公司</td>" + "<td>物流单号</td>" + "<td>买家运费</td>" + "<td>买家留言</td>" + "<td>卖家备注</td>" + "<td>发票抬头</td>" + "</tr>"; foreach (DataRow dr in dt.Rows) { Model.orders model = bll.GetModel(Convert.ToInt32(dr["id"])); if (model != null) { int good_count = 1; if (model.order_goods != null) { good_count = model.order_goods.Count; } string[] address = model.address.Split('|'); int flg = 0; if (model.order_goods != null) { foreach (Model.order_goods item in model.order_goods) { str_table += "<tr>"; if (flg < 1) { str_table += "<td rowspan=\"" + good_count + "\">" + model.order_no + "</td>"; } string unit = ""; if (!string.IsNullOrEmpty(item.unit)) { unit = "单位:" + item.unit; } str_table += "<td>" + item.goods_title + "(" + new DTcms.BLL.standard_value().get_standrad(item.standard) + unit + ")" + "</td>"; str_table += "<td>" + item.good_no + "</td>"; str_table += "<td>" + item.quantity + "</td>"; str_table += "<td>" + item.real_price + "</td>"; if (flg < 1) { str_table += "<td rowspan=\"" + good_count + "\">" + model.add_time + "</td>"; str_table += "<td rowspan=\"" + good_count + "\">" + model.accept_name + "</td>"; str_table += "<td rowspan=\"" + good_count + "\">" + model.telphone + "</td>"; str_table += "<td rowspan=\"" + good_count + "\">" + model.mobile + "</td>"; if (address.Length >= 1) { str_table += "<td rowspan=\"" + good_count + "\">" + address[0] + "</td>"; } else { str_table += "<td rowspan=\"" + good_count + "\"></td>"; } if (address.Length >= 2) { str_table += "<td rowspan=\"" + good_count + "\">" + address[1] + "</td>"; } else { str_table += "<td rowspan=\"" + good_count + "\"></td>"; } if (address.Length >= 3) { str_table += "<td rowspan=\"" + good_count + "\">" + address[2] + "</td>"; } else { str_table += "<td rowspan=\"" + good_count + "\"></td>"; } if (address.Length >= 4) { str_table += "<td rowspan=\"" + good_count + "\">" + address[3] + "</td>"; } else { str_table += "<td rowspan=\"" + good_count + "\"></td>"; } str_table += "<td rowspan=\"" + good_count + "\">" + model.user_name + "</td>"; str_table += "<td rowspan=\"" + good_count + "\">" + (new BLL.express().GetModel(model.express_id) == null ? "" : new BLL.express().GetModel(model.express_id).title) + "</td>"; str_table += "<td rowspan=\"" + good_count + "\">" + model.express_no + "</td>"; str_table += "<td rowspan=\"" + good_count + "\">" + model.express_fee + "</td>"; str_table += "<td rowspan=\"" + good_count + "\">" + model.message + "</td>"; str_table += "<td rowspan=\"" + good_count + "\">" + model.remark + "</td>"; str_table += "<td rowspan=\"" + good_count + "\">" + "" + "</td>"; } str_table += "</tr>"; flg++; } } } } str_table += "</table>"; context.Response.Clear(); context.Response.Buffer = true; context.Response.AppendHeader("Content-Disposition", "attachment;filename=订单" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls"); context.Response.ContentEncoding = System.Text.Encoding.UTF8; context.Response.ContentType = "application/vnd.ms-excel"; context.Response.Write(str_table); context.Response.End(); }
protected void Page_Load(object sender, EventArgs e) { webUrl = "http://" + Utils.GetHomeUrl(); XmlDocument doc = XmlHelper.LoadXmlDoc(Utils.GetXmlMapPath("Configpathofubao")); string merchantid1 = doc.SelectSingleNode(@"Root/merID").InnerText; string HashKey = doc.SelectSingleNode(@"Root/MerchantID").InnerText; string HashIV = doc.SelectSingleNode(@"Root/TerminalID").InnerText; string url = ""; string mid = merchantid1;//1038690 string MerchantID = Request["MerchantID"]; string MerchantTradeNo = Request["MerchantTradeNo"]; string PaymentDate = Request["PaymentDate"]; string PaymentType = Request["PaymentType"]; string PaymentTypeChargeFee = Request["PaymentTypeChargeFee"]; string RtnCode = Request["RtnCode"]; string RtnMsg = Request["RtnMsg"]; string SimulatePaid = Request["SimulatePaid"]; string TradeAmt = Request["TradeAmt"]; string TradeDate = Request["TradeDate"]; string TradeNo = Request["TradeNo"]; string CheckMacValue = Request["CheckMacValue"]; StringBuilder sb = new StringBuilder(); sb.Append("HashKey=" + HashKey + "");//7RswcwBgLcqnMjy5 sb.Append("&MerchantID=" + Request["MerchantID"] + ""); sb.Append("&MerchantTradeNo=" + Request["MerchantTradeNo"] + ""); sb.Append("&PaymentDate=" + Request["PaymentDate"] + ""); sb.Append("&PaymentType=" + Request["PaymentType"] + ""); sb.Append("&PaymentTypeChargeFee=" + Request["PaymentTypeChargeFee"] + ""); sb.Append("&RtnCode=" + Request["RtnCode"] + ""); sb.Append("&RtnMsg=" + Request["RtnMsg"] + ""); sb.Append("&SimulatePaid=" + Request["SimulatePaid"] + ""); sb.Append("&TradeAmt=" + Request["TradeAmt"] + ""); sb.Append("&TradeDate=" + Request["TradeDate"] + ""); sb.Append("&TradeNo=" + Request["TradeNo"] + ""); sb.Append("&HashIV=" + HashIV + "");//IA0pz3lNuyui52iZ url = sb.ToString(); url = getstr(url).ToLower(); string CMValue = DTcms.BLL.Function.Instance.MD5(url, 32); // Response.Write(CMValue); // Response.End(); // && CheckMacValue == CMValue if (MerchantID == mid && RtnCode == "1" && !string.IsNullOrEmpty(MerchantTradeNo) && CheckMacValue == CMValue) { BLL.orders bll_order = new BLL.orders(); DataSet ds = bll_order.GetList(1, "order_no='" + MerchantTradeNo + "'", " id desc"); if (ds.Tables[0].Rows.Count > 0) { int bk = bll_order.UpOrderState(MerchantTradeNo); if (bk > 0) { setEmail(); //Response.Write("1|OK"); this.Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('付款成功,將跳回首頁');window.location.href='/'</script>"); Response.End(); } else { Response.Write("发生错误"); Response.End(); } } else { Response.Write("0|ErrorMessage"); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { string url = ""; string mid = "1038690"; string MerchantID = Request["MerchantID"]; string MerchantTradeNo = Request["MerchantTradeNo"]; string PaymentDate = Request["PaymentDate"]; string PaymentType = Request["PaymentType"]; string PaymentTypeChargeFee = Request["PaymentTypeChargeFee"]; string RtnCode = Request["RtnCode"]; string RtnMsg = Request["RtnMsg"]; string SimulatePaid = Request["SimulatePaid"]; string TradeAmt = Request["TradeAmt"]; string TradeDate = Request["TradeDate"]; string TradeNo = Request["TradeNo"]; string CheckMacValue = Request["CheckMacValue"]; StringBuilder sb = new StringBuilder(); sb.Append("HashKey=7RswcwBgLcqnMjy5"); sb.Append("&MerchantID=" + Request["MerchantID"] + ""); sb.Append("&MerchantTradeNo=" + Request["MerchantTradeNo"] + ""); sb.Append("&PaymentDate=" + Request["PaymentDate"] + ""); sb.Append("&PaymentType=" + Request["PaymentType"] + ""); sb.Append("&PaymentTypeChargeFee=" + Request["PaymentTypeChargeFee"] + ""); sb.Append("&RtnCode=" + Request["RtnCode"] + ""); sb.Append("&RtnMsg=" + Request["RtnMsg"] + ""); sb.Append("&SimulatePaid=" + Request["SimulatePaid"] + ""); sb.Append("&TradeAmt=" + Request["TradeAmt"] + ""); sb.Append("&TradeDate=" + Request["TradeDate"] + ""); sb.Append("&TradeNo=" + Request["TradeNo"] + ""); sb.Append("&HashIV=IA0pz3lNuyui52iZ"); url = sb.ToString(); url = getstr(url).ToLower(); string CMValue = DTcms.BLL.Function.Instance.MD5(url, 32); // Response.Write(CMValue); // Response.End(); // && CheckMacValue == CMValue if (MerchantID == mid && RtnCode == "1" && !string.IsNullOrEmpty(MerchantTradeNo) && CheckMacValue == CMValue) { BLL.orders bll_order = new BLL.orders(); DataSet ds = bll_order.GetList(1, "order_no='" + MerchantTradeNo + "'", " id desc"); if (ds.Tables[0].Rows.Count > 0) { int bk = bll_order.UpOrderState(MerchantTradeNo); if (bk > 0) { Response.Write("1|OK"); Response.End(); } else { Response.Write("发生错误"); Response.End(); } } else { Response.Write("0|ErrorMessage"); Response.End(); } } }