Example #1
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;
 }
Example #2
0
    //商城管理
    public string ls_scgl()
    {
        TPortalClass.DAO db = new TPortalClass.DAO();
        string ls_return = "";
        if (Session["uid"].ToString() == "")
        {
        }
        else
        {
            TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();

            if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), "006"))
            {
                ls_return += "<li  isexpand=\"false\"><span>商城投稿</span>";
                ls_return += "<ul>";
                #region
                DataTable dt = new DataTable();
                //文章发布左侧动态产生
                //得到一级部门
                TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
                string sql_Firstlevcolumns = "Select * from JpColumns where len(cid)=6 and cid like '006%' and online=1 order by csort ";
                dt = db.GetDataTable(sql_Firstlevcolumns);
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        //有下一级部门
                        string sql_isHaveSubColumn = " select * from JpColumns  where cid like '" + dt.Rows[i]["cid"].ToString() + "%' and len(cid) = 9 and online = 1  order by csort ";
                        DataTable dt_isHaveSbuColumn = db.GetDataTable(sql_isHaveSubColumn);
                        bool b_isHaveSbuColumn;
                        if (dt_isHaveSbuColumn.Rows.Count > 0)
                        {
                            b_isHaveSbuColumn = true;
                        }
                        else
                        {
                            b_isHaveSbuColumn = false;
                        }
                        if (b_isHaveSbuColumn == true)
                        {
                            string sql_ifshowcolumn = "	select * from JpRoles a,JpColumns b  where a.cid=b.cid and a.role='author' and a.uid='" + Session["uid"].ToString() + "' and a.cid like '" + dt.Rows[i]["cid"].ToString() + "%' ";
                            DataTable dt_ifshowcolumn = db.GetDataTable(sql_isHaveSubColumn);
                            bool b_ifshowcolumn;
                            if (dt_ifshowcolumn.Rows.Count > 0)
                            {
                                b_ifshowcolumn = true;
                            }
                            else
                            {
                                b_ifshowcolumn = false;
                            }
                            if (b_ifshowcolumn == true)
                            {
                                string sql_ifhaveAuthorRoleBycidanduid = "  select * from JpRoles  where role='author' and uid='" + Session["uid"].ToString() + "' and cid='" + dt.Rows[i]["cid"].ToString() + "' ";
                                DataTable dt_ifhaveAuthorRoleBycidanduid = db.GetDataTable(sql_isHaveSubColumn);
                                bool b_ifhaveAuthorRoleBycidanduid;
                                if (dt_ifhaveAuthorRoleBycidanduid.Rows.Count > 0)
                                {
                                    b_ifhaveAuthorRoleBycidanduid = true;
                                }
                                else
                                {
                                    b_ifhaveAuthorRoleBycidanduid = false;
                                }
                                if (b_ifhaveAuthorRoleBycidanduid == 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
                        {
                            DataTable dt_ifhaveAuthorRoleBycidanduid = db.GetDataTable(sql_isHaveSubColumn);
                            bool b_ifhaveAuthorRoleBycidanduid;
                            if (dt_ifhaveAuthorRoleBycidanduid.Rows.Count > 0)
                            {
                                b_ifhaveAuthorRoleBycidanduid = true;
                            }
                            else
                            {
                                b_ifhaveAuthorRoleBycidanduid = false;
                            }
                            if (b_ifhaveAuthorRoleBycidanduid == true)
                            {
                                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>";
                            }
                        }
                    }
                }
                #endregion
                ls_return += "</ul>";
                ls_return += "</li>";
            }
            if (JpRoles.ifshowcolumn_sh(Session["uid"].ToString(), "006"))
            {
                ls_return += "<li  isexpand=\"false\"><span>商城审核</span>";
                ls_return += "<ul>";
                #region
                DataTable dt2 = new DataTable();
                //文章发布左侧动态产生
                //得到一级部门
                TPortalClass.JpColumns JpColumns2 = new TPortalClass.JpColumns();
                TPortalClass.JpRoles JpRoles2 = new TPortalClass.JpRoles();
                string sql_Firstlevcolumns2 = "Select * from JpColumns where len(cid)=6 and cid like '006%' and online=1 order by csort ";
                dt2 = db.GetDataTable(sql_Firstlevcolumns2);
                if (dt2.Rows.Count > 0)
                {
                    for (int i = 0; i < dt2.Rows.Count; i++)
                    {
                        //有下一级部门
                        string sql_isHaveSubColumn2 = " select * from JpColumns  where cid like '" + dt2.Rows[i]["cid"].ToString() + "%' and len(cid) = 9 and online = 1  order by csort ";
                        DataTable dt_isHaveSbuColumn2 = db.GetDataTable(sql_isHaveSubColumn2);
                        bool b_isHaveSbuColumn2;
                        if (dt_isHaveSbuColumn2.Rows.Count > 0)
                        {
                            b_isHaveSbuColumn2 = true;
                        }
                        else
                        {
                            b_isHaveSbuColumn2 = false;
                        }
                        if (b_isHaveSbuColumn2 == true)
                        {
                            string sql_ifshowcolumn2 = "	select * from JpRoles a,JpColumns b  where a.cid=b.cid and a.role='editor' and a.uid='" + Session["uid"].ToString() + "' and a.cid like '" + dt2.Rows[i]["cid"].ToString() + "%' ";
                            DataTable dt_ifshowcolumn2 = db.GetDataTable(sql_isHaveSubColumn2);
                            bool b_ifshowcolumn2;
                            if (dt_ifshowcolumn2.Rows.Count > 0)
                            {
                                b_ifshowcolumn2 = true;
                            }
                            else
                            {
                                b_ifshowcolumn2 = false;
                            }
                            if (b_ifshowcolumn2 == true)
                            {
                                string sql_ifhaveAuthorRoleBycidanduid2 = "  select * from JpRoles  where role='editor' and uid='" + Session["uid"].ToString() + "' and cid='" + dt2.Rows[i]["cid"].ToString() + "' ";
                                DataTable dt_ifhaveAuthorRoleBycidanduid2 = db.GetDataTable(sql_isHaveSubColumn2);
                                bool b_ifhaveAuthorRoleBycidanduid2;
                                if (dt_ifhaveAuthorRoleBycidanduid2.Rows.Count > 0)
                                {
                                    b_ifhaveAuthorRoleBycidanduid2 = true;
                                }
                                else
                                {
                                    b_ifhaveAuthorRoleBycidanduid2 = false;
                                }
                                if (b_ifhaveAuthorRoleBycidanduid2 == true)
                                {
                                    ls_return += "<li isexpand=\"false\" url=\"shop/list_shop_sh.aspx?cid=" + dt2.Rows[i]["cid"].ToString() + "\">";
                                }
                                else
                                {
                                    ls_return += "<li isexpand=\"false\">";
                                }
                                ls_return += "<span>" + dt2.Rows[i]["cname"].ToString() + "</span>";
                                ls_return += "<ul>";
                                ls_return += GetShopNextColumn_editor(dt2.Rows[i]["cid"].ToString());
                                ls_return += "</ul>";
                                ls_return += "</li>";
                            }
                        }
                        else
                        {
                            DataTable dt_ifhaveAuthorRoleBycidanduid2 = db.GetDataTable(sql_isHaveSubColumn2);
                            bool b_ifhaveAuthorRoleBycidanduid2;
                            if (dt_ifhaveAuthorRoleBycidanduid2.Rows.Count > 0)
                            {
                                b_ifhaveAuthorRoleBycidanduid2 = true;
                            }
                            else
                            {
                                b_ifhaveAuthorRoleBycidanduid2 = false;
                            }
                            if (b_ifhaveAuthorRoleBycidanduid2 == true)
                            {
                                ls_return += "<li url=\"shop/list_shop_tg.aspx?cid=" + dt2.Rows[i]["cid"].ToString() + "\"><span>";
                                ls_return += dt2.Rows[i]["cname"].ToString() + "</span></li>";
                            }
                        }
                    }
                }
                #endregion
                ls_return += "</ul>";
                ls_return += "</li>";
            }
        }
        return ls_return;
    }
