//加载所有信息 public void LoadDataBind() { int id = CommonClass.ReturnRequestInt("id", 0); orders = OrderService.OrdersService.Get(id); if (orders.IsPassing == 1) { RadioPassing.Checked = true; } if (orders.IsPassing == 2) { RadioNoPassing.Checked = true; } TbPassingReason.Text = orders.PassingReason; List <Expression> express = new List <Expression>(); express.Add(new Expression("OrderNumber", "=", orders.OrderNumber)); distribution = OrderService.DistributionService.Get(express); RepList.DataSource = OrderService.OrderDetailsService.Search(express); RepList.DataBind(); }
//保存 protected void BtnSave_Click(object sender, EventArgs e) { int id = CommonClass.ReturnRequestInt("id", 0); orders = OrderService.OrdersService.Get(id); orders.FinAudStaff = AdminUserID; orders.IsPassing = RadioPassing.Checked ? 1 : 2; if (orders.IsPassing == 2) { orders.PassingReason = TbPassingReason.Text; } else { orders.PassingReason = ""; } orders.OrderStateID = 5; if (OrderService.OrdersService.Update(orders) == 1) { List <Expression> express = new List <Expression>(); express.Add(new Expression("OrderNumber", "=", orders.OrderNumber)); TB_Order_Distribution distribution = OrderService.DistributionService.Get(express); distribution.PaymentID = DDLPaymentType.SelectedValue.ToInt(); OrderService.DistributionService.Update(distribution); MessageDiv.InnerHtml = CommonClass.Reload("订单审核成功"); } else { MessageDiv.InnerHtml = CommonClass.Reload("订单审核失败"); } }
//加载所有信息 public void LoadDataBind() { DDLPaymentType.DataSource = Dictionaries.GetDictionaries(DictionariesEnum.支付方式); DDLPaymentType.DataValueField = "ID"; DDLPaymentType.DataTextField = "Title"; DDLPaymentType.DataBind(); //订单信息 int id = CommonClass.ReturnRequestInt("id", 0); orders = OrderService.OrdersService.Get(id); if (orders.IsPassing == 1) { RadioPassing.Checked = true; } if (orders.IsPassing == 2) { RadioNoPassing.Checked = true; } TbPassingReason.Text = orders.PassingReason; //支付信息 List <Expression> express = new List <Expression>(); express.Add(new Expression("OrderNumber", "=", orders.OrderNumber)); distribution = OrderService.DistributionService.Get(express); DDLPaymentType.SelectedValue = distribution.PaymentID.ToStr(); RepList.DataSource = OrderService.OrderDetailsService.Search(express); RepList.DataBind(); }
//加载所有信息 public void LoadDataBind() { int id = CommonClass.ReturnRequestInt("id", 0); orders = OrderService.OrdersService.Get(id); List <Expression> express = new List <Expression>(); express.Add(new Expression("OrderNumber", "=", orders.OrderNumber)); distribution = OrderService.DistributionService.Get(express); RepList.DataSource = OrderService.OrderDetailsService.Search(express); RepList.DataBind(); }
//提交订单 protected void BtnSubmitOrder_Click(object sender, EventArgs e) { Random random = new Random(); gotoBack: string OrderNumber = DateTime.Now.ToString("yyyyMMddHHmmss") + random.Next(1000, 9999); List <Expression> express = new List <Expression>(); express.Add(new Expression("OrderNumber", "=", OrderNumber)); if (OrderService.OrdersService.Get(express).ID > 0) { goto gotoBack; } TB_Order_Orders order = new TB_Order_Orders(); order.OrderNumber = OrderNumber; order.OrderType = 0; order.OrderDate = DateTime.Now; order.OrderStateID = 0; int count = 0; decimal priceCount = 0; foreach (DataRow dr in Cart.GetCart().Tables[0].Rows) { count += dr["count"].ToInt(); priceCount += dr["count"].ToInt() * dr["price"].ToDecimal(); } order.ProCount = count; order.MemberID = MemberID; order.MoneySum = priceCount; //发票信息 order.IsInvoice = RadioBtnIsInvoice.SelectedValue.ToInt(); order.InvoiceType = RadioBtnInvoiceType.SelectedValue; order.InvoiceValue = RadioBtnInvoiceValue.SelectedValue; order.InvoiceLookUp = RadioButtonListInvoiceLookUp.SelectedValue; order.CompanyName = TbCompanyName.Text; order.Remark = TbRemark.Text; //收货人信息 TB_Order_Distribution distribution = new TB_Order_Distribution(); distribution.OrderNumber = OrderNumber; distribution.Address = Address.Text + TbAddress.Text; distribution.BuyerName = TbName.Text; distribution.CompanyName = TbCompanyName.Text; distribution.ConsignmentID = DDLConsigument.SelectedValue.ToInt(); distribution.PaymentID = RadioBtnPaymentList.SelectedValue.ToInt(); distribution.Phone = TbPhone.Text; distribution.PostalCode = TbPostedCode.Text; distribution.Mobile = TbMobile.Text; distribution.Email = TbEmail.Text; distribution.RepceiptDateType = DDLRepceiptDateType.SelectedValue; distribution.MentionDate = TbMentionDate.Text; TB_Member_BuyerInfo buyerInfo = new TB_Member_BuyerInfo(); buyerInfo.MemberID = MemberID; buyerInfo.Zone = Address.Value + "|" + Address.Text; buyerInfo.Address = TbAddress.Text; buyerInfo.BuyerName = TbName.Text; buyerInfo.Phone = TbPhone.Text; buyerInfo.PostalCode = TbPostedCode.Text; buyerInfo.Mobile = TbMobile.Text; buyerInfo.Email = TbEmail.Text; if (OrderService.OrdersService.Insert(order) == 1) { OrderService.DistributionService.Insert(distribution); DataSet ds = Cart.GetCart(); foreach (DataRow dr in ds.Tables[0].Rows) { TB_Order_OrderDetails details = new TB_Order_OrderDetails(); details.OrderNumber = OrderNumber; details.Type = dr["type"].ToInt(); details.ProductID = dr["id"].ToInt(); details.ProName = dr["name"].ToStr(); details.ProNumber = dr["proNumber"].ToStr(); details.Count = dr["count"].ToInt(); details.Price = dr["price"].ToDecimal(); details.Picture = dr["img"].ToStr(); details.Total = dr["price"].ToDecimal() * dr["count"].ToInt(); OrderService.OrderDetailsService.Insert(details); } MemberService.BuyerInfoService.Insert(buyerInfo); Cart.ClearCart(); Response.Redirect("ShoppingCart3.aspx?OrderNumber=" + OrderNumber); } }