protected void BtnGotoPreview_Click(object sender, EventArgs e) { OrderFlowInfo flowInfo = this.FlowInfo; flowInfo.ShoppingCartId = this.m_CartId; flowInfo.ZipCode = this.TxtZipCode.Text; flowInfo.PaymentType = DataConverter.CLng(this.DropPaymentType.Text); flowInfo.DeliverType = DataConverter.CLng(this.DropDeliverType.Text); flowInfo.NeedInvoice = this.ChkNeedInvoice.Checked; flowInfo.ConsigneeName = this.TxtContacterName.Text; flowInfo.Address = this.AddressPick.Address; flowInfo.Email = this.TxtEmail.Text; flowInfo.Mobile = this.TxtMobile.Text; flowInfo.AgentName = this.SelectAgent1.AgentName; flowInfo.NeedInvoice = this.ChkNeedInvoice.Checked; flowInfo.HomePhone = this.TxtPhone.Text; flowInfo.InvoiceContent = this.TxtInvoiceContent.Text; flowInfo.Remark = this.TxtRemark.Text; flowInfo.Country = this.AddressPick.Country; flowInfo.Province = this.AddressPick.Province; flowInfo.City = this.AddressPick.City; flowInfo.Area = this.AddressPick.Area; flowInfo.PresentId = DataConverter.CLng(base.Request.Form["RdbPresentId"]); flowInfo.OutOfStockProject = (OutOfStockProject)DataConverter.CLng(this.RadlOutOfStockProject.SelectedValue); flowInfo.DeliveryTime = this.dropDeliverTime.SelectedItem.Text; }
private static void CheckPresentProject(OrderFlowInfo orderFlowInfo, OrderInfo orderInfo, ref double totalWeight, ref decimal totalMoney, out decimal presentMoney, out int presentExp, out int presentPoint) { presentMoney = 0M; presentExp = 0; presentPoint = 0; PresentProjectInfo presentProjectByTotalMoney = PresentProject.GetPresentProjectByTotalMoney(totalMoney); if (!presentProjectByTotalMoney.IsNull) { if ((presentProjectByTotalMoney.PresentContent.Contains("1") && (orderFlowInfo.PresentId > 0)) && !Present.GetPresentById(orderFlowInfo.PresentId).IsNull) { AbstractItemInfo info3 = new ConcretePresentProject(orderFlowInfo.PresentId, presentProjectByTotalMoney); info3.GetItemInfo(); if (!info3.IsNull) { totalMoney += info3.SubTotal; totalWeight += info3.TotalWeight; OrderItem.Add(info3.GetOrderItemInfo(orderInfo.OrderId)); Product.AddOrderNum(info3.ProductId, info3.TableName, 1); } } if (presentProjectByTotalMoney.PresentContent.Contains("2")) { presentMoney = presentProjectByTotalMoney.Cash; } if (presentProjectByTotalMoney.PresentContent.Contains("3")) { presentExp = presentProjectByTotalMoney.PresentExp; } if (presentProjectByTotalMoney.PresentContent.Contains("4")) { presentPoint = presentProjectByTotalMoney.PresentPoint; } } }
private void button1_Click(object sender, EventArgs e) { //MessageBox.Show("Thanks!"); CirculationInfo ci = new CirculationInfo(); List <OrderInfo> list = ci.GetOrders(CirculationStatuses.ForReturnToBookStorage.Value); foreach (OrderInfo o in list) { BJExemplarInfo exemplar = BJExemplarInfo.GetExemplarByIdData(o.ExemplarId, o.Fund); if (o.IssueDate == null) { List <OrderFlowInfo> ofi = ci.GetOrdersFlowByOrderId(o.OrderId); OrderFlowInfo f = ofi.Find(x => x.StatusName.Contains("ыдано")); if (f != null) { } } if (exemplar.Fields["921$c"].ToString() == "ДП") { //ci.ChangeOrderStatusReturn() } } }
protected void Page_Load(object sender, EventArgs e) { this.ShoppingCart1.IsPreview = 1; if (!base.IsPostBack) { if (base.PreviousPage != null) { Payment previousPage = base.PreviousPage as Payment; if (previousPage != null) { if (!string.IsNullOrEmpty(PEContext.Current.User.UserName) && SiteConfig.ShopConfig.EnableCoupon) { this.PlhCoupon.Visible = true; } OrderFlowInfo flowInfo = previousPage.FlowInfo; this.FlowInfo = flowInfo; this.ShoppingCart1.CartId = flowInfo.ShoppingCartId; DropDownList list = (DropDownList)previousPage.FindControl("DropDeliverType"); DropDownList list2 = (DropDownList)previousPage.FindControl("DropPaymentType"); this.ShoppingCart1.ZipCode = flowInfo.ZipCode; this.ShoppingCart1.PaymentType = flowInfo.PaymentType; this.ShoppingCart1.DeliverType = flowInfo.DeliverType; this.ShoppingCart1.NeedInvoice = flowInfo.NeedInvoice; this.LblContacterName.Text = flowInfo.ConsigneeName; if (flowInfo.Country != "中华人民共和国") { this.LblAddress.Text = flowInfo.Country; } string text = this.LblAddress.Text; this.LblAddress.Text = text + flowInfo.Province + flowInfo.City + flowInfo.Area + flowInfo.Address; this.LblEmail.Text = flowInfo.Email; this.LblMobile.Text = flowInfo.Mobile; this.LblPhone.Text = flowInfo.HomePhone; this.LblZipCode.Text = flowInfo.ZipCode; this.LblAgentName.Text = flowInfo.AgentName; if (flowInfo.NeedInvoice) { this.LblInvoiceContent.Text = flowInfo.InvoiceContent; } this.LblRemark.Text = flowInfo.Remark; this.LblDeliverType.Text = list.SelectedItem.Text; this.HdnDeliverType.Value = list.SelectedValue; this.LblPaymentType.Text = list2.SelectedItem.Text; this.HdnPaymentTypeId.Value = list2.SelectedValue; this.HdnPayPlatformId.Value = ((RadioButtonList)previousPage.FindControl("RadlPayPlatform")).SelectedValue; this.LblDeliverTime.Text = flowInfo.DeliveryTime; } } if ((base.PreviousPage == null) || !(base.PreviousPage is Payment)) { this.BtnModifyInfo.Enabled = false; this.BtnSubmitOrder.Enabled = false; } } }
public static bool Add(OrderInfo orderInfo, OrderFlowInfo orderFlowInfo, bool processUserInfo) { if (processUserInfo && !string.IsNullOrEmpty(orderInfo.UserName)) { UserInfo usersByUserName = Users.GetUsersByUserName(orderInfo.UserName); orderFlowInfo.ConsigneeName = orderInfo.ContacterName; orderFlowInfo.ZipCode = orderInfo.ZipCode; orderFlowInfo.Email = orderInfo.Email; orderFlowInfo.HomePhone = orderInfo.Phone; orderFlowInfo.Mobile = orderInfo.Mobile; ProcessSubscriber(orderFlowInfo, usersByUserName); orderInfo.ClientId = usersByUserName.ClientId; } return(Add(orderInfo)); }
private static void AddOrder(OrderFlowInfo orderFlowInfo, OrderInfo orderInfo, double paymentDiscount, string userName, int clientId) { if (orderFlowInfo.OrderId == 0) { orderInfo.OrderId = GetMaxId() + 1; } else { orderInfo.OrderId = orderFlowInfo.OrderId; } orderInfo.OrderNum = GetOrderNum(); orderInfo.UserName = userName; orderInfo.ClientId = clientId; orderInfo.ContacterName = orderFlowInfo.ConsigneeName; if (orderFlowInfo.Country != "中华人民共和国") { orderInfo.Address = orderFlowInfo.Country; } string address = orderInfo.Address; orderInfo.Address = address + orderFlowInfo.Province + orderFlowInfo.City + orderFlowInfo.Area + orderFlowInfo.Address; orderInfo.ZipCode = orderFlowInfo.ZipCode; orderInfo.Mobile = orderFlowInfo.Mobile; orderInfo.Phone = orderFlowInfo.HomePhone; orderInfo.Email = orderFlowInfo.Email; orderInfo.PaymentType = orderFlowInfo.PaymentType; orderInfo.DeliverType = orderFlowInfo.DeliverType; orderInfo.NeedInvoice = orderFlowInfo.NeedInvoice; orderInfo.InvoiceContent = orderFlowInfo.InvoiceContent; orderInfo.Invoiced = false; orderInfo.Remark = orderFlowInfo.Remark; orderInfo.BeginDate = orderFlowInfo.BeginDate; orderInfo.InputTime = DateTime.Now; orderInfo.Status = OrderStatus.WaitForConfirm; orderInfo.DeliverStatus = DeliverStatus.Preparative; orderInfo.EnableDownload = false; orderInfo.DiscountPayment = paymentDiscount; orderInfo.ChargeDeliver = 0M; orderInfo.AgentName = orderFlowInfo.AgentName; orderInfo.OutOfStockProject = orderFlowInfo.OutOfStockProject; orderInfo.DeliveryTime = orderFlowInfo.DeliveryTime; Add(orderInfo); }
internal List <OrderFlowInfo> GetOrdersFlowByOrderId(int orderId) { DataTable table = dbWrapper.GetOrdersFlowByOrderId(orderId); List <OrderFlowInfo> result = new List <OrderFlowInfo>(); foreach (DataRow row in table.Rows) { OrderFlowInfo fi = new OrderFlowInfo(); fi.Changed = (DateTime)row["Changed"]; fi.Changer = (int)row["Changer"]; fi.DepartmentId = (int)row["DepartmentId"];; fi.Id = (int)row["Id"]; fi.OrderId = (int)row["OrderId"]; fi.Refusual = row["Refusual"].ToString(); fi.StatusName = row["StatusName"].ToString(); result.Add(fi); } return(result); }
private static void AddOrderItems(OrderFlowInfo orderFlowInfo, IList <ShoppingCartInfo> shoppingCartProductInfoList, IList <ShoppingCartInfo> shoppingCartPresentInfoList, OrderInfo orderInfo, ref double totalWeight, ref decimal totalMoney, UserInfo userInfo) { bool haveWholesalePurview = false; if (!userInfo.UserPurview.IsNull) { haveWholesalePurview = userInfo.UserPurview.Enablepm; } foreach (ShoppingCartInfo info in shoppingCartProductInfoList) { ProductInfo productById = Product.GetProductById(info.ProductId, info.TableName); if (!productById.IsNull) { AbstractItemInfo info3 = new ConcreteProductInfo(info.Quantity, info.Property, productById, userInfo, orderFlowInfo.NeedInvoice, true, haveWholesalePurview); info3.GetItemInfo(); OrderItem.Add(info3.GetOrderItemInfo(orderInfo.OrderId)); totalMoney += info3.SubTotal; totalWeight += info3.TotalWeight; AddPressent(info.Quantity, shoppingCartPresentInfoList, ref totalWeight, ref totalMoney, productById, orderInfo.OrderId); } } }
protected void BtnSubmitOrder_Click(object sender, EventArgs e) { OrderFlowInfo flowInfo = this.FlowInfo; flowInfo.OrderId = Order.GetMaxId() + 1; flowInfo.BeginDate = DateTime.Today; UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName); int category = PaymentType.GetPaymentTypeById(DataConverter.CLng(this.HdnPaymentTypeId.Value)).Category; int couponId = DataConverter.CLng(this.HdnCouponID.Value); switch (Order.Add(flowInfo, usersByUserName, flowInfo.ShoppingCartId, couponId, this.ShoppingCart1.TrueTotalMoney)) { case 1: case 2: { string continueBuy = SiteConfig.ShopConfig.ContinueBuy; if (string.IsNullOrEmpty(continueBuy)) { continueBuy = "~/Category.aspx?id=4"; } DynamicPage.WriteErrMsg("<li>您好!目前您的购物车中没有任何商品,点击返回上一页继续购物?</li>", continueBuy); return; } case 0x63: if (couponId > 0) { CouponItem.AddUseTimes(this.TxtCouponNum.Text, PEContext.Current.User.UserId); } switch (category) { case 1: base.Response.Redirect("../PayOnline/PayOnline.aspx?AddOrder=success&OrderID=" + flowInfo.OrderId.ToString() + "&PayPlatformId=" + this.HdnPayPlatformId.Value); return; } base.Response.Redirect("OrderSuccess.aspx?OrderID=" + flowInfo.OrderId.ToString()); return; } }
private void ModifyInformation() { Preview previousPage = (Preview)base.PreviousPage; OrderFlowInfo flowInfo = previousPage.FlowInfo; this.TxtContacterName.Text = flowInfo.ConsigneeName; this.AddressPick.SelectRegion(flowInfo.Country, flowInfo.Province, flowInfo.City, flowInfo.Area); this.AddressPick.Address = flowInfo.Address; this.TxtZipCode.Text = flowInfo.ZipCode; this.TxtPhone.Text = flowInfo.HomePhone; this.TxtEmail.Text = flowInfo.Email; this.TxtMobile.Text = flowInfo.Mobile; this.SelectAgent1.AgentName = flowInfo.AgentName; this.InitializeDeliverType(flowInfo.DeliverType); this.InitializePaymentType(flowInfo.PaymentType, DataConverter.CLng(((HiddenField)previousPage.FindControl("HdnPayPlatformId")).Value)); this.ChkNeedInvoice.Checked = flowInfo.NeedInvoice; if (this.ChkNeedInvoice.Checked) { this.TxtInvoiceContent.Text = flowInfo.InvoiceContent; } this.TxtRemark.Text = flowInfo.Remark; this.RadlOutOfStockProject.SelectedValue = ((int)flowInfo.OutOfStockProject).ToString(); }
private static void ProcessSubscriber(OrderFlowInfo orderFlowInfo, UserInfo userInfo) { if (!userInfo.IsNull) { ClientInfo clientInfo = new ClientInfo(); CompanyInfo companyInfo = new CompanyInfo(); ContacterInfo contacterInfo = new ContacterInfo(); if ((userInfo.UserId > 0) && (userInfo.ClientId == 0)) { if (userInfo.UserType > UserType.Persional) { companyInfo = Company.GetCompayById(userInfo.CompanyId); if (!companyInfo.IsNull) { string companyName = companyInfo.CompanyName; companyName = string.IsNullOrEmpty(companyName) ? string.Empty : companyName; clientInfo.ClientName = companyInfo.CompanyName; clientInfo.ShortedForm = companyInfo.CompanyName.Substring(0, 6); clientInfo.ClientType = 0; } } else { clientInfo.ClientName = orderFlowInfo.ConsigneeName; clientInfo.ShortedForm = orderFlowInfo.ConsigneeName; clientInfo.ClientType = 1; } clientInfo.ClientId = companyInfo.ClientId = userInfo.ClientId = Client.GetMaxId() + 1; clientInfo.ClientNum = Client.GetClientNum(); clientInfo.Area = -1; clientInfo.ClientField = -1; clientInfo.ValueLevel = -1; clientInfo.CreditLevel = -1; clientInfo.Importance = -1; clientInfo.ConnectionLevel = -1; clientInfo.SourceType = -1; clientInfo.PhaseType = -1; clientInfo.UpdateTime = clientInfo.CreateTime = DateTime.Now; Client.Add(clientInfo); userInfo.ClientId = clientInfo.ClientId; Users.Update(userInfo); Company.Update(companyInfo); Contacter.UpdateClientForSameCompany(clientInfo.ClientId, userInfo.CompanyId); } if (userInfo.UserId > 0) { StringBuilder builder = new StringBuilder(); if (orderFlowInfo.Country != "中华人民共和国") { builder.Append(orderFlowInfo.Country); } builder.Append(orderFlowInfo.Province); builder.Append(orderFlowInfo.City); builder.Append(orderFlowInfo.Area); builder.Append(orderFlowInfo.Address); if (!Contacter.Exists(userInfo.UserName)) { contacterInfo.ContacterId = Contacter.GetMaxId() + 1; contacterInfo.UserName = userInfo.UserName; contacterInfo.ClientId = userInfo.ClientId; contacterInfo.CreateTime = contacterInfo.UpdateTime = DateTime.Now; contacterInfo.TrueName = orderFlowInfo.ConsigneeName; contacterInfo.ZipCode = orderFlowInfo.ZipCode; contacterInfo.Address = builder.ToString(); contacterInfo.Mobile = orderFlowInfo.Mobile; contacterInfo.OfficePhone = contacterInfo.HomePhone = orderFlowInfo.HomePhone; contacterInfo.Email = orderFlowInfo.Email; contacterInfo.Education = -1; contacterInfo.Income = -1; contacterInfo.Sex = UserSexType.Secrecy; contacterInfo.Marriage = UserMarriageType.Secrecy; contacterInfo.Country = orderFlowInfo.Country; contacterInfo.Province = orderFlowInfo.Province; contacterInfo.City = orderFlowInfo.City; Contacter.Add(contacterInfo); } else { contacterInfo = Contacter.GetContacterByUserName(userInfo.UserName); if (!contacterInfo.IsNull) { if (contacterInfo.ClientId <= 0) { contacterInfo.ClientId = userInfo.ClientId; } if (string.IsNullOrEmpty(contacterInfo.TrueName)) { contacterInfo.TrueName = orderFlowInfo.ConsigneeName; } if (string.IsNullOrEmpty(contacterInfo.ZipCode)) { contacterInfo.ZipCode = orderFlowInfo.ZipCode; } if (string.IsNullOrEmpty(contacterInfo.Address)) { contacterInfo.Address = builder.ToString(); } if (string.IsNullOrEmpty(contacterInfo.Mobile)) { contacterInfo.Mobile = orderFlowInfo.Mobile; } if (string.IsNullOrEmpty(contacterInfo.HomePhone)) { contacterInfo.HomePhone = orderFlowInfo.HomePhone; } if (string.IsNullOrEmpty(contacterInfo.Email)) { contacterInfo.Email = orderFlowInfo.Email; } if (string.IsNullOrEmpty(contacterInfo.Country)) { contacterInfo.Country = orderFlowInfo.Country; } if (string.IsNullOrEmpty(contacterInfo.Province)) { contacterInfo.Province = orderFlowInfo.Province; } if (string.IsNullOrEmpty(contacterInfo.City)) { contacterInfo.City = orderFlowInfo.City; } Contacter.Update(contacterInfo); } } AddressInfo defaultAddressByUserName = Address.GetDefaultAddressByUserName(userInfo.UserName); if (defaultAddressByUserName.IsNull) { defaultAddressByUserName.UserName = userInfo.UserName; defaultAddressByUserName.Address = orderFlowInfo.Address; defaultAddressByUserName.Area = orderFlowInfo.Area; defaultAddressByUserName.City = orderFlowInfo.City; defaultAddressByUserName.ConsigneeName = orderFlowInfo.ConsigneeName; defaultAddressByUserName.Country = orderFlowInfo.Country; defaultAddressByUserName.Province = orderFlowInfo.Province; defaultAddressByUserName.HomePhone = orderFlowInfo.HomePhone; defaultAddressByUserName.Mobile = orderFlowInfo.Mobile; defaultAddressByUserName.ZipCode = orderFlowInfo.ZipCode; defaultAddressByUserName.IsDefault = true; Address.Add(defaultAddressByUserName); } } } }
public static int Add(OrderFlowInfo orderFlowInfo, UserInfo userInfo, string cartId, int couponId, decimal trueTotalMoney) { decimal num5; int num6; int num7; if (string.IsNullOrEmpty(cartId)) { return(1); } IList <ShoppingCartInfo> infoByCart = ShoppingCart.GetInfoByCart(cartId, false); if (infoByCart.Count <= 0) { return(2); } IList <ShoppingCartInfo> shoppingCartPresentInfoList = ShoppingCart.GetInfoByCart(cartId, true); OrderInfo orderInfo = new OrderInfo(); double totalWeight = 0.0; decimal totalMoney = 0M; double discount = PaymentType.GetPaymentTypeById(orderFlowInfo.PaymentType).Discount; string userName = ""; int clientId = 0; if (!userInfo.IsNull) { ProcessSubscriber(orderFlowInfo, userInfo); userName = userInfo.UserName; clientId = userInfo.ClientId; } AddOrder(orderFlowInfo, orderInfo, discount, userName, clientId); AddOrderItems(orderFlowInfo, infoByCart, shoppingCartPresentInfoList, orderInfo, ref totalWeight, ref totalMoney, userInfo); CheckPresentProject(orderFlowInfo, orderInfo, ref totalWeight, ref totalMoney, out num5, out num6, out num7); decimal num8 = totalMoney; PackageInfo packageByGoodsWeight = Package.GetPackageByGoodsWeight(totalWeight); if (!packageByGoodsWeight.IsNull) { totalWeight += packageByGoodsWeight.PackageWeight; } decimal num9 = DeliverCharge.GetDeliverCharge(orderFlowInfo.DeliverType, totalWeight, orderFlowInfo.ZipCode, totalMoney, orderFlowInfo.NeedInvoice); totalMoney += num9; orderInfo.MoneyGoods = num8; orderInfo.ChargeDeliver = num9; if (couponId > 0) { orderInfo.MoneyTotal = trueTotalMoney; orderInfo.CouponId = couponId; } else { orderInfo.MoneyTotal = totalMoney; } orderInfo.PresentMoney = num5; orderInfo.PresentExp = num6; orderInfo.PresentPoint = num7; Update(orderInfo); ShoppingCart.Delete(cartId); SmsConfig smsConfig = SiteConfig.SmsConfig; if ((smsConfig.IsAutoSendMessage && !string.IsNullOrEmpty(smsConfig.AdminPhoneNumber)) && !string.IsNullOrEmpty(smsConfig.OrderMessage)) { AbstractMessageOfOrder order = new SmsOfOrder("", SendType.SendToAdmin, smsConfig.AdminPhoneNumber); order.Implementor = new OrderFlow(orderInfo, ""); order.Send(); } return(0x63); }