Example #3
0
 private string GetNextColumn_author(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_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;
 }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["uid"].ToString() == "")
        {
            this.Response.Redirect("login.aspx?url=" + this.Request.RawUrl.ToString());
        }
        else
        {
            TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers(Session["uid"].ToString());
            DataTable dt = new DataTable();
            lbluserinfo.Text = JpUsers.uname;
            if (JpUsers.deptid != "")
            {
                TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
                dt = JpDepts.GetDept(JpUsers.deptid);
                if (dt.Rows.Count > 0)
                {
                    lbluserinfo.Text += "(" + dt.Rows[0]["deptname"].ToString() + ")";
                }
            }

            #region 根据权限判断导航显示情况
            this.pis_wzfb.Visible = false;
            this.pis_wztg.Visible = false;
            this.pis_wzsh.Visible = false;
            this.pis_yhgl.Visible = false;
            this.pis_lmgl.Visible = false;
            this.pis_xtsz.Visible = false;
            this.pis_plgl.Visible = false;
            this.pis_gggl.Visible = false;
            this.pis_hdgl.Visible = false;

            this.li_adv_tg.Visible = false;
            this.li_adv_sh.Visible = false;

            li_activity_tg.Visible = false;
            li_activity_sh.Visible = false;
            li_activityusers.Visible = false;
            pis_wqgl.Visible = false;
            this.pis_xwgl.Visible = false;
            pis_ssyz.Visible = false;
            //文章发布
            if (ChkRole("Role0001") == "1")
            {
                this.pis_wzfb.Visible = true;
            }
            else
            {
                if (ChkRole("Role0002") == "1")
                {
                    ls_gobal1 = "global_channel_tree2";
                    ls_gobal2 = "global_channel_tree1";
                }
                else
                {
                    if (ChkRole("Role0003") == "1")
                    {
                        ls_gobal1 = "global_channel_tree3";
                        ls_gobal3 = "global_channel_tree1";
                    }
                }
            }
            //文章投稿
            if (ChkRole("Role0002") == "1")
            {
                this.pis_wztg.Visible = true;
            }
            //文章审核
            if (ChkRole("Role0003") == "1")
            {
                this.pis_wzsh.Visible = true;
            }
            //评论管理
            if (ChkRole("Role0004") == "1")
            {
                this.pis_plgl.Visible = true;
            }
            //维权帮办
            if (ChkRole("Role0012") == "1")
            {
                this.pis_wqgl.Visible = true;
            }
            //新闻爆料
            if (ChkRole("Role0013") == "1")
            {
                this.pis_xwgl.Visible = true;
            }
            //新闻爆料
            if (ChkRole("Role0014") == "1")
            {
                this.pis_ssyz.Visible = true;
            }
            //活动管理
            if (ChkRole("Role0005") == "1")
            {
                this.pis_hdgl.Visible = true;
                TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();

                if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), "008"))
                {
                    li_activity_tg.Visible = true;
                }
                if (JpRoles.ifshowcolumn_sh(Session["uid"].ToString(), "008"))
                {
                    li_activity_sh.Visible = true;
                }
            }
            //广告管理
            if (ChkRole("Role0006") == "1")
            {
                this.pis_gggl.Visible = true;
                TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();

                if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), "007"))
                {
                    li_adv_tg.Visible = true;
                }
                if (JpRoles.ifshowcolumn_sh(Session["uid"].ToString(), "007"))
                {
                    li_adv_sh.Visible = true;
                }
            }
            //活动报名审核
            if (ChkRole("Role0010") == "1")
            {
                this.li_activityusers.Visible = true;
            }
            //用户管理
            if (ChkRole("Role0007") == "1")
            {
                this.pis_yhgl.Visible = true;
            }
            //栏目管理
            if (ChkRole("Role0008") == "1")
            {
                this.pis_lmgl.Visible = true;
            }
            //系统设置
            if (ChkRole("Role0011") == "1")
            {
                this.pis_xtsz.Visible = true;
            }
            #endregion
        }
    }