/// <summary> /// 根据ID得到订单号 /// </summary> /// <param name="id"></param> /// <returns></returns> protected string GetOrderId(int id) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model = bll.GetModel(id); if (model != null) { return model.OrderId; } else { return string.Empty; } }
/// <summary> /// 列表 /// </summary> /// <returns></returns> protected string GetList() { ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table(); ShowShop.BLL.Order.OrderProduct bll = new ShowShop.BLL.Order.OrderProduct(); ShowShop.BLL.Order.Orders orderBll = new ShowShop.BLL.Order.Orders(); ChangeHope.DataBase.DataByPage dataPage = bll.GetListByPage(); //第一步先添加表头 table.AddHeadCol("", "订单号"); table.AddHeadCol("", "用户账号"); table.AddHeadCol("", "收货人"); table.AddHeadCol("", "商品名称"); table.AddHeadCol("", "实际价格"); table.AddHeadCol("", "下单时间"); table.AddHeadCol("", "状态"); table.AddRow(); //添加表的内容 if (dataPage.DataReader != null) { while (dataPage.DataReader.Read()) { ShowShop.Model.Order.Orders orderModel = orderBll.GetModel(Convert.ToInt32(dataPage.DataReader["OrderId"].ToString())); if (orderModel != null) { table.AddCol(orderModel.OrderId); table.AddCol(orderModel.UserId); table.AddCol(orderModel.ConsigneeName); table.AddCol(dataPage.DataReader["ProName"].ToString()); table.AddCol(dataPage.DataReader["ProPrice"].ToString()); table.AddCol(orderModel.OrderDate.ToString()); table.AddCol(this.ShowStatu(orderModel.OrderStatus)); table.AddRow(); } } } string view = table.GetTable() + dataPage.PageToolBar; dataPage.Dispose(); dataPage = null; return view; }
protected void lbtnSave_Click(object sender, EventArgs e) { ShowShop.Model.Order.ConsignMent model = new ShowShop.Model.Order.ConsignMent(); ShowShop.BLL.Order.ConsignMent bll = new ShowShop.BLL.Order.ConsignMent(); ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get(); model.OrderId = this.lblOrderId.Text; model.UserName = this.lblUserName.Text; model.ConsignMentDate = Convert.ToDateTime(this.txtConsignMentDate.Text); model.ExpressCompany = this.ddlExpressCompany.SelectedItem.Text; model.ExpressOddNumbers = this.txtExpressOddNumbers.Text; model.ConsignMentPeople = this.txtConsignMentPeople.Text; model.Remark = this.txtRemark.Text; model.BosomNote = this.txtBosomNote.Text; model.InformMode = GetInforMode(cbxInformMode)["txt"]; //通知方式 model.NoteDate = DateTime.Now; model.NoteName = adminInfo.AdminName; model.Received = ShowShop.Common.OrdersStatusEnum.OgisticsStatus.已发货.GetHashCode(); model.ConsignMentType = 0;//类型 发货 #region 订单状态 ShowShop.BLL.Order.Orders orderBll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders orderModel = orderBll.GetModel(this.lblOrderId.Text); #endregion try { bll.Add(model); #region 操作订单状态 int OrderId = ChangeHope.WebPage.PageRequest.GetQueryInt("OrderId"); orderBll.Amend(OrderId, "OgisticsStatus", ShowShop.Common.OrdersStatusEnum.OgisticsStatus.已发货.GetHashCode()); #endregion ChangeHope.WebPage.BasePage.PageRight("已保存该信息.", "order_bank_pay.aspx?OrderId=" + orderModel.Id, "<li><a href='order_order_info.aspx?OrderId=" + orderModel.Id.ToString() + "'>返回信息页</a></li>"); return; } catch { this.ltlMsg.Text = "操作失败!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; } finally { bll = null; model = null; } }
private void OrderInfo(int id) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model=bll.GetModel(id); if (model != null) { ShowShop.BLL.Member.MemberAccount mabll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount mamodel = mabll.GetModel(model.UserId); if (mamodel != null) { this.lbUserName.Text = "<a href='../member/member_view.aspx?uid=" + mamodel.UID + "'>" + model.UserId + "</a>"; } else { this.lbUserName.Text = model.UserId ; } this.lbName.Text = model.ConsigneeName; this.blOrderNo.Text = model.OrderId; ShowShop.Common.OrdersStatusEnum ose = new ShowShop.Common.OrdersStatusEnum(); this.lbOrderStatue.Text = ose.OrderStatus(model.OrderStatus); this.lbLogisticsStatus.Text = ose.OgisticsStatu(model.OgisticsStatus); this.lbPayment.Text = ose.PaymentStatus(model.PaymentStatus); this.lbOrderDateTime.Text = model.OrderDate.ToString(); this.lbConsigneeName.Text = model.ConsigneeName; this.lbConsigneeAddress.Text = model.ConsigneeAddress; this.lbConsigneeEmail.Text = model.ConsigneeEmail; this.lbConsigneeModile.Text = model.ConsigneePhone; this.lbConsigneeTel.Text = model.ConsigneeTel; this.lbConsigneeZip.Text = model.ConsigneeZip; this.lbConstructionSigns.Text = model.ConsigneeRealName; this.lbConsigneTime.Text = model.ConsigneeFax; this.lbPaymentMode.Text = Payments(model.PaymentType); this.lbDeliveryMode.Text = this.Courier(int.Parse(model.Carriage.ToString())); this.lbOrderTotalPrice.Text =Convert.ToDouble(model.FactPrice).ToString("f2"); this.lbCarriage.Text = Convert.ToDouble(model.Courier).ToString("f4"); this.lbpaid.Text = GetPayed(model.OrderId.ToString()); } }
private void InitWebControl(int id) { ShowShop.BLL.Order.Orders ordbll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders ordmodel = ordbll.GetModel(id); int OrderStatus = 0; int PaymentStatus = 0; int OgisticsStatus = 0; int IsOrderNormul = 0; if (ordmodel != null) { OrderStatus = int.Parse(ordmodel.OrderStatus.ToString()); PaymentStatus = int.Parse(ordmodel.PaymentStatus.ToString()); OgisticsStatus = int.Parse(ordmodel.OgisticsStatus.ToString()); IsOrderNormul=int.Parse(ordmodel.IsOrderNormal.ToString()); } #region 订单状态 if (IsOrderNormul == 0) { this.hlSuspendHandleOrder.Enabled = false; this.hlResumeNormal.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=goon"; } else if (IsOrderNormul == 1) { this.hlSuspendHandleOrder.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=stop"; this.hlResumeNormal.Enabled = false; } switch (OrderStatus) { case 0: this.hlModfiyOrder.NavigateUrl = "order_modify.aspx?OrderId=" + id + ""; this.hlConfirmOrder.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=confirm"; this.hlCancelConfirm.Enabled = false; this.hlOrderInvalidated.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=invalid"; this.hlBankPayment.Enabled = false; this.hlFuturePayment.Enabled = false; this.hlCash.Enabled = false; this.hlRefundment.Enabled = false; this.hlConsignment.Enabled = false; this.hlReturned.Enabled = false; this.hlSquare.Enabled = false; this.hlSign.Enabled = false; this.hlDel.Enabled = false; break; case 1: this.hlModfiyOrder.NavigateUrl = "order_modify.aspx?OrderId=" + id + ""; this.hlConfirmOrder.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=confirm"; this.hlCancelConfirm.Enabled = false; this.hlOrderInvalidated.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=invalid"; this.hlBankPayment.Enabled = false; this.hlFuturePayment.Enabled = false; this.hlCash.Enabled = false; this.hlRefundment.Enabled = false; this.hlConsignment.Enabled = false; this.hlReturned.Enabled = false; this.hlSquare.Enabled = false; this.hlSign.Enabled = false; this.hlDel.Enabled = false; break; case 2: this.hlModfiyOrder.Enabled = false; this.hlConfirmOrder.Enabled = false; this.hlCancelConfirm.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=cancel"; this.hlOrderInvalidated.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=invalid"; if (PaymentStatus == 1) { this.hlBankPayment.Enabled = false; this.hlFuturePayment.Enabled = false; this.hlCash.Enabled = false; this.hlConsignment.NavigateUrl = "order_consignment.aspx?OrderId=" + id + ""; this.hlRefundment.NavigateUrl = "order_refundment.aspx?OrderId=" + id + ""; } else { this.hlBankPayment.NavigateUrl = "order_bank_pay.aspx?OrderId=" + id + ""; this.hlFuturePayment.NavigateUrl = "order_pre_pay.aspx?OrderId=" + id + ""; this.hlCash.NavigateUrl = "order_cash_pay.aspx?OrderId=" + id + ""; this.hlConsignment.Enabled = false; this.hlRefundment.Enabled = false; } this.hlReturned.Enabled = false; this.hlSquare.Enabled = false; this.hlSign.Enabled = false; this.hlDel.Enabled = false; break; case 6: this.hlModfiyOrder.NavigateUrl = "order_modify.aspx?OrderId=" + id + ""; this.hlConfirmOrder.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=confirm"; this.hlCancelConfirm.Enabled = false; this.hlOrderInvalidated.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=invalid"; this.hlBankPayment.Enabled = false; this.hlFuturePayment.Enabled = false; this.hlCash.Enabled = false; this.hlRefundment.Enabled = false; this.hlConsignment.Enabled = false; this.hlReturned.Enabled = false; this.hlSquare.Enabled = false; this.hlSign.Enabled = false; this.hlDel.Enabled = false; break; case 4: this.hlModfiyOrder.Enabled = false; this.hlConfirmOrder.Enabled = false; this.hlOrderInvalidated.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=invalid"; if (PaymentStatus==1) { this.hlBankPayment.Enabled = false; this.hlFuturePayment.Enabled = false; this.hlCash.Enabled = false; this.hlConsignment.NavigateUrl = "order_consignment.aspx?OrderId=" + id + ""; } else { this.hlBankPayment.NavigateUrl = "order_bank_pay.aspx?OrderId=" + id + ""; this.hlFuturePayment.NavigateUrl = "order_pre_pay.aspx?OrderId=" + id + ""; this.hlCash.NavigateUrl = "order_cash_pay.aspx?OrderId=" + id + ""; this.hlConsignment.Enabled = false; } this.hlRefundment.NavigateUrl = "order_refundment.aspx?OrderId=" + id + ""; this.hlDel.Enabled = false; #region 配送状态 if (OgisticsStatus == 1) { this.hlSquare.Enabled = false; this.hlConsignment.Enabled = false; this.hlReturned.NavigateUrl = "order_back_consignment.aspx?OrderId=" + id + ""; this.hlSign.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=cusover"; } else if (OgisticsStatus == 2) { this.hlSquare.NavigateUrl = "order_order_info.aspx?OrderId=" + id + "&option=over"; this.hlSign.Enabled = false; } else { this.hlSquare.Enabled = false; this.hlReturned.Enabled = false; } #endregion break; default: this.hlModfiyOrder.Enabled = false; this.hlConfirmOrder.Enabled = false; this.hlCancelConfirm.Enabled = false; this.hlOrderInvalidated.Enabled = false; this.hlSuspendHandleOrder.Enabled = false; this.hlResumeNormal.Enabled = false; this.hlBankPayment.Enabled = false; this.hlFuturePayment.Enabled = false; this.hlCash.Enabled = false; this.hlRefundment.Enabled = false; this.hlConsignment.Enabled = false; this.hlReturned.Enabled = false; this.hlSquare.Enabled = false; this.hlSign.Enabled = false; this.hlDel.Enabled = false; break; } #endregion }
private void HandleOrder(int id) { ShowShop.BLL.Order.Orders ordersbll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders ordersModel = ordersbll.GetModel(id); if (ordersModel != null) { ShowShop.BLL.Order.OrderProduct orderProductbll = new ShowShop.BLL.Order.OrderProduct(); DataTable orderProductDT = orderProductbll.GetListOrderProduct(id.ToString()); ShowShop.BLL.Member.MemberAccount memberaccountbll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount memberaccounModel = memberaccountbll.GetModel(ordersModel.UserId); // ShowShop.BLL.Product.ProductSpecification spebll = new ShowShop.BLL.Product.ProductSpecification(); decimal DonateIntegral = 0; if (orderProductDT.Rows.Count > 0) { ShowShop.BLL.Product.ProductInfo productinfoBll = new ShowShop.BLL.Product.ProductInfo(); for (int i = 0; i < orderProductDT.Rows.Count; i++) { ShowShop.Model.Product.ProductInfo productInfoModel = productinfoBll.GetModel(Convert.ToInt32(orderProductDT.Rows[i]["ProId"].ToString())); if (productInfoModel != null) { // DonateIntegral += Convert.ToDecimal(productInfoModel.pro_DonateIntegral); // productinfoBll.Amend(productInfoModel.pro_ID, "pro_SaleNum", productInfoModel.pro_SaleNum + Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString())); if (!string.IsNullOrEmpty(orderProductDT.Rows[i]["Specification"].ToString())) { // List<ShowShop.Model.Product.ProductSpecification> spcList = spebll.GetSpecification(" and ProductId=" + orderProductDT.Rows[i]["ProId"].ToString() + " and Specifications='" + orderProductDT.Rows[i]["Specification"].ToString() + "'"); // if (spcList.Count > 0) // { // spebll.Amend(spcList[0].Id, "ProductStock", Convert.ToInt32(spcList[0].ProductStock) - Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString())); // } } else { //if (Convert.ToInt32(productInfoModel.pro_Stock) >= Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString())) { // productinfoBll.Amend(productInfoModel.pro_ID, "pro_Stock", Convert.ToInt32(productInfoModel.pro_Stock) - Convert.ToInt32(orderProductDT.Rows[i]["ProNum"].ToString())); } } } } //购买商品赠送积分 if (memberaccounModel != null) { if (DonateIntegral > 0) { if (memberaccountbll.Amend(memberaccounModel.UID, "Points", memberaccounModel.Points + DonateIntegral) > 0) { ShowShop.BLL.Member.Integral integralBll = new ShowShop.BLL.Member.Integral(); ShowShop.Model.Member.Integral integral = new ShowShop.Model.Member.Integral(); integral.Userid = memberaccounModel.UID; integral.OrderId = ordersModel.OrderId; integral.IntegralClass = 1; integral.IntegralNum = memberaccounModel.Points + DonateIntegral; integral.GainDate = Convert.ToDateTime(System.DateTime.Now); integral.NoteDate = Convert.ToDateTime(System.DateTime.Now); integral.NoteName = "系统"; integral.Remark = "购买商品后赠送的积分"; integral.IntegralStatus = 0; integral.Origin = "订单"; integralBll.Add(integral); } } } } } }
protected void Page_Load(object sender, EventArgs e) { ShowShop.Common.PromptInfo.Popedom("005001001"); #region 删除反馈信息 if (ChangeHope.WebPage.PageRequest.GetFormString("LeaveOption") != string.Empty && ChangeHope.WebPage.PageRequest.GetFormInt("id") > 0) { string types = Request.Form["LeaveOption"].Trim(); int leaveId = ChangeHope.WebPage.PageRequest.GetFormInt("id"); if (types == "delleave") { this.DeleteLeave(leaveId.ToString()); } Response.End(); return; } #endregion int id = ChangeHope.WebPage.PageRequest.GetQueryInt("OrderId"); #region 订单操作 string option = ChangeHope.WebPage.PageRequest.GetQueryString("option"); if (option != string.Empty && id > 0) { ShowShop.BLL.Order.Orders orderBll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders orderModel = orderBll.GetModel(id); //删除操作 if (option == "del") { ShowShop.Common.PromptInfo.Popedom("005001003","对不起,您没有权限进行删除"); DeleteOrder(id.ToString()); } //结清订单 else if (option == "over") { ShowShop.Common.PromptInfo.Popedom("005001010","对不起,您没有该权限"); int Status=ShowShop.Common.OrdersStatusEnum.OrderStatu.已结清.GetHashCode(); this.HandleOrder(id); ModfiyOrderStatus(id, "OrderStatus", Status, "订单已经结清。"); } //确认订单 else if (option == "confirm") { ShowShop.Common.PromptInfo.Popedom("005001005","对不起,您没有该权限"); int Status = ShowShop.Common.OrdersStatusEnum.OrderStatu.已经确认.GetHashCode(); ModfiyOrderStatus(id, "OrderStatus", Status, "订单已经确认。"); } //取消 else if (option == "cancel") { ShowShop.Common.PromptInfo.Popedom("005001006","对不起,您没有该权限"); int Status = ShowShop.Common.OrdersStatusEnum.OrderStatu.取消确认.GetHashCode(); ModfiyOrderStatus(id, "OrderStatus", Status, "订单已经取消确认。"); } //订单作废 else if (option == "invalid") { ShowShop.Common.PromptInfo.Popedom("005001007","对不起,您没有该权限"); int Status = ShowShop.Common.OrdersStatusEnum.OrderStatu.已经作废.GetHashCode(); ModfiyOrderStatus(id, "OrderStatus", Status, "订单已经作废。"); } //暂停处理 else if (option == "stop") { ShowShop.Common.PromptInfo.Popedom("005001008","对不起,您没有该权限"); int Status = 0; ModfiyOrderStatus(id, "IsOrderNormal", Status, "订单已经暂停处理。"); } //回复正常 else if (option == "goon") { ShowShop.Common.PromptInfo.Popedom("005001009","对不起,您没有该权限"); int Status = 1; ModfiyOrderStatus(id, "IsOrderNormal", Status, "订单已经回复正常。"); } //客户已签收 else if (option == "cusover") { ShowShop.Common.PromptInfo.Popedom("005001011","对不起,您没有该权限"); int Status = ShowShop.Common.OrdersStatusEnum.OgisticsStatus.已签收.GetHashCode(); ModfiyOrderStatus(id, "OgisticsStatus", Status, "订单客户已经签收。"); } return; } #endregion if (!IsPostBack) { if (id > 0) { this.InitWebControl(id); this.OrderInfo(id); this.OrdersProduct(id); this.lblMoneyList.Text = this.GetMoneyList(this.blOrderNo.Text.Trim()); this.lblConsignList.Text = this.GetConsignList(this.blOrderNo.Text.Trim()); this.lblTransList.Text = this.GetTransList(this.blOrderNo.Text.Trim()); this.lblOrderLeaveList.Text = this.GetOrderLeaveList(this.blOrderNo.Text.Trim()); } } }
protected void Page_Load(object sender, EventArgs e) { if (ChangeHope.WebPage.PageRequest.GetFormString("Option") != string.Empty) { string types = Request["Option"].Trim(); string id = ChangeHope.WebPage.PageRequest.GetFormString("Id"); if (types == "ModifyPrice") { string price = ChangeHope.WebPage.PageRequest.GetFormString("Price"); ShowShop.BLL.Order.OrderProduct bll = new ShowShop.BLL.Order.OrderProduct(); ShowShop.Model.Order.OrderProduct orderProductModel = bll.GetModel(Convert.ToInt32(id)); if (orderProductModel != null) { ShowShop.BLL.Order.Orders ordbll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders ordModel = ordbll.GetModel(Convert.ToInt32(orderProductModel.OrderId)); if (ordModel != null) { if (Convert.ToDecimal(orderProductModel.ProPrice) > Convert.ToDecimal(price)) { decimal productPrice = Convert.ToDecimal(orderProductModel.ProPrice) - Convert.ToDecimal(price); ordbll.Amend(ordModel.Id, "TotalPrice", Convert.ToDecimal(ordModel.TotalPrice) - (Convert.ToDecimal(orderProductModel.ProNum) * Convert.ToDecimal(productPrice))); ordbll.Amend(ordModel.Id, "FactPrice", Convert.ToDecimal(ordModel.FactPrice) - (Convert.ToDecimal(orderProductModel.ProNum) * Convert.ToDecimal(productPrice))); } else { decimal productPrice = Convert.ToDecimal(price) - Convert.ToDecimal(orderProductModel.ProPrice); ordbll.Amend(ordModel.Id, "TotalPrice", Convert.ToDecimal(ordModel.TotalPrice) + (Convert.ToDecimal(orderProductModel.ProNum) * Convert.ToDecimal(productPrice))); ordbll.Amend(ordModel.Id, "FactPrice", Convert.ToDecimal(ordModel.FactPrice) + (Convert.ToDecimal(orderProductModel.ProNum) * Convert.ToDecimal(productPrice))); } if (bll.Amend(Convert.ToInt32(id), "ProPrice", price) != 1) { Response.Write("ok"); } } } } else if (types == "ModifyCount") { string Count = ChangeHope.WebPage.PageRequest.GetFormString("Count"); ShowShop.BLL.Order.OrderProduct bll = new ShowShop.BLL.Order.OrderProduct(); ShowShop.Model.Order.OrderProduct orderProductModel = bll.GetModel(Convert.ToInt32(id)); if (orderProductModel != null) { ShowShop.BLL.Order.Orders ordbll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders ordModel = ordbll.GetModel(Convert.ToInt32(orderProductModel.OrderId)); if (ordModel != null) { if (Convert.ToInt32(orderProductModel.ProNum) > Convert.ToInt32(Count)) { int productCount = Convert.ToInt32(orderProductModel.ProNum) - Convert.ToInt32(Count); ordbll.Amend(ordModel.Id, "TotalPrice", Convert.ToDecimal(ordModel.TotalPrice) - (Convert.ToDecimal(orderProductModel.ProPrice) * Convert.ToDecimal(productCount))); ordbll.Amend(ordModel.Id, "FactPrice", Convert.ToDecimal(ordModel.FactPrice) - (Convert.ToDecimal(orderProductModel.ProPrice) * Convert.ToDecimal(productCount))); } else { int productCount = Convert.ToInt32(Count) - Convert.ToInt32(orderProductModel.ProNum); ordbll.Amend(ordModel.Id, "TotalPrice", Convert.ToDecimal(ordModel.TotalPrice) + (Convert.ToDecimal(orderProductModel.ProPrice) * Convert.ToDecimal(productCount))); ordbll.Amend(ordModel.Id, "FactPrice", Convert.ToDecimal(ordModel.FactPrice) + (Convert.ToDecimal(orderProductModel.ProPrice) * Convert.ToDecimal(productCount))); } if (bll.Amend(Convert.ToInt32(id), "ProNum", Count) != 1) { Response.Write("ok"); } } } } else if (types == "DelProduct") { string OrderID = ChangeHope.WebPage.PageRequest.GetFormString("OrderID"); ShowShop.BLL.Order.OrderProduct bll = new ShowShop.BLL.Order.OrderProduct(); DataTable dt = bll.GetListOrderProduct(OrderID.Trim()); if (dt.Rows.Count > 1) { ShowShop.Model.Order.OrderProduct orderProductModel = bll.GetModel(Convert.ToInt32(id)); if (orderProductModel != null) { ShowShop.BLL.Order.Orders ordbll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders ordModel = ordbll.GetModel(Convert.ToInt32(OrderID)); if (ordModel != null) { ordbll.Amend(ordModel.Id, "TotalPrice", Convert.ToDecimal(ordModel.TotalPrice) - (Convert.ToDecimal(orderProductModel.ProPrice)*Convert.ToDecimal(orderProductModel.ProNum))); ordbll.Amend(ordModel.Id, "FactPrice", Convert.ToDecimal(ordModel.FactPrice) - (Convert.ToDecimal(orderProductModel.ProPrice) * Convert.ToDecimal(orderProductModel.ProNum))); bll.Delete(Convert.ToInt32(id)); } } } else { Response.Write("删除失败,该订单删除后没有商品列表!"); } } Response.End(); } int orderId = ChangeHope.WebPage.PageRequest.GetQueryInt("OrderId"); if (!IsPostBack) { this.DeliverBind(); this.OrderInfo(orderId); this.OrdersProduct(orderId); } }
/// <summary> /// 订单信息初始化 /// </summary> protected void OrderInfoBind(string orderId) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model = bll.GetModel(orderId); if (model != null) { this.lblUserId.Text = model.ConsigneeName; this.lblUserName.Text = model.UserId; this.lblOrderId.Text = model.OrderId; this.lblMoneyPayed.Text = GetPayed(model.OrderId);//已付款 this.lblMoneyCount.Text = Convert.ToDouble(model.FactPrice).ToString("f2"); //订单总金额 this.txtPayoutMoney.Text = (( Convert.ToDouble(model.FactPrice.ToString())) - Convert.ToDouble(this.lblMoneyPayed.Text)).ToString(); //需要再支付的金额 this.txtRemark.Text = model.Remark; } }
protected void lbtnSave_Click(object sender, EventArgs e) { /*修改人:YM *修改时间:2009-12-17 *判断订单是否是会员订单及用户是否存在 */ if (this.lblUserName.Text.Trim() == "") { this.ltlMsg.Text = "操作失败!您所支付的订单可能是非会员生成的订单."; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get(); ShowShop.BLL.Member.MemberAccount memberBll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount memberModel = memberBll.GetModel(this.lblUserName.Text); if (memberModel == null) { this.ltlMsg.Text = "操作失败!该会员不存在."; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } #region 订单预付款资金 ShowShop.Model.Order.PrepayMoney preModel = new ShowShop.Model.Order.PrepayMoney(); ShowShop.BLL.Order.PrepayMoney preBll = new ShowShop.BLL.Order.PrepayMoney(); preModel.OrderId = this.lblOrderId.Text; preModel.UserName = this.lblUserName.Text; preModel.PayoutMoney = Convert.ToDecimal(this.txtPayoutMoney.Text.Trim()); preModel.Remark = this.txtRemark.Text; preModel.BosomNote = this.txtBosomNote.Text; preModel.NoteDate = DateTime.Now; preModel.NoteName = adminInfo.AdminName; #endregion #region 用户交易明细 ShowShop.Model.Member.UserinAndExp userModel = new ShowShop.Model.Member.UserinAndExp(); ShowShop.BLL.Member.UserinAndExp userBll = new ShowShop.BLL.Member.UserinAndExp(); //资金的明细 userModel.UID = memberModel.UID; userModel.AdsumMoneyDate = Convert.ToDateTime(this.txtAdsumMoneyDate.Text); userModel.AdsumMoney = Convert.ToDecimal(this.txtPayoutMoney.Text); userModel.PresentCoupons = 0; userModel.RemitMode = 2; userModel.RemitBank = string.Empty; userModel.Remark = this.txtRemark.Text; userModel.FormMode = string.Empty; //通知方式 userModel.BosomNote = this.txtBosomNote.Text; userModel.NoteDate = DateTime.Now; userModel.NoteName = adminInfo.AdminName; userModel.InComeandExpState = 1; userModel.State = 0; userModel.UserId = this.lblUserName.Text; #endregion #region 订单状态 ShowShop.BLL.Order.Orders orderBll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders orderModel = orderBll.GetModel(this.lblOrderId.Text); #endregion ShowShop.BLL.Member.MemberAccount mabll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount mamodel = mabll.GetModel(this.lblUserName.Text); try { //已付款+此次汇款的总和 decimal payTotail = Convert.ToDecimal(this.GetPayed(this.lblOrderId.Text)) + Convert.ToDecimal(this.txtPayoutMoney.Text.Trim()); #region 如果有多余的钱 if (payTotail > Convert.ToDecimal(orderModel.FactPrice)) { ChangeHope.WebPage.BasePage.PageError("输入的金额大于了订单总额!", "order_bank_pay.aspx?OrderId=" + orderModel.Id); return; } #endregion #region 查询用户金额 操作用户金额 if (mamodel != null) { decimal Price = decimal.Parse(mamodel.Capital.ToString()); if (Convert.ToDecimal(this.txtPayoutMoney.Text) > Price) { ChangeHope.WebPage.BasePage.PageError("用户余额不足!", "order_bank_pay.aspx?OrderId=" + orderModel.Id); return; } mabll.Amend(mamodel.UID, "Capital", (Convert.ToDecimal(mamodel.Capital.ToString()) - Convert.ToDecimal(this.txtPayoutMoney.Text))); } #endregion preBll.Add(preModel); userBll.Add(userModel); #region 操作付款状态 订单状态 int OrderId = ChangeHope.WebPage.PageRequest.GetQueryInt("OrderId"); if (payTotail >= Convert.ToDecimal(orderModel.FactPrice)) { if (OrderId > 0) { orderBll.Amend(OrderId, "OrderStatus", ShowShop.Common.OrdersStatusEnum.OrderStatu.未结清.GetHashCode()); orderBll.Amend(OrderId, "PaymentStatus", ShowShop.Common.OrdersStatusEnum.PaymentStatu.已经付清.GetHashCode()); orderBll.Amend(OrderId, "OgisticsStatus", ShowShop.Common.OrdersStatusEnum.OgisticsStatus.配送中.GetHashCode()); } } else { if (OrderId > 0) { orderBll.Amend(OrderId, "OrderStatus", ShowShop.Common.OrdersStatusEnum.OrderStatu.未结清.GetHashCode()); orderBll.Amend(OrderId, "PaymentStatus", ShowShop.Common.OrdersStatusEnum.PaymentStatu.未付清.GetHashCode()); } } #endregion ChangeHope.WebPage.BasePage.PageRight("已保存该信息", "order_bank_pay.aspx?OrderId=" + orderModel.Id); } catch { this.ltlMsg.Text = "操作失败!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; } finally { adminInfo = null; preModel = null; preBll = null; orderBll = null; orderModel = null; GC.Collect(); } }
protected void lbtnSave_Click(object sender, EventArgs e) { ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get(); if (Convert.ToDecimal(this.txtRefundmentMoney.Text.Trim()) + Convert.ToDecimal(this.txtPoundAge.Text.Trim()) > Convert.ToDecimal(GetPayed(this.lblOrderId.Text))) { this.ltlMsg.Text = "退款的金额不能大于已付的金额!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } //银行支付 ShowShop.BLL.Order.RemittanceInfo remBll = new ShowShop.BLL.Order.RemittanceInfo(); ShowShop.Model.Order.RemittanceInfo remModel = remBll.GetModelByOrderId(this.lblOrderId.Text); //现金支付 ShowShop.BLL.Order.PaymentMoney payBll = new ShowShop.BLL.Order.PaymentMoney(); ShowShop.Model.Order.PaymentMoney payModel = payBll.GetModelByOrderId(this.lblOrderId.Text); //预付款 ShowShop.BLL.Order.PrepayMoney preBll = new ShowShop.BLL.Order.PrepayMoney(); ShowShop.Model.Order.PrepayMoney preModel = preBll.GetModelByOrderId(this.lblOrderId.Text); //订单信息 ShowShop.BLL.Order.Orders orderBll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders orderModel = orderBll.GetModel(this.lblOrderId.Text); #region 退款信息 ShowShop.BLL.Order.RefundMent refBll = new ShowShop.BLL.Order.RefundMent(); ShowShop.Model.Order.RefundMent refModel = new ShowShop.Model.Order.RefundMent(); refModel.OrderId = this.lblOrderId.Text; refModel.UserName = this.lblUserId.Text; refModel.PaymentDate = Convert.ToDateTime(this.txtPaymentDate.Text); refModel.PoundAge = Convert.ToDecimal(this.txtPoundAge.Text.Trim()); refModel.RefundMentMoney = Convert.ToDecimal(this.txtRefundmentMoney.Text.Trim()); refModel.RefundMentMode = this.rabRefundmentMode.SelectedItem.Text; refModel.Remark = this.txtRemark.Text; refModel.InformMode = GetInforMode(cbxInformMode)["txt"]; //通知方式 refModel.NoteDate = DateTime.Now; refModel.NoteName = adminInfo.AdminName; #endregion #region 用户交易明细 ShowShop.Model.Member.UserinAndExp userModel = new ShowShop.Model.Member.UserinAndExp(); ShowShop.BLL.Member.UserinAndExp userBll = new ShowShop.BLL.Member.UserinAndExp(); //银行资金的明细 userModel.UID = this.GetUidByUserId(this.lblUserId.Text); userModel.AdsumMoneyDate = Convert.ToDateTime(this.txtPaymentDate.Text); userModel.AdsumMoney = Convert.ToDecimal(this.txtRefundmentMoney.Text); userModel.PresentCoupons = 0; userModel.RemitMode = 1; userModel.RemitBank = string.Empty; userModel.Remark = this.txtRemark.Text; userModel.FormMode = GetInforMode(cbxInformMode)["txt"]; //通知方式 userModel.BosomNote = this.txtBosomNote.Text; userModel.NoteDate = DateTime.Now; userModel.NoteName = adminInfo.AdminName; userModel.InComeandExpState = 0; userModel.State = 0; userModel.UserId = this.lblUserId.Text; #endregion try { if (refModel.RefundMentMoney == orderModel.FactPrice)//如果退款和订单价 匹配 { remBll.Delete(remModel.ID.ToString()); payBll.Delete(payModel.ID.ToString()); preBll.Delete(preModel.ID.ToString()); } else { if (remModel.RemittanceMoney > 0) //银行汇款 { if (remModel.RemittanceMoney <= refModel.RefundMentMoney) { remBll.Delete(remModel.ID.ToString()); } else { remModel.RemittanceMoney = remModel.RemittanceMoney - refModel.RefundMentMoney; remBll.Amend(remModel); } } if (preModel.PayoutMoney > 0) //预付款 { if (preModel.PayoutMoney <= refModel.RefundMentMoney) { preBll.Delete(preModel.ID.ToString()); } else { preModel.PayoutMoney = (preModel.PayoutMoney + remModel.RemittanceMoney) - refModel.RefundMentMoney; preBll.Amend(preModel); } } if (payModel.GatheringMoney > 0) //现金支付 { if (payModel.GatheringMoney == (refModel.RefundMentMoney - remModel.RemittanceMoney - preModel.PayoutMoney)) { payBll.Delete(payModel.ID.ToString()); } else { payModel.GatheringMoney = (remModel.RemittanceMoney + preModel.PayoutMoney + payModel.GatheringMoney) - refModel.RefundMentMoney; payBll.Amend(payModel); } } } refBll.Add(refModel); //退款信息 userBll.Add(userModel); //明细记录 //已付款 decimal payTotail = Convert.ToDecimal(this.GetPayed(this.lblOrderId.Text)); if ((payTotail - (Convert.ToDecimal(this.txtRefundmentMoney.Text.Trim()))) < 0) { orderModel.PaymentStatus = ShowShop.Common.OrdersStatusEnum.PaymentStatu.等待汇款.GetHashCode(); } else { orderModel.PaymentStatus = ShowShop.Common.OrdersStatusEnum.PaymentStatu.已收定金.GetHashCode(); } orderModel.OrderStatus = ShowShop.Common.OrdersStatusEnum.OrderStatu.已经确认.GetHashCode(); orderBll.Update(orderModel); ChangeHope.WebPage.BasePage.PageRight("已保存该信息.", "order_bank_pay.aspx?OrderId=" + orderModel.Id, "<li><a href='order_order_info.aspx?OrderId=" + orderModel.Id.ToString() + "'>返回信息页</a></li>"); } catch { this.ltlMsg.Text = "操作失败!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; } finally { adminInfo = null; remModel = null; remBll = null; userModel = null; userBll = null; payBll = null; payModel = null; preBll = null; preModel = null; orderBll = null; orderModel = null; GC.Collect(); } }
protected void lbtnSave_Click(object sender, EventArgs e) { ShowShop.BLL.Member.MemberAccount memberBll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.BLL.Order.Orders orderBll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders orderModel = orderBll.GetModel(this.lblOrderId.Text); decimal memberCapital = 0; ShowShop.Model.Admin.AdminInfo adminInfo = (ShowShop.Model.Admin.AdminInfo)ShowShop.Common.AdministrorManager.Get(); if (!memberBll.Exists(this.txtTransferName.Text.Trim())) { this.ltlMsg.Text = "过户失败,不存在用户:" + this.txtTransferName.Text.Trim(); this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } ShowShop.BLL.Order.OrderTransfer bll = new ShowShop.BLL.Order.OrderTransfer(); ShowShop.Model.Order.OrderTransfer model = new ShowShop.Model.Order.OrderTransfer(); model.OrderId = this.lblOrderId.Text; model.UserName = this.lblUserName.Text; model.TransferName = this.txtTransferName.Text; model.PoundAge = Convert.ToDecimal(this.txtPoundAge.Text); model.Remark = this.txtRemark.Text; model.NoteDate = DateTime.Now; model.NoteName = adminInfo.AdminName; model.UpTime = DateTime.Now; #region 计算用户余额 是否能支付过户费 if (this.rabPoundPay.SelectedValue == "0") //订单当前所有者 支付手续费 { ShowShop.Model.Member.MemberAccount memberModel = memberBll.GetModel(this.lblUserId.Text.Trim()); if (memberModel.Capital > Convert.ToDecimal(this.txtPoundAge.Text)) { memberCapital = Convert.ToDecimal(memberModel.Capital - Convert.ToDecimal(this.txtPoundAge.Text)); } else { this.ltlMsg.Text = "过户失败," + this.lblUserId.Text.Trim() + " 资金余额不足"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } //更改用户资金状况 memberBll.Amend(memberModel.UID, "Capital", memberCapital); model.PoundAgePayMentPerson = this.lblUserId.Text; } else //过户对象 { ShowShop.Model.Member.MemberAccount memberModel = memberBll.GetModel(this.txtTransferName.Text.Trim()); if (memberModel.Capital > Convert.ToDecimal(this.txtPoundAge.Text)) { memberCapital = Convert.ToDecimal(memberModel.Capital - Convert.ToDecimal(this.txtPoundAge.Text)); } else { this.ltlMsg.Text = "过户失败," + this.txtTransferName.Text.Trim() + " 资金余额不足"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; return; } //更改用户资金状况 memberBll.Amend(memberModel.UID, "Capital", memberCapital); model.PoundAgePayMentPerson = this.txtTransferName.Text; } #endregion try { //把原订单所属用户改为现在的用户 orderModel.UserId = this.txtTransferName.Text.Trim(); orderBll.Update(orderModel); bll.Add(model); this.ltlMsg.Text = "操作成功,已保存该信息"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } catch { this.ltlMsg.Text = "操作失败!"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; } finally { bll = null; model = null; } }
/// <summary> /// 订单信息初始化 /// </summary> protected void OrderInfoBind(string orderId) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model = bll.GetModel(orderId); if (model != null) { this.lblUserId.Text = model.UserId; this.lblUserName.Text = model.ConsigneeName; this.lblOrderId.Text = model.OrderId; } }
private void OrderInfo(int id) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model = bll.GetModel(id); this.hlBackList.NavigateUrl = "order_order_info.aspx?OrderId=" + id; ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter(); this.txtProductName.Attributes.Add("readonly", "readonly"); this.txtProductName.Attributes.Add("onclick", "selectFile('Product',new Array(" + this.hfid.ClientID + "," + this.txtProductName.ClientID + "),310,550,'" + sp.DummyPaht + "');"); if (model != null) { ShowShop.BLL.Member.MemberAccount mabll = new ShowShop.BLL.Member.MemberAccount(); ShowShop.Model.Member.MemberAccount mamodel = mabll.GetModel(model.UserId); if (mamodel != null) { ShowShop.BLL.Member.MemberInfo mibll = new ShowShop.BLL.Member.MemberInfo(); ShowShop.Model.Member.MemberInfo mimodel = mibll.GetModel(mamodel.UID); if (mimodel != null) { this.lbName.Text = mimodel.TrueName; } this.lbUserName.Text = "<a href='../member/member_view.aspx?uid=" + mamodel.UID + "'>" + model.UserId + "</a>"; } else { this.lbUserName.Text = model.UserId; } this.paymentInfo(model.SaleUserType, model.SaleUserID); this.hfOrderId.Value = id.ToString(); this.blOrderNo.Text = model.OrderId; ShowShop.Common.OrdersStatusEnum ose = new ShowShop.Common.OrdersStatusEnum(); this.lbOrderStatue.Text = ose.OrderStatus(model.OrderStatus); this.lbLogisticsStatus.Text = ose.OgisticsStatu(model.OgisticsStatus); this.lbPayment.Text = ose.PaymentStatus(model.PaymentStatus); this.lbOrderDateTime.Text = model.OrderDate.ToString(); this.txtConsigneeName.Text = model.ConsigneeName; this.txtConsigneeAddress.Text = model.ConsigneeAddress; this.txtConsigneeEmail.Text = model.ConsigneeEmail; this.txtConsigneeModile.Text = model.ConsigneePhone; this.txtConsigneeTel.Text = model.ConsigneeTel; this.txtConsigneeZip.Text = model.ConsigneeZip; this.txtConstructionSigns.Text = model.ConsigneeRealName; this.txtConsigneTime.Text = model.ConsigneeFax; this.txtRemark.Text = string.IsNullOrEmpty(model.Remark) ? "" : model.Remark; this.ddlPayMent.SelectedValue = model.PaymentType.ToString(); this.ddlDeliver.SelectedValue = model.Carriage.ToString(); this.lbOrderTotalPrice.Text =Convert.ToDouble(model.FactPrice).ToString("f2"); this.txtCarriage.Text = Convert.ToDouble(model.Courier).ToString("f2"); } }
protected void Button2_Click(object sender, EventArgs e) { string orderId = this.hfOrderId.Value.Trim(); if (string.IsNullOrEmpty(this.hfid.Value)) { ChangeHope.WebPage.BasePage.PageError("请选择商品.", "order_modify.aspx?OrderId=" + orderId, ""); } ShowShop.Model.Order.OrderProduct model = new ShowShop.Model.Order.OrderProduct(); ShowShop.BLL.Order.OrderProduct bll = new ShowShop.BLL.Order.OrderProduct(); ShowShop.BLL.Order.Orders ordbll = new ShowShop.BLL.Order.Orders(); ShowShop.BLL.Product.ProductInfo bllProductInfo = new ShowShop.BLL.Product.ProductInfo(); string[] idStr = this.hfid.Value.Split(','); string productId = idStr[0]; string specificationId = idStr.Length > 1 ? idStr[1] : ""; string specificationVa = ""; decimal spePrice = 0; //if (!string.IsNullOrEmpty(specificationId.Trim())) //{ // ShowShop.BLL.Product.ProductSpecification proSpe = new ShowShop.BLL.Product.ProductSpecification(); // ShowShop.Model.Product.ProductSpecification proModel = proSpe.GetModelID(Convert.ToInt32(specificationId)); //if (proModel != null) //{ // specificationVa = proModel.Specifications; // spePrice = Convert.ToDecimal(proModel.SalePrice); //} // } ChangeHope.DataBase.DataByPage db = bll.GetListByPage(" and ProId=" + productId + " and OrderId=" + orderId + " and Specification='" + specificationVa + "'"); ShowShop.Model.Order.Orders ordModel = ordbll.GetModel(this.blOrderNo.Text.Trim()); if (db.DataReader == null) { ShowShop.Model.Product.ProductInfo modelProductInfo = bllProductInfo.GetModel(Convert.ToInt32(productId)); if (modelProductInfo != null) { model.AddTime = System.DateTime.Now; model.OrderId =Convert.ToInt32(orderId); model.ProId = Convert.ToInt32(modelProductInfo.ProductID); model.ProClass = modelProductInfo.ClassID.ToString(); model.ProImg = modelProductInfo.Thumbnail; model.ProName = modelProductInfo.ProductName; model.ProNum = 1; model.ProOtherPara = ""; model.ProPrice = spePrice; model.Specification = specificationVa; model.FittingsId = 0; model.FittingsProductCount = ""; model.FittingsProductId = ""; model.FittingsProductPrice = ""; bll.Add(model); if (ordModel != null) { ordbll.Amend(ordModel.Id, "TotalPrice",Convert.ToDecimal(ordModel.TotalPrice)+Convert.ToDecimal(spePrice)); ordbll.Amend(ordModel.Id, "FactPrice", Convert.ToDecimal(ordModel.FactPrice) + Convert.ToDecimal(spePrice)); } } } else { if(db.DataReader.Read()) { bll.Amend(Convert.ToInt32(db.DataReader["Id"].ToString()), "ProNum", Convert.ToInt32(db.DataReader["ProNum"].ToString()) + 1); if (ordModel != null) { ordbll.Amend(ordModel.Id, "TotalPrice", Convert.ToDecimal(ordModel.TotalPrice) + Convert.ToDecimal(db.DataReader["ProPrice"].ToString())); ordbll.Amend(ordModel.Id, "FactPrice", Convert.ToDecimal(ordModel.FactPrice) + Convert.ToDecimal(db.DataReader["ProPrice"].ToString())); } } } DataTable ordProductdt = bll.GetListOrderProduct(orderId); if (ordProductdt.Rows.Count > 0) { } ChangeHope.WebPage.BasePage.PageRight("向" + this.blOrderNo.Text + "添加商品成功.", "order_modify.aspx?OrderId="+orderId, ""); }
/// <summary> /// 订单信息初始化 /// </summary> protected void OrderInfoBind(string orderId) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model = bll.GetModel(orderId); if (model != null) { this.lblUserId.Text = model.UserId; this.lblUserName.Text = model.ConsigneeName; this.lblOrderId.Text = model.OrderId; this.lblMoneyPayed.Text = GetPayed(model.OrderId);//已付款 this.lblMoneyCount.Text = Convert.ToDouble(model.FactPrice).ToString("f2"); this.lblCourier.Text =GetDeliverById(Convert.ToInt32(model.Courier)); //配送方式 this.txtRemark.Text = model.Remark; } }
/// <summary> /// 订单信息初始化 /// </summary> protected void OrderInfoBind(string orderId) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model = bll.GetModel(orderId); if (model != null) { this.lblUserId.Text = model.UserId; this.lblUserName.Text = model.UserId; // 用户名 暂时用 userId this.lblOrderId.Text = model.OrderId; this.lblMoneyPayed.Text = model.Payment.ToString();//已付款???? this.lblMoneyCount.Text = model.TotalPrice.ToString();//订单总金额 this.txtRemark.Text = model.Remark; } }
protected void lbtnSave_Click(object sender, EventArgs e) { ShowShop.BLL.Order.Orders bll = new ShowShop.BLL.Order.Orders(); ShowShop.Model.Order.Orders model = bll.GetModel(this.blOrderNo.Text); model.ConsigneeName = this.txtConsigneeName.Text; model.ConsigneeAddress = this.txtConsigneeAddress.Text; model.ConsigneeEmail = this.txtConsigneeEmail.Text; model.ConsigneePhone = this.txtConsigneeModile.Text; model.ConsigneeTel = this.txtConsigneeTel.Text; model.ConsigneeZip = this.txtConsigneeZip.Text; model.ConsigneeFax = this.txtConsigneTime.Text; model.ConsigneeRealName = this.txtConstructionSigns.Text; model.Remark = this.txtRemark.Text.Trim(); model.Courier = Convert.ToDecimal(this.txtCarriage.Text.Trim()); try { bll.Update(model); this.ltlMsg.Text = "操作成功,已保存该信息"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; } catch { this.ltlMsg.Text = "操作失败"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionErr"; } finally { bll = null; model = null; GC.Collect(); } }