SuLei.Web/admin/settings/builder_html.aspx.cs

(完整代码) 1KB

using System;
using System.Text;
using System.Data;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SuLei.Common;

namespace SuLei.Web.admin.settings
{
    public partial class builder_html : SuLei.UI.ManagePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("sys_builder_html", SLEnums.ActionEnum.View.ToString()); //检查权限
                RptBind();
            }
        }

        #region 数据绑定=================================
        private void RptBind()
        {
            BLL.sl_sites bll = new BLL.sl_sites();
            DataSet ds = bll.GetList(0, "is_lock=0", "sort_id asc,id desc");
            this.rptList.DataSource = ds;
            this.rptList.DataBind();
        }
        #endregion

        //嵌套绑定
        protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            BLL.sl_site_channel bll = new BLL.sl_site_channel();
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                Repeater rptChannel = (Repeater)e.Item.FindControl("rptChannel");
                //找到分类Repeater关联的数据项 
                DataRowView drv = (DataRowView)e.Item.DataItem;
                //提取站点ID 
                int siteId = Convert.ToInt32(drv["id"]);
                int parentId = Convert.ToInt32(drv["parent_id"]); //如果父节点不等于0则基于其它站点数据
                if (parentId > 0)
                {
                    siteId = parentId;
                }
                //根据分类ID查询并绑定所属频道 
                rptChannel.DataSource = bll.GetList(0, "site_id=" + siteId, "sort_id asc,id desc");
                rptChannel.DataBind();
            }
        }

    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。