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

📄 paymenttypeui.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.WebSite.Admin.Shop
{
    using PowerEasy.Common;
    using PowerEasy.Controls;
    using PowerEasy.ExtendedControls;
    using PowerEasy.Model.Shop;
    using PowerEasy.Shop;
    using PowerEasy.Web.UI;
    using System;
    using System.Web.UI.WebControls;

    public class PaymentTypeUI : AdminPage
    {
        protected ExtendedButton BtnSave;
        protected CheckBox ChkIsDefault;
        protected DropDownList DropCategory;
        protected Label LblTitle;
        protected ExtendedSiteMapPath SmpNavigator;
        protected TextBox TxtDiscount;
        protected TextBox TxtIntro;
        protected TextBox TxtTypeName;
        protected RangeValidator ValrDiscount;
        protected PowerEasy.Controls.RequiredFieldValidator ValrTypeName;

        protected void BtnSave_Click(object sender, EventArgs e)
        {
            if (!base.IsValid)
            {
                return;
            }
            PaymentTypeInfo paymentTypeInfo = new PaymentTypeInfo();
            paymentTypeInfo.TypeId = (this.ViewState["typeId"] == null) ? 0 : Convert.ToInt32(this.ViewState["typeId"].ToString(), (IFormatProvider) null);
            paymentTypeInfo.TypeName = this.TxtTypeName.Text;
            paymentTypeInfo.Intro = this.TxtIntro.Text;
            paymentTypeInfo.Discount = DataConverter.CFloat(this.TxtDiscount.Text);
            paymentTypeInfo.OrderId = 0;
            paymentTypeInfo.IsDefault = this.ChkIsDefault.Checked;
            paymentTypeInfo.IsDisabled = false;
            paymentTypeInfo.Category = DataConverter.CLng(this.DropCategory.SelectedValue);
            bool flag = false;
            string str = this.ViewState["action"].ToString();
            if (str != null)
            {
                if (!(str == "Add"))
                {
                    if (str == "Modify")
                    {
                        flag = PaymentType.Update(paymentTypeInfo);
                        goto Label_0104;
                    }
                }
                else
                {
                    flag = PaymentType.Add(paymentTypeInfo);
                    goto Label_0104;
                }
            }
            flag = PaymentType.Update(paymentTypeInfo);
        Label_0104:
            if (flag)
            {
                BasePage.ResponseRedirect("PaymentTypeManage.aspx");
            }
            else
            {
                AdminPage.WriteErrMsg("操作失败!!");
            }
        }

        private void FillData()
        {
            this.ViewState["typeId"] = BasePage.RequestString("TypeId");
            PaymentTypeInfo paymentTypeById = new PaymentTypeInfo();
            paymentTypeById = PaymentType.GetPaymentTypeById(Convert.ToInt32(this.ViewState["typeId"], null));
            this.TxtTypeName.Text = DataSecurity.HtmlDecode(paymentTypeById.TypeName);
            this.TxtIntro.Text = DataSecurity.HtmlDecode(paymentTypeById.Intro);
            this.TxtDiscount.Text = Convert.ToString(paymentTypeById.Discount, null);
            this.ChkIsDefault.Checked = paymentTypeById.IsDefault;
            this.DropCategory.SelectedValue = paymentTypeById.Category.ToString();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                switch (BasePage.RequestString("Action", "Add"))
                {
                    case "Add":
                        this.ViewState["action"] = "Add";
                        return;

                    case "Modify":
                        this.ViewState["action"] = "Modify";
                        this.LblTitle.Text = "修改付款方式";
                        this.FillData();
                        return;
                }
                this.ViewState["action"] = "Add";
            }
        }
    }
}

⌨️ 快捷键说明

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