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 ModfiyOrderStatus(int id,string ColumnName,int Value,string Str) { ShowShop.BLL.Order.Orders ordbll = new ShowShop.BLL.Order.Orders(); ordbll.Amend(id, ColumnName, Value); ChangeHope.WebPage.BasePage.PageRight(Str, "order_order_info.aspx?OrderId=" + id, ""); }
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, ""); }
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 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); } }