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

📄 selectproduct.ascx.cs

📁 易想商城系统
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;

namespace YXShop.Web.Admin.Control
{
    public partial class SelectProduct : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        private string _width;
        private string _onchange;
        private string _PName;
        private int _PID = 0;
        private string _title = "选择产品";
        private string dsType="1";
        /// <summary>
        /// 控件宽度
        /// </summary>
        public string width
        {
            get
            {
                return (_width == null) ? "" : _width;
            }
            set
            {
                _width = value;
            }
        }
        /// <summary>
        /// 促销类型
        /// </summary>
        public string DsType
        {
            get { return dsType; }
            set { dsType = value; }
        }
        public string onChange
        {
            get
            {
                return (_onchange == null) ? "" : _onchange;
            }
            set
            {
                _onchange = value;
            }
        }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string PName
        {
            get
            {
                return (_PName == null) ? "" : _PName;
            }
            set
            {
                _PName = value;
            }
        }

        /// <summary>
        /// 产品编号
        /// </summary>
        public int PID
        {
            get
            {
                return _PID;
            }
            set
            {
                if (value != 0)
                {
                    YXShop.BLL.Product data = new YXShop.BLL.Product();
                    List<YXShop.Model.Product> datas = data.GetId(value);
                    if (datas.Count > 0)
                    {
                        _PName = datas[0].Pro_Name;
                    }
                    else
                    { _PName = string.Empty; }
                    _PID = value;
                   
                }
                else
                {
                    _PID = 0;
                    _PName = string.Empty;
                }
            }
        }
        public string title
        {
            get
            {
                return (_title == null) ? "" : _title;
            }
            set
            {
                _title = value;
            }
        }
        public bool ReadOnly
        {
            get
            {
                if (ViewState["ReadOnly"] == null)
                {
                    return false;
                }
                else
                {
                    return (bool)ViewState["ReadOnly"];
                }
            }
            set
            {
                ViewState["ReadOnly"] = value;
            }
        }
        #region Web 窗体设计器生成的代码
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
            //
            //InitializeComponent();
            base.OnInit(e);
            _PName = Request[ClientID + "Name"];
            if ((Request[ClientID + "Code"] != null) && (Request[ClientID + "Code"] != string.Empty))
            {
                PID = int.Parse(Request[ClientID + "Code"]);
            }
            else
            {
                PID = 0;
            }

            
        }

        /// <summary>
        ///		设计器支持所需的方法 - 不要使用代码编辑器
        ///		修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.Load += new System.EventHandler(this.Page_Load);

        }
        #endregion
    }
}

⌨️ 快捷键说明

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