Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(Page.Request.QueryString["modeId"], out modeId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         btnUpdate.Click += new EventHandler(btnUpdate_Click);
         if (!Page.IsPostBack)
         {
             PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(modeId);
             if (paymentMode == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 Globals.EntityCoding(paymentMode, false);
                 txtSelectedName.Value = paymentMode.Gateway.ToLower();
                 ConfigData data = new ConfigData(Cryptographer.Decrypt(paymentMode.Settings));
                 txtConfigData.Value           = data.SettingsXml;
                 txtName.Text                  = paymentMode.Name;
                 fcContent.Text                = paymentMode.Description;
                 txtCharge.Text                = paymentMode.Charge.ToString("F", CultureInfo.InvariantCulture);
                 chkIsPercent.Checked          = paymentMode.IsPercent;
                 radiIsUseInpour.SelectedValue = paymentMode.IsUseInpour;
             }
         }
     }
 }
Example #2
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["modeId"], out this.modeId))
     {
         base.GotoResourceNotFound();
         return;
     }
     this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
     if (!this.Page.IsPostBack)
     {
         PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(this.modeId);
         if (paymentMode == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         Globals.EntityCoding(paymentMode, false);
         this.txtSelectedName.Value = paymentMode.Gateway.ToLower();
         ConfigData configData = new ConfigData(HiCryptographer.Decrypt(paymentMode.Settings));
         this.txtConfigData.Value           = configData.SettingsXml;
         this.txtName.Text                  = paymentMode.Name;
         this.fcContent.Text                = paymentMode.Description;
         this.txtCharge.Text                = paymentMode.Charge.ToString("F", System.Globalization.CultureInfo.InvariantCulture);
         this.chkIsPercent.Checked          = paymentMode.IsPercent;
         this.radiIsUseInpour.SelectedValue = paymentMode.IsUseInpour;
     }
 }
Example #3
0
 private void btnSendGoods_Click(object sender, EventArgs e)
 {
     if (grdOrderGoods.Rows.Count <= 0)
     {
         ShowMsg("没有要进行发货的订单。", false);
     }
     else
     {
         DropdownColumn     column        = (DropdownColumn)grdOrderGoods.Columns[4];
         ListItemCollection selectedItems = column.SelectedItems;
         int num = 0;
         for (int i = 0; i < selectedItems.Count; i++)
         {
             string   orderId = (string)grdOrderGoods.DataKeys[grdOrderGoods.Rows[i].RowIndex].Value;
             TextBox  box     = (TextBox)grdOrderGoods.Rows[i].FindControl("txtShippOrderNumber");
             ListItem item    = selectedItems[i];
             int      result  = 0;
             int.TryParse(item.Value, out result);
             OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
             if (((orderInfo != null) && ((orderInfo.GroupBuyId <= 0) || (orderInfo.GroupBuyStatus == GroupBuyStatus.Success))) && (((orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid) && (result > 0)) && (!string.IsNullOrEmpty(box.Text) && (box.Text.Length <= 20))))
             {
                 ShippingModeInfo shippingMode = SubsiteSalesHelper.GetShippingMode(result, true);
                 orderInfo.RealShippingModeId = shippingMode.ModeId;
                 orderInfo.RealModeName       = shippingMode.Name;
                 orderInfo.ExpressCompanyAbb  = shippingMode.ExpressCompanyAbb;
                 orderInfo.ExpressCompanyName = shippingMode.ExpressCompanyName;
                 orderInfo.ShipOrderNumber    = box.Text;
                 if (SubsiteSalesHelper.SendGoods(orderInfo))
                 {
                     if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && (orderInfo.GatewayOrderId.Trim().Length > 0))
                     {
                         PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(orderInfo.PaymentTypeId);
                         if (paymentMode != null)
                         {
                             PaymentRequest.CreateInstance(paymentMode.Gateway, Cryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单发货", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[] { paymentMode.Gateway })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[] { paymentMode.Gateway })), "").SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS");
                         }
                     }
                     int userId = orderInfo.UserId;
                     if (userId == 0x44c)
                     {
                         userId = 0;
                     }
                     IUser user = Users.GetUser(userId);
                     Messenger.OrderShipping(orderInfo, user);
                     orderInfo.OnDeliver();
                 }
                 num++;
             }
         }
         if (num == 0)
         {
             ShowMsg("批量发货失败!,发货数量0个", false);
         }
         else if (num > 0)
         {
             BindData();
             ShowMsg(string.Format("批量发货成功!,发货数量{0}个", num), true);
         }
     }
 }
