Beispiel #1
0
    //关健字查询
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        string pageUrl;
        TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();

        pageUrl = JpCommon.CombUrlTxt("list_article_tg.aspx", "rnd={0}&keywords={1}&cid={2}&input={3}",
        "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.txtcid.Text + "", "" + this.Session["uid"].ToString() + "");

        Response.Redirect(pageUrl);
    }
Beispiel #2
0
 private void ChkRole(string Roleid)
 {
     TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
     if (JpRoleuser.isHaveRole(Roleid, this.Session["uid"].ToString()) == true || JpRoleuser.isHaveRole("Role9999", this.Session["uid"].ToString()) == true)
     {
         btnSubmit.Visible = true;
     }
     else
     {
         btnSubmit.Visible = false;
     }
 }
Beispiel #3
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        //先删除当前权限ID下边所有的用户
        TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
        JpRoleuser.DeleteAllbyroleid(this.txtroleid.Value);

        //添加选中的用户
        string[] v_uids = this.txtuserids.Value.Split('+');
        for (int i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                JpRoleuser.ID = System.Guid.NewGuid().ToString();
                JpRoleuser.hy_roleid = this.txtroleid.Value;
                JpRoleuser.hy_userid = v_uids[i];
                JpRoleuser.Insert();
            }
        }
        Response.Write("<script>alert('保存成功!');self.close();</script>");
    }
Beispiel #4
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();

        }
    }
