Ejemplo n.º 1
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        private void InitData()
        {
            CMS.DAL.CMS_NewsType dal = new CMS.DAL.CMS_NewsType();
                DataTable dt = dal.GetList("").Tables[0];

                this.rptClassList.DataSource = dt;
                this.rptClassList.DataBind();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据类型ID获取类型名称
        /// </summary>
        /// <param name="ClassID"></param>
        /// <returns></returns>
        public string getClassName(int ClassID)
        {
            string strClassName = "";
            CMS.DAL.CMS_NewsType dal = new CMS.DAL.CMS_NewsType();
            CMS.Model.CMS_NewsType model = dal.GetModel(ClassID);

            strClassName = model.CMS_TypeName;
            return strClassName;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 初始化下拉列表
        /// </summary>
        private void InitDropDownList()
        {
            CMS.DAL.CMS_NewsType dal = new CMS.DAL.CMS_NewsType();
            DataSet ds = dal.GetList("");

            this.ddlNewType.Items.Add(new ListItem("<==请选择==>", "0"));

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                ListItem item = new ListItem();
                item.Text = ds.Tables[0].Rows[i]["CMS_TypeName"].ToString();
                item.Value = ds.Tables[0].Rows[i]["ID"].ToString();
                this.ddlNewType.Items.Add(item);
            }
        }