Example #4
0
        private void btnMondifyPay_Click(object sender, System.EventArgs e)
        {
            PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(this.ddlpayment.SelectedValue.Value);

            this.order.PaymentTypeId = paymentMode.ModeId;
            this.order.PaymentType   = paymentMode.Name;
            if (SubsiteSalesHelper.UpdateOrderPaymentType(this.order))
            {
                this.chargesList.LoadControl();
                this.ddlpayment.SelectedValue = new int?(this.order.PaymentTypeId);
                this.ShowMsg("修改支付方式成功", true);
                return;
            }
            this.ShowMsg("修改支付方式失败", false);
        }
        private void btnMondifyPay_Click(object sender, EventArgs e)
        {
            OrderInfo       order       = base.Order;
            PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(ddlpayment.SelectedValue.Value);

            order.PaymentTypeId = paymentMode.ModeId;
            order.PaymentType   = paymentMode.Name;
            if (SubsiteSalesHelper.UpdateOrderPaymentType(order))
            {
                chargesList.LoadControl();
                ddlpayment.SelectedValue = new int?(base.Order.PaymentTypeId);
                ShowMsg("修改支付方式成功", true);
            }
            else
            {
                ShowMsg("修改支付方式失败", false);
            }
        }
Example #6
0
 private void btnSendGoods_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtShipOrderNumber.Text.Trim()) || (txtShipOrderNumber.Text.Trim().Length > 20))
     {
         ShowMsg("运单号码不能为空,在1至20个字符之间", false);
     }
     else
     {
         OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
         if (orderInfo != null)
         {
             if ((orderInfo.GroupBuyId > 0) && (orderInfo.GroupBuyStatus != GroupBuyStatus.Success))
             {
                 ShowMsg("当前订单为团购订单,团购活动还未成功结束,所以不能发货", false);
             }
             else if (orderInfo.OrderStatus != OrderStatus.BuyerAlreadyPaid)
             {
                 ShowMsg("当前订单状态没有付款或不是等待发货的订单,所以不能发货", false);
             }
             else if (!radioShippingMode.SelectedValue.HasValue)
             {
                 ShowMsg("请选择配送方式", false);
             }
             else if (string.IsNullOrEmpty(expressRadioButtonList.SelectedValue))
             {
                 ShowMsg("请选择物流公司", false);
             }
             else
             {
                 ShippingModeInfo shippingMode = SubsiteSalesHelper.GetShippingMode(radioShippingMode.SelectedValue.Value, true);
                 orderInfo.RealShippingModeId = radioShippingMode.SelectedValue.Value;
                 orderInfo.RealModeName       = shippingMode.Name;
                 orderInfo.ExpressCompanyAbb  = expressRadioButtonList.SelectedValue;
                 orderInfo.ExpressCompanyName = expressRadioButtonList.SelectedItem.Text;
                 orderInfo.ShipOrderNumber    = txtShipOrderNumber.Text;
                 if (SubsiteSalesHelper.SendGoods(orderInfo))
                 {
                     if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && (orderInfo.GatewayOrderId.Trim().Length > 0))
                     {
                         PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(orderInfo.PaymentTypeId);
                         if (paymentMode != null)
                         {
                             PaymentRequest.CreateInstance(paymentMode.Gateway, Cryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单发货", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[] { paymentMode.Gateway })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[] { paymentMode.Gateway })), "").SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS");
                         }
                     }
                     int userId = orderInfo.UserId;
                     if (userId == 0x44c)
                     {
                         userId = 0;
                     }
                     IUser user = Users.GetUser(userId);
                     Messenger.OrderShipping(orderInfo, user);
                     orderInfo.OnDeliver();
                     ShowMsg("发货成功", true);
                 }
                 else
                 {
                     ShowMsg("发货失败", false);
                 }
             }
         }
     }
 }