Beispiel #5
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        this.txtKeywords.Text = this.keywords;
        //this.ddlcolname.SelectedValue = this.deptid;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.JpArticle JpArticle = new TPortalClass.JpArticle();
        DataTable dt;
        TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
        dt = JpArticle.GetArticlesBycidAnduidAndtitle_tg(this.txtcid.Text, this.Session["uid"].ToString(), txtKeywords.Text);

        this.totalCount = dt.Rows.Count;
        DataTable tempTable = dt.Clone();
        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];
            }
            tempTable.Rows.Add(dr);
        }
        rptList.DataSource = tempTable;
        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();
        //TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
        string pageUrl;
        pageUrl = JpCommon.CombUrlTxt("list_article_tg.aspx", "page={0}&rnd={1}&keywords={2}&cid={3}&input={4}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.txtcid.Text + "", "" + this.Session["uid"].ToString() + "");

        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["uid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        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)
        {
            ////新建按钮热发布时显示
            //TPortalClass.JpColumns JpColumns = new TPortalClass.JpColumns();
            //DataTable dtcol = JpColumns.GetColumnBycid(this.cid);
            //this.lbldht.Text = dtcol.Rows[0]["cname"].ToString();
            //if (dtcol.Rows[0]["hotpublish"].ToString() == "1")
            //{
            //    this.tdnewdoc.Visible = true;
            //}
            //else
            //{
            //    this.tdnewdoc.Visible = false;
            //}

            ////判断权限
            //TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();
            //if (JpRoles.ifhaveEditorRoleBycidanduid(this.Session["uid"].ToString(), this.cid) != true)
            //{
            //    this.Response.Write("<script>alert('你没有该栏目的发布权限,请联系管理员!');</script>");
            //    return;
            //}
            TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
            if (JpRoleuser.isHaveRole("Role9999", this.Session["uid"].ToString()) == true)
            {
                btnDelete.Visible = true;
            }
            else
            {
                btnDelete.Visible = false;
            }

            RptBind();

            if (txtcid.Text.Substring(0, 3) == "003" && txtcid.Text != "003004")
            {
                ls_show = "";
                ls_width1 = "40%";
                ls_width2 = "10%";
            }
            else
            {
                ls_show = "none";
                ls_width1 = "50%";
                ls_width2 = "0%";
            }
        }
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["uid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        if (!this.IsPostBack)
        {
            string ls_roleid="";
            string ls_roleusers="";
            TPortalClass.JpRoleuser Hyoa_roleuser = new TPortalClass.JpRoleuser();
            if (this.Request.QueryString["roleid"] != null)
            {
                ls_roleid = this.Request.QueryString["roleid"].ToString();
                //得到该权限下边已经配置的人员
                DataTable dtjudeg = Hyoa_roleuser.Getroleusersbyroleid(ls_roleid);
                if (dtjudeg.Rows.Count > 0)
                {
                    for (int i = 0; i < dtjudeg.Rows.Count; i++)
                    {
                        ls_roleusers += "," + dtjudeg.Rows[i]["hy_userid"].ToString();
                    }
                    ls_roleusers += ",";
                }
            }

            Response.Write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
            Response.Write("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"zh-cn\">");
            Response.Write("<Head><Title>人员列表</Title>");
            Response.Write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">");
            Response.Write("<meta name=\"generator\" content=\"editplus\" />");
            Response.Write("<link type=\"text/css\" rel=\"stylesheet\" href=\"hyhtml/ltree/resources/css/lTREE.checkbox.css\" />");
            Response.Write("<style type=\"text/css\">");
            Response.Write("#lTREEMenuDEMO {border:1px solid #ccc;margin:3px;padding:3px;}");
            Response.Write("#infoBox {position:absolute;left:450px;top:40px;border:1px solid #ccc;width:400px;padding:0 10px;font-family:\"宋体\",Geneva,Arial,sans-serif;line-height:150%;}");
            Response.Write("#debugMSG strong {color:#f00;}");
            Response.Write("</style>");
            Response.Write("<!--[if IE 6]>");
            Response.Write("<script>");
            Response.Write("document.execCommand(\"BackgroundImageCache\", false, true);");
            Response.Write("</script>");
            Response.Write("<![endif]-->");
            Response.Write("</Head>");
            Response.Write("<body style=\"padding:2px;\">");
            //Response.Write("<form>");

            Response.Write("<div class=\"lTREEMenu lTREENormal\" id=\"lTREEMenuDEMO\">");
            Response.Write("<dl>");

            Response.Write("<dl>");
            Response.Write("<dd><input type=\"checkbox\" name=\"SelAll\" value=\"全选\" onclick=\"SelectAll();\" style=\"width:13;\"> <b>人员列表</b>");
            Response.Write("<dl>");

            //得到一级部门
            TPortalClass.JpDepts Hyoa_dept = new TPortalClass.JpDepts();
            DataTable dt = Hyoa_dept.GetFirstlevdepts();
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //输出一级部门头部
                    Response.Write("<dd class=\"folderClose\">");
                    Response.Write("<input type=\"checkbox\" name=\"Dept" + dt.Rows[i]["deptid"].ToString() + "\" value=\"" + dt.Rows[i]["deptid"].ToString() + "\">");
                    Response.Write(dt.Rows[i]["deptname"].ToString());
                    Response.Write("<dl>");

                    //有下一级部门
                    if (Hyoa_dept.isHaveSubDept(dt.Rows[i]["deptid"].ToString()) == true)
                    {
                        GetNextDept(dt.Rows[i]["deptid"].ToString(), ls_roleusers);
                    }
                    else
                    {
                        //输出一级部门的人员
                        TPortalClass.JpUsers Hyoa_user = new TPortalClass.JpUsers();
                        DataTable dtuser = Hyoa_user.GetUsers(dt.Rows[i]["deptid"].ToString());
                        if (dtuser.Rows.Count > 0)
                        {
                            for (int j = 0; j < dtuser.Rows.Count; j++)
                            {
                                Response.Write("<dt>");
                                //判断已选中
                                if (ls_roleusers.Contains("," + dtuser.Rows[j]["uid"].ToString() + ","))
                                {
                                    Response.Write("<input type=\"checkbox\" checked=\"checked\" name=\"User" + dtuser.Rows[j]["uid"].ToString() + "_subuser\" value=\"");
                                    Response.Write(dtuser.Rows[j]["uid"].ToString() + "|" + dtuser.Rows[j]["uname"].ToString() + "\" text=\"" + dtuser.Rows[j]["uname"].ToString() + "\">");
                                    Response.Write(dtuser.Rows[j]["uname"].ToString());
                                    Response.Write("</dt>");
                                }
                                else
                                {
                                    Response.Write("<input type=\"checkbox\" name=\"User" + dtuser.Rows[j]["uid"].ToString() + "_subuser\" value=\"");
                                    Response.Write(dtuser.Rows[j]["uid"].ToString() + "|" + dtuser.Rows[j]["uname"].ToString() + "\" text=\"" + dtuser.Rows[j]["uname"].ToString() + "\">");
                                    Response.Write(dtuser.Rows[j]["uname"].ToString());
                                    Response.Write("</dt>");
                                }
                            }
                        }
                    }

                    //输出一级部门尾部
                    Response.Write("</dl>");
                    Response.Write("</dd>");
                }
            }

            Response.Write("</dl>");
            Response.Write("</dd>");
            Response.Write("</dl>");
            Response.Write("</div>");

            Response.Write("<script type=\"text/javascript\" src=\"hyhtml/ltree/js/lTREE.js\"></script>");
            Response.Write("<script class=\"lJSFDemo\" type=\"text/javascript\"> ");
            Response.Write("        var lTree = new lTREE();");
            Response.Write("        lTree.config({");
            Response.Write("	        path	: \"dl dd\"");
            Response.Write("        });");
            Response.Write("        lTree.tagName({");
            Response.Write("	        folder	: \"DD\",");
            Response.Write("	        file	 	: \"DT\"");
            Response.Write("        });");
            Response.Write("        lTree.className({");
            Response.Write("	        folderClose	: \"folderClose\",");
            Response.Write("	        lastChild	 	: \"lastChild\"");
            Response.Write("        });");
            Response.Write("var t=new Date(),timer=[];");
            Response.Write("lTree.build(\"lTREEMenuDEMO\");");
            Response.Write("timer.push(new Date()-t);");
            /**************************************
            * 给树内所有复选框添加相应事件 *
            * Start */
            Response.Write("function chkAll(){");
            Response.Write("var a=this.parentNode.getElementsByTagName(\"input\"),b=this.checked;");
            Response.Write("for(var i=0,l=a.length; i<l;i++) {");
            Response.Write("a[i].checked=b;");
            Response.Write("}");
            Response.Write("}");
            Response.Write("function chkOne(){");
            Response.Write("var a=this,b=this.checked,p=lDOM.$(\"lTREEMenuDEMO\"),pn=null;");
            Response.Write("while(a.tagName!=\"DD\" && a!=p) a=a.parentNode;");
            Response.Write("pn=a.getElementsByTagName(\"input\");");
            Response.Write("if(b){");
            Response.Write("for(var i=1,l=pn.length; i<l;i++) {");
            Response.Write("if(!pn[i].checked){");
            Response.Write("b=false;");
            Response.Write("break;");
            Response.Write("}");
            Response.Write("}");
            Response.Write("}");
            Response.Write("pn[0].checked=b;");
            Response.Write("}");
            Response.Write("var arrCHK=lDOM.find(\"dl dd input\",lDOM.$(\"lTREEMenuDEMO\"),{type:\"checkbox\"});");
            Response.Write("arrCHK.each(function(s){");
            Response.Write("if(s.parentNode.tagName==\"DT\"){");
            Response.Write("s.onclick=chkOne;");
            Response.Write("} else {");
            Response.Write("s.onclick=chkAll;");
            Response.Write("}");
            Response.Write("});");
            Response.Write("      </script>");

            //Response.Write("</form>");
            Response.Write("</Body></HTML>");
        }
    }
Beispiel #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["uid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        if (!Page.IsPostBack)
        {
            DataPlay();
            TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
            if (JpRoleuser.isHaveRole("Role9999", this.Session["uid"].ToString()) == true)
            {
                btnsave.Visible = true;
            }
            else
            {
                btnsave.Visible = false;
            }
        }
    }
Beispiel #9
0
 //检查权限
 private string ChkRole(string Roleid)
 {
     string ls_return = "0";
     TPortalClass.JpRoleuser JpRoleuser = new TPortalClass.JpRoleuser();
     if (JpRoleuser.isHaveRole(Roleid, this.Session["uid"].ToString()) == true || JpRoleuser.isHaveRole("Role9999", this.Session["uid"].ToString()) == true)
     {
         ls_return = "1";
     }
     return ls_return;
 }