示例#1
0
    private void fillUserChannel()
    {
        ddlUserChannel.Items.Clear();

        Model.ChannelProgram[] mcps = null;

        if (Session["UserRole"] != null && Session["UserRole"].ToString() == "0")
        {
            // 管理员加载所有频道栏目列表
            mcps = dbll.getCP("0");        // 所有频道
        }
        else if (Session["UserRole"] != null && Session["UserRole"].ToString() == "1")
        {
            // 制片人仅加载所属频道栏目列表
            if (Session["UserID"] != null && Session["UserID"].ToString() != "")
            {
                string userID = Session["UserID"].ToString();
                mcps = dbll.getUsedChannelByUserID(userID);
            }
        }

        if (mcps != null && mcps.Length > 0)
        {
            for (int i = 0; i < mcps.Length; i++)
            {
                ListItem li = new ListItem();
                li.Text  = mcps[i].CP_Name;
                li.Value = mcps[i].CP_ID.ToString();
                ddlUserChannel.Items.Add(li);
            }
        }

        ddlUserChannel.Items.Insert(0, new ListItem("-- 所有频道 --", "-1"));
    }
示例#2
0
 /// <summary>
 /// 初始化栏目
 /// </summary>
 /// <param name="categoryID"></param>
 protected void initDDLChannel(string categoryID)
 {
     clearChannel();
     mChannelInfo = dbll.getCP(categoryID);
     for (int i = 0; i < mChannelInfo.Length; i++)
     {
         ListItem newItem = new ListItem();
         newItem.Text  = mChannelInfo[i].CP_Name;
         newItem.Value = mChannelInfo[i].CP_ID.ToString();
         ddl_channel.Items.Add(newItem);
     }
 }
示例#3
0
 protected void initlboxChannel()
 {
     lboxChannel.Items.Clear();
     mChannelInfo = dbll.getCP("0");
     for (int i = 0; i < mChannelInfo.Length; i++)
     {
         ListItem liChannel = new ListItem();
         liChannel.Value = mChannelInfo[i].CP_ID.ToString();
         liChannel.Text  = mChannelInfo[i].CP_Name;
         liChannel.Attributes.Add("title", liChannel.Text);
         lboxChannel.Items.Add(liChannel);
     }
 }
示例#4
0
    private void ddlChannelDataBind()
    {
        ddlChannel.Items.Clear();

        Model.ChannelProgram[] mcp = dbll.getCP("0");    // 获取所有栏目
        if (mcp.Length == 0)
        {
            return;
        }

        for (int i = 0; i < mcp.Length; i++)
        {
            ListItem li = new ListItem();
            li.Value = mcp[i].CP_ID.ToString();
            li.Text  = mcp[i].CP_Name.ToString();

            ddlChannel.Items.Add(li);
        }

        ListItem nli = new ListItem();

        nli.Value = "-1";
        nli.Text  = "--- 请选择频道 ---";
        ddlChannel.Items.Insert(0, nli);
    }
示例#5
0
 protected void initTrProgram()
 {
     if (trProgram.Nodes.Count > 0)
     {
         trProgram.Nodes.Clear();
     }
     mChannelInfo = dbll.getCP("0");
     for (int i = 0; i < mChannelInfo.Length; i++)
     {
         TreeNode nodeChannel = new TreeNode();
         nodeChannel.Value = mChannelInfo[i].CP_ID.ToString();
         nodeChannel.Text  = mChannelInfo[i].CP_Name;
         trProgram.Nodes.Add(nodeChannel);
         addChileNode(nodeChannel);
     }
     trProgram.CollapseAll();
 }
示例#6
0
    protected void initTrChannel()
    {
        if (trChannel.Nodes.Count > 0)
        {
            trChannel.Nodes.Clear();
        }
        TreeNode nodeChannelList = new TreeNode();

        nodeChannelList.Value = "频道列表";
        nodeChannelList.Text  = "频道列表";
        trChannel.Nodes.Add(nodeChannelList);
        mChannelInfo = dbll.getCP("0");
        for (int i = 0; i < mChannelInfo.Length; i++)
        {
            TreeNode nodeChannel = new TreeNode();
            nodeChannel.Value = mChannelInfo[i].CP_ID.ToString();
            nodeChannel.Text  = mChannelInfo[i].CP_Name;
            nodeChannelList.ChildNodes.Add(nodeChannel);
        }
        trChannel.ExpandAll();
    }