Example #7
0
 private void btnSendGoods_Click(object sender, System.EventArgs e)
 {
     if (this.txtShipOrderNumber.Text.IndexOf("showWindow_ShipInfoPage") != -1)
     {
         OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.orderId);
         if (orderInfo == null)
         {
             return;
         }
         if (orderInfo.GroupBuyId > 0 && orderInfo.GroupBuyStatus != GroupBuyStatus.Success)
         {
             this.ShowMsg("当前订单为团购订单,团购活动还未成功结束,所以不能发货", false);
             return;
         }
         if (orderInfo.OrderStatus != OrderStatus.BuyerAlreadyPaid)
         {
             this.ShowMsg("当前订单状态没有付款或不是等待发货的订单,所以不能发货", false);
             return;
         }
         orderInfo.RealShippingModeId = 0;
         orderInfo.RealModeName       = "配送方式(已实际发货单为准)";
         orderInfo.ShipOrderNumber    = this.txtShipOrderNumber.Text;
         if (SubsiteSalesHelper.SendGoods(orderInfo))
         {
             if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && orderInfo.GatewayOrderId.Trim().Length > 0)
             {
                 PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(orderInfo.PaymentTypeId);
                 if (paymentMode != null)
                 {
                     PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单发货", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[]
                     {
                         paymentMode.Gateway
                     })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[]
                     {
                         paymentMode.Gateway
                     })), "");
                     paymentRequest.SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS");
                 }
             }
             int num = orderInfo.UserId;
             if (num == 1100)
             {
                 num = 0;
             }
             Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num);
             Messenger.OrderShipping(orderInfo, user);
             orderInfo.OnDeliver();
             this.ShowMsg("发货成功", true);
             return;
         }
         this.ShowMsg("发货失败", false);
         return;
     }
     else
     {
         if (string.IsNullOrEmpty(this.txtShipOrderNumber.Text.Trim()) || this.txtShipOrderNumber.Text.Trim().Length > 20)
         {
             this.ShowMsg("运单号码不能为空,在1至20个字符之间", false);
             return;
         }
         OrderInfo orderInfo2 = SubsiteSalesHelper.GetOrderInfo(this.orderId);
         if (orderInfo2 == null)
         {
             return;
         }
         if (orderInfo2.GroupBuyId > 0 && orderInfo2.GroupBuyStatus != GroupBuyStatus.Success)
         {
             this.ShowMsg("当前订单为团购订单,团购活动还未成功结束,所以不能发货", false);
             return;
         }
         if (orderInfo2.OrderStatus != OrderStatus.BuyerAlreadyPaid)
         {
             this.ShowMsg("当前订单状态没有付款或不是等待发货的订单,所以不能发货", false);
             return;
         }
         if (!this.radioShippingMode.SelectedValue.HasValue)
         {
             this.ShowMsg("请选择配送方式", false);
             return;
         }
         if (string.IsNullOrEmpty(this.expressRadioButtonList.SelectedValue))
         {
             this.ShowMsg("请选择物流公司", false);
             return;
         }
         ShippingModeInfo shippingMode = SubsiteSalesHelper.GetShippingMode(this.radioShippingMode.SelectedValue.Value, true);
         orderInfo2.RealShippingModeId = this.radioShippingMode.SelectedValue.Value;
         orderInfo2.RealModeName       = shippingMode.Name;
         ExpressCompanyInfo expressCompanyInfo = ExpressHelper.FindNode(this.expressRadioButtonList.SelectedValue);
         if (expressCompanyInfo != null)
         {
             orderInfo2.ExpressCompanyAbb  = expressCompanyInfo.Kuaidi100Code;
             orderInfo2.ExpressCompanyName = expressCompanyInfo.Name;
         }
         orderInfo2.ShipOrderNumber = this.txtShipOrderNumber.Text;
         if (SubsiteSalesHelper.SendGoods(orderInfo2))
         {
             if (!string.IsNullOrEmpty(orderInfo2.GatewayOrderId) && orderInfo2.GatewayOrderId.Trim().Length > 0)
             {
                 PaymentModeInfo paymentMode2 = SubsiteSalesHelper.GetPaymentMode(orderInfo2.PaymentTypeId);
                 if (paymentMode2 != null)
                 {
                     PaymentRequest paymentRequest2 = PaymentRequest.CreateInstance(paymentMode2.Gateway, HiCryptographer.Decrypt(paymentMode2.Settings), orderInfo2.OrderId, orderInfo2.GetTotal(), "订单发货", "订单号-" + orderInfo2.OrderId, orderInfo2.EmailAddress, orderInfo2.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[]
                     {
                         paymentMode2.Gateway
                     })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[]
                     {
                         paymentMode2.Gateway
                     })), "");
                     paymentRequest2.SendGoods(orderInfo2.GatewayOrderId, orderInfo2.RealModeName, orderInfo2.ShipOrderNumber, "EXPRESS");
                 }
             }
             int num2 = orderInfo2.UserId;
             if (num2 == 1100)
             {
                 num2 = 0;
             }
             Hidistro.Membership.Core.IUser user2 = Hidistro.Membership.Context.Users.GetUser(num2);
             Messenger.OrderShipping(orderInfo2, user2);
             orderInfo2.OnDeliver();
             this.ShowMsg("发货成功", true);
             return;
         }
         this.ShowMsg("发货失败", false);
         return;
     }
 }
