Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["uid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        //if (this.Request.QueryString["deptid"] != null)
        //    this.deptid = this.Request.QueryString["deptid"].ToString();

        if (this.Request.QueryString["keywords"] != null)
            this.keywords = this.Request.QueryString["keywords"].ToString();

        if (this.Request.QueryString["cid"] != null)
        {
            this.cid = this.Request.QueryString["cid"].ToString();
            this.txtcid.Text = this.Request.QueryString["cid"].ToString();
        }
        this.pageSize = 10; //每页数量
        if (!Page.IsPostBack)
        {
            //DeptBind(this.cid);  //绑定栏目
            //判断权限
            TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();
            if (JpRoles.ifhaveAuthorRoleBycidanduid(this.Session["uid"].ToString(), this.cid) != true)
            {
                this.Response.Write("<script>alert('你没有该栏目的编辑权限,请联系管理员!');</script>");
                return;
            }
            TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
            DataTable dtcol = JpColumns.GetColumnBycid(this.cid);
            if (dtcol.Rows[0]["hotpublish"].ToString() == "1")
            {
                this.tdnewdoc.Visible = false;
            }
            TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
            if (JpRoleuser.isHaveRole("Role9999", this.Session["uid"].ToString()) == true)
            {
                btnDelete.Visible = true;
            }
            else
            {
                btnDelete.Visible = false;
            }
            RptBind();

        }
    }
Exemple #2
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());
            }
        }
    }
Exemple #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;
 }
Exemple #4
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;
 }
Exemple #5
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        string uid = txtuid.Text;
        string cid = txtcid.Text;

        TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
        TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();
        DataTable dt = new DataTable();
        if (this.txtcid.Text == "")
            dt = JpColumns.GetFirstlevcolumns_online();
        else
            dt = JpColumns.GetSubColumnsOrderbysort_online(this.txtcid.Text);

        this.totalCount = dt.Rows.Count;

        DataTable tempTable = dt.Clone();
        tempTable.Columns.Add(new DataColumn("authorchecked", typeof(string)));
        tempTable.Columns.Add(new DataColumn("editorchecked", typeof(string)));

        for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }

            if (JpRoles.ifhaveAuthorRoleBycidanduid(this.txtuid.Text, dt.Rows[i]["cid"].ToString()) == true)
                dr["authorchecked"] = "checked";
            else
                dr["authorchecked"] = "";

            if (JpRoles.ifhaveEditorRoleBycidanduid(this.txtuid.Text, dt.Rows[i]["cid"].ToString()) == true)
                dr["editorchecked"] = "checked";
            else
                dr["editorchecked"] = "";

            tempTable.Rows.Add(dr);
        }

        this.rptList.DataSource = tempTable;
        this.rptList.DataBind();

        //翻页
        //string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
        //        this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__");
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        string pageUrl = JpCommon.CombUrlTxt("main_columnrole.aspx", "page={0}&rnd={1}&cid={2}&uid={3}",
            "__id__", System.Guid.NewGuid().ToString(), cid, uid);
        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }