protected void Page_Load(object sender, EventArgs e) { if (!B_ARoleAuth.Check(ZLEnum.Auth.shop, "OrderList")) { function.WriteErrMsg("没有权限进行此项操作"); } if (Mid < 1 && string.IsNullOrEmpty(OrderNO)) { function.WriteErrMsg("未指定订单"); } if (!IsPostBack) { if (Mid > 0) { orderinfo = oll.GetOrderListByid(Mid); } else if (!string.IsNullOrEmpty(Request["OrderNo"])) { orderinfo = oll.GetByOrder(Request["OrderNo"], "0"); } if (orderinfo == null || orderinfo.id < 1) { function.WriteErrMsg("订单不存在"); } OrderNO = orderinfo.OrderNo; //---------------------------------------------------------- M_UserInfo mu = buser.SelReturnModel(orderinfo.Userid); HeadTitle_L.Text = "订 单 信 息(订单编号:" + orderinfo.OrderNo + ")"; string giveurl = customPath2 + "User/Userexp.aspx?UserID=" + orderinfo.Userid + "&orderid=" + orderinfo.id; give_score_a.HRef = giveurl + "&type=" + (int)M_UserExpHis.SType.Point; give_purse_a.HRef = giveurl + "&type=" + (int)M_UserExpHis.SType.Purse; OrderNo_L.Text = orderinfo.OrderNo; Orderamounts_L.Text = orderinfo.Ordersamount.ToString("f2"); isCheckRe_L.Text = orderinfo.Guojia; Cdate_L.Text = orderinfo.AddTime.ToString("yyyy年MM月dd日 HH:mm"); Reuser.Text = StringHelper.SubStr(orderinfo.Reuser, 12); UName_L.Text = "<a href='javascript:;' onclick='showuinfo(" + mu.UserID + ");' title='查看用户'>" + mu.UserName + "</a>"; if (orderinfo.StateLogistics != 0) { Exp_Send_Btn.Enabled = false; } if (orderinfo.StateLogistics == 1) { Exp_ClientSign_Btn.Enabled = true; } if (orderinfo.StateLogistics == 0) { function.Script(this, "hiddLogistics();"); } if (orderinfo.Paymentstatus >= (int)M_OrderList.PayEnum.HasPayed) { Paymentstatus.Text = "<span style='color:green';>已经汇款</span>"; Pay_Has_Btn.Disabled = true; } else { Paymentstatus.Text = "<span style='color:red;'>等待汇款</span>"; Pay_Has_Btn.Disabled = false; Exp_Send_Btn.Enabled = false; } switch ((M_OrderList.StatusEnum)orderinfo.OrderStatus) { case M_OrderList.StatusEnum.Normal: OS_Sure_Btn.Enabled = true; break; case M_OrderList.StatusEnum.DrawBack: OS_Sure_Btn.Enabled = false; OS_NoSure_Btn.Enabled = false; CheckReturn.Enabled = true; UnCheckRetrun.Enabled = true; Exp_Send_Btn.Enabled = false; CompleteOrder_Btn.Enabled = false; break; case M_OrderList.StatusEnum.UnDrawBack: case M_OrderList.StatusEnum.CheckDrawBack: OS_Invoice_Btn.Enabled = false; OS_Sure_Btn.Enabled = false; OS_NoSure_Btn.Enabled = false; Exp_Send_Btn.Enabled = false; CompleteOrder_Btn.Enabled = false; break; case M_OrderList.StatusEnum.OrderFinish: case M_OrderList.StatusEnum.UnitFinish: CompleteOrder_Btn.Enabled = false; break; default: break; } #region 物流信息 ExpStatus_L.Text = OrderHelper.GetExpStatus(orderinfo.StateLogistics); M_Order_Exp expMod = expBll.SelReturnModel(DataConverter.CLng(orderinfo.ExpressNum)); if (expMod != null) { ExpName_L.Text = expMod.ExpComp; ExpCode_L.Text = expMod.ExpNo; ExpStatus_L.Text += "(公司:" + expMod.ExpComp + "/单号:" + expMod.ExpNo + ")"; } switch ((M_OrderList.ExpEnum)orderinfo.StateLogistics) { case M_OrderList.ExpEnum.NoSend: Exp_Cancel_Btn.Enabled = false; ExpPrint_B.Disabled = true; break; case M_OrderList.ExpEnum.HasSend: Exp_ClientSign_Btn.Enabled = true; break; case M_OrderList.ExpEnum.HasReceived: Exp_Send_Btn.Enabled = false; break; } DrawBackStr.Text = orderinfo.Merchandiser; Deliverytime.Text = orderinfo.Deliverytime.ToString();//送货时间 switch (orderinfo.Deliverytime) { case 1: Deliverytime.Text = "对送货时间没有特殊要求"; break; case 2: Deliverytime.Text = "双休日或者周一至周五的晚上送达"; break; case 3: Deliverytime.Text = "周一至周五的白天送达"; break; default: break; } Phone.Text = orderinfo.Phone.ToString(); //联系电话 ZipCode.Text = orderinfo.ZipCode.ToString(); //邮政编码 Mobile.Text = orderinfo.MobileNum; //手机 Reusers.Text = orderinfo.Reuser.ToString(); //订货人 Jiedao.Text = orderinfo.Shengfen + " " + orderinfo.Jiedao; //地址 #endregion OrderStatus.Text = OrderHelper.GetOrderStatus(orderinfo.OrderStatus); adddate.Text = orderinfo.AddTime.ToShortDateString(); OrderType_L.Text = orderinfo.AddTime.ToString(); Invoiceneeds.Text = orderinfo.Invoiceneeds == 1 ? ComRE.Icon_OK : ComRE.Icon_Error; Developedvotes.Text = orderinfo.Developedvotes == 1 ? ComRE.Icon_OK : ComRE.Icon_Error; //如果已支付 if (orderinfo.Integral > 0 && orderinfo.Paymentstatus >= (int)M_OrderList.PayEnum.HasPayed) { if (orderinfo.SendPointStatus == 1) { ISsend.Text = "已送出"; } } Pay_Has_Btn.Disabled = orderinfo.Paymentstatus == 1 ? true : false; //更改状态,已支付 OS_Freeze_Btn.Enabled = orderinfo.Settle == 1 ? false : true; //冻结 OS_Pause_Btn.Enabled = orderinfo.Suspended == 1 ? false : true; //暂停 if (orderinfo.Aside == 1) //已作废 { Pay_Has_Btn.Disabled = true; //ShowSend_Btn.Enabled = false; OS_Sure_Btn.Enabled = false; OS_NoSure_Btn.Enabled = false; CompleteOrder_Btn.Enabled = false; Exp_ClientSign_Btn.Enabled = false; OS_Freeze_Btn.Enabled = false; OS_Invoice_Btn.Enabled = false; OS_Pause_Btn.Enabled = false; OS_Aside_Btn.Enabled = false; Pay_Cancel_Btn.Enabled = false; Refund_B.Attributes["disabled"] = "disabled"; } else { OS_Aside_Btn.Enabled = true; } if (orderinfo.Settle == 1)//结清 { Pay_Has_Btn.Disabled = true; //ShowSend_Btn.Enabled = false; OS_Sure_Btn.Enabled = false; OS_NoSure_Btn.Enabled = false; OS_Aside_Btn.Enabled = false; Exp_ClientSign_Btn.Enabled = false; OS_Invoice_Btn.Enabled = false; OS_Pause_Btn.Enabled = false; } if (!string.IsNullOrEmpty(orderinfo.PaymentNo))//支付后才有值 { M_Payment payMod = payBll.SelModelByPayNo(orderinfo.PaymentNo); if (payMod.PayPlatID == 0) { Payment.Text = "虚拟币支付"; } else { M_PayPlat payPlatMod = platBll.GetPayPlatByid(payMod.PayPlatID); Payment.Text = payPlatMod.PayPlatName.ToString(); } } Email.Text = orderinfo.Email.ToString(); //电子信 Invoice.Text = orderinfo.Invoice.ToString(); //发票信息 if (orderinfo.Outstock == 1) { Outstock.Text = "缺货时,取消此订单"; } else { Outstock.Text = "缺货时,将有货的商品发出,取消无货商品的订购"; } AddUser.Text = orderinfo.AddUser.ToString(); //负责跟单人员 Internalrecords_T.Text = orderinfo.Internalrecords.ToString(); //内部记录 Ordermessage_T.Text = orderinfo.Ordermessage; //订货留言 LabScore.Text = orderinfo.Integral.ToString(); //积分 //-------购物车 DataTable cplist = cartProBll.GetCartProOrderID(Mid); Procart_RPT.DataSource = cplist; Procart_RPT.DataBind(); if (cplist.Rows.Count > 0 && !string.IsNullOrEmpty(cplist.Rows[0]["Additional"].ToString())) { M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(cplist.Rows[0]["Additional"].ToString()); List <M_Cart_Contract> modelList = new List <M_Cart_Contract>(); modelList.AddRange(model.Guest); modelList.AddRange(model.Contract); UserRPT.DataSource = modelList; UserRPT.DataBind(); } DataTable newtable = cplist.DefaultView.ToTable(false, "Shijia", "Pronum"); double allmoney = 0; for (int i = 0; i < newtable.Rows.Count; i++) { allmoney = allmoney + DataConverter.CDouble(cplist.Rows[i]["Allmoney"]); } //------- Label2.Text = orderinfo.Ordersamount.ToString(); Label29.Text = orderinfo.Ordersamount.ToString("f2"); Label31.Text = (orderinfo.Ordersamount).ToString("f2") + "元"; ReceMoney_L.Text = orderinfo.Receivablesamount.ToString("f2") + "元"; //判断订单所处状态 { if (orderinfo.OrderStatus < (int)M_OrderList.StatusEnum.Normal || orderinfo.Aside == 1) { prog_order_div.InnerHtml = OrderHelper.GetOrderStatus(orderinfo.OrderStatus, orderinfo.Aside, orderinfo.StateLogistics); } else { int current = 2; if (orderinfo.OrderStatus >= (int)M_OrderList.StatusEnum.OrderFinish) { current = 5; } else if (orderinfo.Paymentstatus >= (int)M_OrderList.PayEnum.HasPayed) { current++; switch (orderinfo.StateLogistics) { case (int)M_OrderList.ExpEnum.HasSend: current++; break; case (int)M_OrderList.ExpEnum.HasReceived: current += 2; break; } } function.Script(this, "$('#prog_order_div').ZLSteps('订单生成,等待用户支付,等待商户发货,等待用户签收,订单完结'," + current + ")"); } } Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='ProductManage.aspx'>商城管理</a></li><li><a href='OrderList.aspx'>订单管理</a></li><li class='active'><a href='" + Request.RawUrl + "'>订单详情</a></li>"); } }
public void MyBind() { CartDT = cartBll.SelByCookID(CartCookID, ProClass, ids); if (CartDT.Rows.Count < 1) { function.WriteErrMsg("你尚未选择商品,<a href='/User/Order/OrderList.aspx'>查看我的订单</a>"); } //旅游,酒店等不需要检测地址栏 switch (DataConvert.CLng(CartDT.Rows[0]["ProClass"])) { case (int)M_Product.ClassType.LY: { userli.Visible = true; M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(CartDT.Rows[0]["Additional"].ToString()); model.Guest.AddRange(model.Contract); UserRPT.DataSource = model.Guest; UserRPT.DataBind(); } break; case (int)M_Product.ClassType.JD: { userli.Visible = true; M_Cart_Hotel model = JsonConvert.DeserializeObject <M_Cart_Hotel>(CartDT.Rows[0]["Additional"].ToString()); model.Guest.AddRange(model.Contract); UserRPT.DataSource = model.Guest; UserRPT.DataBind(); } break; default: //------地址 DataTable addressDT = receBll.SelByUID(buser.GetLogin().UserID); AddressRPT.DataSource = addressDT; AddressRPT.DataBind(); EmptyDiv.Visible = addressDT.Rows.Count < 1; //地址为空提醒 break; } //------核算费用 double allmoney = UpdateCartAllMoney(CartDT); //------费用统计 itemnum_span.InnerText = CartDT.Rows.Count.ToString(); totalmoney_span1.InnerText = allmoney.ToString("f2"); //------店铺 Store_RPT.DataSource = orderCom.SelStoreDT(CartDT); Store_RPT.DataBind(); //------发票绑定 DataTable invoceDT = new DataTable();//orderBll.SelInvoByUser(buser.GetLogin().UserID); if (invoceDT.Rows.Count > 0) { Invoice_RPT.DataSource = invoceDT; Invoice_RPT.DataBind(); } else { Invoice_RPT.Visible = false; } //------积分抵扣 if (SiteConfig.ShopConfig.PointRatiot > 0 && SiteConfig.ShopConfig.PointRatiot < 100 && SiteConfig.ShopConfig.PointRate > 0) { point_body.Visible = true; M_UserInfo usermod = buser.GetLogin(); Point_L.Text = usermod.UserExp.ToString(); int usepoint = (int)(allmoney * (SiteConfig.ShopConfig.PointRatiot * 0.01) / SiteConfig.ShopConfig.PointRate); function.Script(this, "SumByPoint(" + usepoint + ");"); PointRate_Hid.Value = SiteConfig.ShopConfig.PointRate.ToString(); } else { point_tips.Visible = true; } }
public void MyBind() { M_UserInfo mu = buser.GetLogin(); CartDT = cartBll.SelByCartID(B_Cart.GetCartID(), mu.UserID, ProClass, ids); if (CartDT.Rows.Count < 1) { function.WriteErrMsg("你尚未选择商品,<a href='/User/Order/OrderList'>查看我的订单</a>"); } //旅游,酒店等不需要检测地址栏 switch (DataConvert.CLng(CartDT.Rows[0]["ProClass"])) { case (int)M_Product.ClassType.LY: { userli.Visible = true; M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(CartDT.Rows[0]["Additional"].ToString()); model.Guest.AddRange(model.Contract); UserRPT.DataSource = model.Guest; UserRPT.DataBind(); } break; case (int)M_Product.ClassType.JD: { userli.Visible = true; M_Cart_Hotel model = JsonConvert.DeserializeObject <M_Cart_Hotel>(CartDT.Rows[0]["Additional"].ToString()); model.Guest.AddRange(model.Contract); UserRPT.DataSource = model.Guest; UserRPT.DataBind(); } break; default: //------地址 DataTable addressDT = receBll.SelByUID(buser.GetLogin().UserID); AddressRPT.DataSource = addressDT; AddressRPT.DataBind(); EmptyDiv.Visible = addressDT.Rows.Count < 1; //地址为空提醒 break; } //------核算费用 allmoney = UpdateCartAllMoney(CartDT); //------费用统计 itemnum_span.InnerText = CartDT.Rows.Count.ToString(); totalmoney_span1.InnerText = allmoney.ToString("f2"); //------店铺 Store_RPT.DataSource = orderCom.SelStoreDT(CartDT); Store_RPT.DataBind(); //------发票绑定 DataTable invoceDT = new DataTable();//orderBll.SelInvoByUser(buser.GetLogin().UserID); if (invoceDT.Rows.Count > 0) { Invoice_RPT.DataSource = invoceDT; Invoice_RPT.DataBind(); } else { Invoice_RPT.Visible = false; } //------积分抵扣 if (SiteConfig.ShopConfig.PointRatiot > 0 && SiteConfig.ShopConfig.PointRatiot < 100 && SiteConfig.ShopConfig.PointRate > 0) { point_body.Visible = true; M_UserInfo usermod = buser.GetLogin(); Point_L.Text = usermod.UserExp.ToString(); int usepoint = (int)(allmoney * (SiteConfig.ShopConfig.PointRatiot * 0.01) / SiteConfig.ShopConfig.PointRate); function.Script(this, "SumByPoint(" + usepoint + ");"); PointRate_Hid.Value = SiteConfig.ShopConfig.PointRate.ToString(); } else { point_tips.Visible = true; } //------用户有哪些优惠券 DataTable avdt = avBll.U_Sel(mu.UserID, -100, 1); if (avdt.Rows.Count > 0) { arrive_div.Style.Add("display", "block"); arrive_data_div.Visible = true; avdt.Columns.Add("enable", typeof(int)); avdt.Columns.Add("err", typeof(string)); for (int i = 0; i < avdt.Rows.Count; i++) { DataRow dr = avdt.Rows[i]; double money = allmoney; string err = ""; dr["enable"] = avBll.U_CheckArrive(new M_Arrive().GetModelFromReader(dr), mu.UserID, ref money, ref err) ? 1 : 0; dr["err"] = err; } avdt.DefaultView.RowFilter = "enable='1'"; //function.WriteErrMsg(avdt.DefaultView.ToTable().Rows.Count.ToString()); Arrive_Active_RPT.DataSource = avdt.DefaultView.ToTable(); Arrive_Active_RPT.DataBind(); avdt.DefaultView.RowFilter = "enable='0'"; Arrive_Disable_RPT.DataSource = avdt.DefaultView.ToTable(); Arrive_Disable_RPT.DataBind(); } else { arrive_empty_div.Visible = true; } }
public void MyBind() { DataTable dt = new DataTable(); M_UserInfo mu = buser.GetLogin(); switch (SType) { case 0: //订单 orderMod = orderBll.SelModelByOrderNo(OrderNo); //Total_L.Text = orderMod.Balance_price.ToString("f2") + "+" + orderMod.Freight.ToString("f2") + "=" + orderMod.Ordersamount.ToString("f2") + "元 (金额+运费)"; labelmoney01.Text = orderMod.Receivablesamount.ToString("f2"); ExpressNum_T.Text = orderMod.ExpressNum; ExpressDelivery_T.Text = orderMod.ExpressDelivery; if (orderMod == null || orderMod.id == 0) { function.WriteErrMsg("订单不存在"); } if (orderMod.Userid != mu.UserID) { function.WriteErrMsg("该订单不属于你,无法查看"); } dt = SelByOrderID(orderMod.id); price = orderMod.Balance_price; fare = orderMod.Freight; allamount = orderMod.Ordersamount; DataTable dt1 = SqlHelper.ExecuteTable("select * from ZL_Payment where PaymentNum='" + orderMod.OrderNo + "' order by PayTime DESC"); if (dt1.Rows.Count > 0) { payMod = payBll.SelModelByPayNo(dt1.Rows[0]["PayNo"].ToString()); allamount = (double)payMod.MoneyPay; arrive = payMod.ArriveMoney; point = payMod.UsePoint; } Total_L.Text = price.ToString("f2") + " + " + fare.ToString("f2") + " - " + arrive.ToString("f2") + "-" + (point * 0.01).ToString("f2") + "(" + point + ")" + " = " + allamount.ToString("f2"); Total_L.Text = Total_L.Text + " (商品总价+运费-优惠券-积分兑换=总额)"; break; case 1: //购物车 dt = cartBll.GetCarProList(OrderNo); break; } if (orderMod.Paymentstatus != (int)M_OrderList.PayEnum.HasPayed) { PayUrl_A.Visible = true; DataTable dt1 = SqlHelper.ExecuteTable("select * from ZL_Payment where PaymentNum='" + orderMod.OrderNo + "' order by PayTime DESC"); string payurl = "&OrderCode=" + orderMod.OrderNo; if (dt1.Rows.Count > 0) { payurl = "&PayNo=" + dt1.Rows[0]["PayNo"]; } uappMod = uappBll.SelModelByUid(buser.GetLogin().UserID, "wechat"); if (uappMod != null) { M_WX_User wxuserMod1 = wxuserBll.SelForOpenid(1, uappMod.OpenID); M_WX_User wxuserMod2 = wxuserBll.SelForOpenid(2, uappMod.OpenID); if (wxuserMod1 != null && wxuserMod2 == null) { PayUrl_A.HRef = "/PayOnline/OrderPay.aspx?appid=1" + payurl; } else if (wxuserMod2 != null && wxuserMod1 == null) { PayUrl_A.HRef = "/PayOnline/OrderPay.aspx?appid=2" + payurl; } else if (wxuserMod1 == null && wxuserMod2 == null) { PayUrl_A.HRef = "/PayOnline/OrderPay.aspx?" + payurl; } } else { PayUrl_A.HRef = "/PayOnline/OrderPay.aspx?" + payurl; } } if (dt.Rows.Count > 0 && !string.IsNullOrEmpty(dt.Rows[0]["Additional"].ToString())) { User_Div.Visible = true; M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(dt.Rows[0]["Additional"].ToString()); List <M_Cart_Contract> modelList = new List <M_Cart_Contract>(); modelList.AddRange(model.Guest); modelList.AddRange(model.Contract); UserRPT.DataSource = modelList; UserRPT.DataBind(); } pronum = dt.Rows.Count; RPT.DataSource = dt; RPT.DataBind(); }
public void MyBind() { StringWriter sw = new StringWriter(); M_UserInfo mu = buser.GetLogin(false); CartDT = cartBll.SelByCartID(B_Cart.GetCartID(), mu.UserID, ProClass, ids); if (CartDT.Rows.Count < 1) { function.WriteErrMsg("你尚未选择商品,<a href='/User/Order/OrderList'>查看我的订单</a>"); } #region 旅游,酒店等不需要检测地址栏 switch (DataConvert.CLng(CartDT.Rows[0]["ProClass"])) { case (int)M_Product.ClassType.LY: { userli.Visible = true; M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(CartDT.Rows[0]["Additional"].ToString()); model.Guest.AddRange(model.Contract); UserRPT.DataSource = model.Guest; UserRPT.DataBind(); } break; case (int)M_Product.ClassType.JD: { userli.Visible = true; M_Cart_Hotel model = JsonConvert.DeserializeObject <M_Cart_Hotel>(CartDT.Rows[0]["Additional"].ToString()); model.Guest.AddRange(model.Contract); UserRPT.DataSource = model.Guest; UserRPT.DataBind(); } break; default: //------地址 break; } #endregion //------核算费用 allmoney = UpdateCartAllMoney(CartDT); //------费用统计 itemnum_span.InnerText = CartDT.Rows.Count.ToString(); totalmoney_span1.InnerText = allmoney.ToString("f2"); //------店铺 Store_RPT.DataSource = orderCom.SelStoreDT(CartDT); Store_RPT.DataBind(); //------发票绑定 Server.Execute("/Cart/Comp/Invoice.aspx", sw); Invoice_Lit.Text = sw.ToString(); sw = new StringWriter(); //------积分抵扣 { int usepoint = Point_CanBeUse(allmoney); if (usepoint > 0) { point_body.Visible = true; Point_L.Text = mu.UserExp.ToString(); //int usepoint = (int)(allmoney * (SiteConfig.ShopConfig.PointRatiot * 0.01)); function.Script(this, "SumByPoint(" + usepoint + ");"); PointRate_Hid.Value = SiteConfig.ShopConfig.PointRate.ToString("F2"); } else { point_tips.Visible = true; } } //------优惠券 Server.Execute("/Cart/Comp/ArriveList.aspx?allmoney=" + allmoney + "&ids=" + ids, sw); Arrive_Lit.Text = sw.ToString(); }