Example #8
0
        private void btnSendGoods_Click(object sender, System.EventArgs e)
        {
            if (this.grdOrderGoods.Rows.Count <= 0)
            {
                this.ShowMsg("没有要进行发货的订单。", false);
                return;
            }
            DropdownColumn dropdownColumn = (DropdownColumn)this.grdOrderGoods.Columns[4];

            System.Web.UI.WebControls.ListItemCollection selectedItems = dropdownColumn.SelectedItems;
            int num = 0;

            for (int i = 0; i < selectedItems.Count; i++)
            {
                string orderId = (string)this.grdOrderGoods.DataKeys[this.grdOrderGoods.Rows[i].RowIndex].Value;
                System.Web.UI.WebControls.TextBox  textBox  = (System.Web.UI.WebControls.TextBox) this.grdOrderGoods.Rows[i].FindControl("txtShippOrderNumber");
                System.Web.UI.WebControls.ListItem listItem = selectedItems[i];
                int num2 = 0;
                int.TryParse(listItem.Value, out num2);
                OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
                if (orderInfo != null && (orderInfo.GroupBuyId <= 0 || orderInfo.GroupBuyStatus == GroupBuyStatus.Success) && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid && num2 > 0 && !string.IsNullOrEmpty(textBox.Text) && textBox.Text.Length <= 20)
                {
                    ShippingModeInfo shippingMode = SubsiteSalesHelper.GetShippingMode(num2, true);
                    orderInfo.RealShippingModeId = shippingMode.ModeId;
                    orderInfo.RealModeName       = shippingMode.Name;
                    orderInfo.ShipOrderNumber    = textBox.Text;
                    if (SubsiteSalesHelper.SendGoods(orderInfo))
                    {
                        if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && orderInfo.GatewayOrderId.Trim().Length > 0)
                        {
                            PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(orderInfo.PaymentTypeId);
                            if (paymentMode != null)
                            {
                                PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单发货", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[]
                                {
                                    paymentMode.Gateway
                                })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[]
                                {
                                    paymentMode.Gateway
                                })), "");
                                paymentRequest.SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS");
                            }
                        }
                        int num3 = orderInfo.UserId;
                        if (num3 == 1100)
                        {
                            num3 = 0;
                        }
                        Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num3);
                        Messenger.OrderShipping(orderInfo, user);
                        orderInfo.OnDeliver();
                    }
                    num++;
                }
            }
            if (num == 0)
            {
                this.ShowMsg("批量发货失败!,发货数量0个", false);
                return;
            }
            if (num > 0)
            {
                this.BindData();
                this.ShowMsg(string.Format("批量发货成功!,发货数量{0}个", num), true);
            }
        }