예제 #1
0
 /// <summary>
 /// 绑定广告位
 /// </summary>
 private void DataBindAdv()
 {
     dt = AdvBll.GetTableList(0);
     this.rptList.DataSource = dt;
     this.rptList.DataBind();
     this.trNoRecord.Style["display"] = dt.Rows.Count == 0 ? "" : "none";
 }
예제 #2
0
        /// <summary>
        /// 绑定新闻分类
        /// </summary>
        private void DataBindCategory()
        {
            DataTable dt = bll.GetTableList(0);

            this.ddlAdv.Items.Clear();
            this.ddlAdv.Items.Add(new ListItem("广告位根目录", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                int    ClassLayer = Convert.ToInt32(dr["ClassLayer"]);
                string Id         = dr["Id"].ToString().Trim();
                string Name       = dr["Title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    Name = "├ " + Name;
                    this.ddlAdv.Items.Add(new ListItem(Name, Id));
                }
                else
                {
                    Name = "├ " + Name;
                    Name = TravelAgent.Tool.StringPlus.StringOfChar(ClassLayer - 1, " ") + Name;

                    this.ddlAdv.Items.Add(new ListItem(Name, Id));
                }
            }
        }