Esempio n. 1
0
    private void addsubcolumn(DataTable tempTable, string pi_cid, string pi_cname)
    {
        TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();
        TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();

        //先插入当前栏目
        DataRow dr = tempTable.NewRow();
        dr["cid"] = pi_cid;
        dr["cname"] = pi_cname;
        if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), pi_cid) == true && JpColumns.ifhotpublish(pi_cid) == false)
        {
            //有下一级
            if (JpColumns.isHaveSubColumn_online(pi_cid) == true)
            {

            }
            else
            {
                tempTable.Rows.Add(dr);
            }
        }
        //判断是否有下级栏目
        DataTable dt = new DataTable();
        dt = JpColumns.GetColumns(pi_cid);
        if (dt.Rows.Count > 0)
        {
            //有下一级目录
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                addsubcolumn(tempTable, dt.Rows[i]["cid"].ToString(), pi_cname + ">>" + dt.Rows[i]["cname"].ToString());
            }
        }
    }
Esempio n. 2
0
    private string GetNextColumn_sh(string pis_cid)
    {
        string ls_return = "";

        //得到二级部门
        TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
        TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();
        DataTable dt = JpColumns.GetSubColumnsOrderbysort_online(pis_cid);
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                //有下一级部门
                if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true)
                {
                    if (JpRoles.ifshowcolumn_sh(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true)
                    {
                        if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false)
                        {
                            ls_return += "<li isexpand=\"false\" url=\"article/list_article_sh.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\">";
                        }
                        else
                        {
                            ls_return += "<li isexpand=\"false\">";
                        }
                        ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>";
                        ls_return += "<ul>";
                        ls_return += GetNextColumn_sh(dt.Rows[i]["cid"].ToString());
                        ls_return += "</ul>";
                        ls_return += "</li>";
                    }
                }
                else
                {
                    if (JpRoles.ifhaveEditorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false)
                    {
                        ls_return += "<li url=\"article/list_article_sh.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>";
                        ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>";
                    }
                }
            }
        }
        return ls_return;
    }
Esempio n. 3
0
 private string GetShopNextColumn_author(string pis_cid)
 {
     TPortalClass.DAO db = new TPortalClass.DAO();
     string ls_return = "";
     //得到二级部门
     TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
     TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();
     DataTable dt = JpColumns.GetSubColumnsOrderbysort_online(pis_cid);
     string sql_GetSubColumnsOrderbysort_online = " select * from JpColumns  where online=1 and cid like '" + pis_cid + "%' and len(cid)=9  order by csort";
     dt = db.GetDataTable(sql_GetSubColumnsOrderbysort_online);
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             //有下一级部门
             if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true)
             {
                 if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true)
                 {
                     if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true)
                     {
                         ls_return += "<li isexpand=\"false\" url=\"shop/list_shop_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\">";
                     }
                     else
                     {
                         ls_return += "<li isexpand=\"false\">";
                     }
                     ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>";
                     ls_return += "<ul>";
                     ls_return += GetShopNextColumn_author(dt.Rows[i]["cid"].ToString());
                     ls_return += "</ul>";
                     ls_return += "</li>";
                 }
             }
             else
             {
                 if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false)
                 {
                     ls_return += "<li url=\"shop/list_shop_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>";
                     ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>";
                 }
             }
         }
     }
     return ls_return;
 }
Esempio n. 4
0
    //显示文章投稿栏目
    public string ls_wztg()
    {
        string ls_return = "";
        if (Session["uid"].ToString() == "")
        {
        }
        else
        {
            DataTable dt = new DataTable();
            //文章发布左侧动态产生
            //得到一级部门
            TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
            TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();
            dt = JpColumns.GetFirstlevcolumns_online();

            if (dt.Rows.Count > 0)
            {

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //有下一级部门
                    if (JpColumns.isHaveSubColumn_online(dt.Rows[i]["cid"].ToString()) == true)
                    {

                        if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true)
                        {

                            if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false)
                            {
                                ls_return += "<li isexpand=\"false\" url=\"article/list_article_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\">";
                            }
                            else
                            {
                                ls_return += "<li isexpand=\"false\">";
                            }
                            ls_return += "<span>" + dt.Rows[i]["cname"].ToString() + "</span>";
                            ls_return += "<ul>";
                            ls_return += GetNextColumn_author(dt.Rows[i]["cid"].ToString());
                            ls_return += "</ul>";
                            ls_return += "</li>";
                        }
                    }
                    else
                    {
                        if (JpRoles.ifhaveAuthorRoleBycidanduid(Session["uid"].ToString(), dt.Rows[i]["cid"].ToString()) == true && JpColumns.ifhotpublish(dt.Rows[i]["cid"].ToString()) == false)
                        {
                            ls_return += "<li url=\"article/list_article_tg.aspx?cid=" + dt.Rows[i]["cid"].ToString() + "\"><span>";
                            ls_return += dt.Rows[i]["cname"].ToString() + "</span></li>";
                        }
                    }
                }
            }
        }
        return ls_return;
    }