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

📄 productunitpicker.cs

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

    public class ProductUnitPicker : BaseUserControl
    {
        protected DropDownList DropProductUnit;
        protected TextBox TxtUnit;
        protected PowerEasy.Controls.RequiredFieldValidator ValrUnit;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                IList<string> unitList;
                if (this.IsPresent)
                {
                    unitList = Present.GetUnitList();
                }
                else
                {
                    unitList = Product.GetUnitList();
                }
                foreach (string str in unitList)
                {
                    this.DropProductUnit.Items.Add(DataSecurity.HtmlDecode(str));
                }
                this.DropProductUnit.Attributes.Add("onchange", "PickUnit()");
            }
        }

        [Browsable(true), Description("true 是针对促销商品的单位 ,否则是针对商品的单位"), Category("自定义")]
        public bool IsPresent
        {
            get
            {
                return ((this.ViewState["IsPresent"] != null) && ((bool) this.ViewState["IsPresent"]));
            }
            set
            {
                this.ViewState["IsPresent"] = value;
            }
        }

        public bool NoValidator
        {
            get
            {
                return false;
            }
            set
            {
                if (value)
                {
                    this.ValrUnit.Enabled = false;
                    this.ValrUnit.ShowRequiredText = false;
                }
            }
        }

        public string ProductUnit
        {
            get
            {
                return this.TxtUnit.Text;
            }
            set
            {
                this.TxtUnit.Text = value;
            }
        }
    }
}

⌨️ 快捷键说明

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