⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 payment.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
                bool userLogin = true;
                if (info.Category == 2)
                {
                    userLogin = this.m_UserLogin;
                }
                if (userLogin)
                {
                    if (paymentTypeId > 0)
                    {
                        if (info.TypeId == paymentTypeId)
                        {
                            typeId = paymentTypeId;
                            category = info.Category;
                            this.LblPaymentTypeIntro.Text = info.Intro;
                        }
                    }
                    else if (info.IsDefault)
                    {
                        typeId = info.TypeId;
                        category = info.Category;
                        this.LblPaymentTypeIntro.Text = info.Intro;
                    }
                    list2.Add(info);
                }
            }
            this.DropPaymentType.DataSource = list2;
            this.DropPaymentType.DataBind();
            BasePage.SetSelectedIndexByValue(this.DropPaymentType, typeId.ToString());
            if (category == 1)
            {
                this.RadlPayPlatform.Visible = true;
                IList<PayPlatformInfo> listOfEnabled = PayPlatform.GetListOfEnabled();
                this.RadlPayPlatform.DataSource = listOfEnabled;
                this.RadlPayPlatform.DataBind();
                foreach (PayPlatformInfo info2 in listOfEnabled)
                {
                    if (payPlatformId > 0)
                    {
                        if (info2.PayPlatformId != payPlatformId)
                        {
                            continue;
                        }
                        this.RadlPayPlatform.SelectedValue = info2.PayPlatformId.ToString();
                        break;
                    }
                    if (info2.IsDefault)
                    {
                        this.RadlPayPlatform.SelectedValue = info2.PayPlatformId.ToString();
                        break;
                    }
                }
            }
        }

        private void InitializeUserInfo()
        {
            UserInfo usersByUserName = Users.GetUsersByUserName(PEContext.Current.User.UserName);
            if (!usersByUserName.IsNull)
            {
                AddressInfo defaultAddressByUserName = Address.GetDefaultAddressByUserName(usersByUserName.UserName);
                ContacterInfo contacterByUserName = Contacter.GetContacterByUserName(usersByUserName.UserName);
                if (!defaultAddressByUserName.IsNull)
                {
                    this.AddressPick.SelectRegion(defaultAddressByUserName.Country, defaultAddressByUserName.Province, defaultAddressByUserName.City, defaultAddressByUserName.Area);
                    this.AddressPick.Address = defaultAddressByUserName.Address;
                    this.TxtZipCode.Text = defaultAddressByUserName.ZipCode;
                    this.TxtPhone.Text = defaultAddressByUserName.HomePhone;
                    this.TxtMobile.Text = defaultAddressByUserName.Mobile;
                    this.TxtContacterName.Text = defaultAddressByUserName.ConsigneeName;
                }
                else if (!contacterByUserName.IsNull)
                {
                    this.AddressPick.SelectRegion(contacterByUserName.Country, contacterByUserName.Province, contacterByUserName.City, "");
                    this.AddressPick.Address = contacterByUserName.Address;
                    this.TxtZipCode.Text = contacterByUserName.ZipCode;
                    this.TxtPhone.Text = contacterByUserName.HomePhone;
                    this.TxtMobile.Text = contacterByUserName.Mobile;
                    this.TxtContacterName.Text = contacterByUserName.TrueName;
                }
                if (!contacterByUserName.IsNull)
                {
                    this.TxtEmail.Text = contacterByUserName.Email;
                }
            }
        }

        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();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.AddressPick.AddressChanged += new EventHandler(this.AddressPick_AddressChanged);
            string applicationName = PayOnline.GetApplicationName();
            if (base.Request.Cookies["Cart" + applicationName] != null)
            {
                this.m_CartId = base.Request.Cookies["Cart" + applicationName]["CartID"];
            }
            if (!this.Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(PEContext.Current.User.UserName))
                {
                    this.m_UserLogin = true;
                    ShoppingCart.UpdateUserName(this.m_CartId, PEContext.Current.User.UserName);
                }
                if (!SiteConfig.ShopConfig.EnableGuestBuy && !this.m_UserLogin)
                {
                    base.Response.Redirect("../User/Login.aspx?ReturnUrl=" + HttpUtility.UrlEncode("../Shop/Payment.aspx"), true);
                }
                if ((base.PreviousPage != null) && (base.PreviousPage is Preview))
                {
                    this.ModifyInformation();
                }
                else
                {
                    this.InitializeDeliverType(0);
                    this.InitializePaymentType(0, 0);
                    this.InitializeUserInfo();
                }
                this.LBtnAddress.OnClientClick = string.Format("window.open('{0}Shop/AddressList.aspx','window','width=600,height=450');return false", base.BasePath);
            }
            this.ShoppingCart1.CartId = this.m_CartId;
            this.ShoppingCart1.IsPreview = 0;
            string str2 = base.Request.Params.Get("__EVENTTARGET");
            string eventArgument = base.Request.Params.Get("__EVENTARGUMENT");
            if (str2 == "AddressList_PostBack")
            {
                this.AddressListPostBack(eventArgument);
            }
        }

        protected void ValxPhone_ServerValidate(object source, ServerValidateEventArgs args)
        {
            if (string.IsNullOrEmpty(this.TxtPhone.Text) && string.IsNullOrEmpty(this.TxtMobile.Text))
            {
                args.IsValid = false;
            }
            else
            {
                args.IsValid = true;
            }
        }

        public OrderFlowInfo FlowInfo
        {
            get
            {
                if (this.ViewState["FlowInfo"] == null)
                {
                    this.ViewState["FlowInfo"] = new OrderFlowInfo();
                }
                return (OrderFlowInfo) this.ViewState["FlowInfo"];
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -