Пример #1
0
    //保存排序
    protected void btnSave_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers();
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            int sortId;
            if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
            {
                sortId = 99;
            }
            JpUsers.Updateusort(id, sortId);
        }
        string pageUrl = JpCommon.CombUrlTxt("list_user.aspx", "page={0}&rnd={1}&keywords={2}&deptid={3}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.ddldept.SelectedValue + "");

        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "保存排序", "批量保存用户排序号", Session["uid"].ToString(), Session["uname"].ToString());

        Response.Write("<script>alert('保存排序成功!');window.location='" + pageUrl + "';</script>");
    }
Пример #2
0
    //批量删除
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers();
        string ls_tip = "删除成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                JpUsers.uid = id;
                JpUsers.Delete();
            }
        }
        string pageUrl = JpCommon.CombUrlTxt("list_user.aspx", "page={0}&rnd={1}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");

        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "删除", "批量删除用户记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Пример #3
0
    //保存
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        if (this.txtoldpwd.Text == "")
        {
            this.Response.Write("<script language=javascript>alert('请输入旧密码!')</script>");
            return;
        }
        if (this.txtnewpwd.Text == "")
        {
            this.Response.Write("<script language=javascript>alert('请输入新密码!')</script>");
            return;
        }
        if (this.txtcomfig.Text == "")
        {
            this.Response.Write("<script language=javascript>alert('请输入确认密码!')</script>");
            return;
        }
        if (this.txtnewpwd.Text != this.txtcomfig.Text)
        {
            this.Response.Write("<script language=javascript>alert('输入的新密码和确认密码不一致!')</script>");
            return;
        }

        TPortalClass.JpUsers Users = new TPortalClass.JpUsers();

        String password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtoldpwd.Text, "MD5");
        if (!Users.Login(Session["uid"].ToString(), password))
        {
            this.Response.Write("<script language=javascript>alert('输入旧密码不正确!')</script>");
            return;
        }
        if (Users.DoChPwd(Session["uid"].ToString(), this.txtnewpwd.Text))
        {
            //写系统日志
            TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "修改密码", "修改密码", Session["uid"].ToString(), Session["uname"].ToString());

            this.Response.Write("<script language=javascript>alert('修改密码成功!');window.location='main_xgmm.aspx?rnd=" + System.Guid.NewGuid().ToString() + "';</script>");
        }
        else
        {
            this.Response.Write("<script language=javascript>alert('修改密码失败!');window.location='main_xgmm.aspx?rnd=" + System.Guid.NewGuid().ToString() + "';</script>");
        }
    }
Пример #4
0
    //保存
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.Session["uid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers();
        JpUsers.uid = this.txtuid.Text;
        JpUsers.uname = this.txtuname.Text;
        JpUsers.deptid = this.ddldept.SelectedValue;
        JpUsers.usort = System.Int32.Parse(this.txtusort.Text);
        JpUsers.createtime = System.DateTime.Now.ToString();
        if (this.txtop.Value == "add")
        {
            if (JpUsers.IsExist())
            {
                this.Response.Write("<script language=javascript>alert('该人员已经存在!')</script>");
                return;
            }

            //写系统日志
            TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "新增", "新增用户记录[id:" + this.txtuid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString());
            JpUsers.Insert();
        }
        else
        {
            //写系统日志
            TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            JpCommon.WriteLog(userip, "修改", "修改用户记录[id:" + this.txtuid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString());

            JpUsers.Update();
        }
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
    }
Пример #5
0
    //批量删除
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
        TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers();
        string ls_tip = "删除成功!";
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            //int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            string id = ((HiddenField)rptList.Items[i].FindControl("hidId")).Value;
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                //判断是否还有子部门,如果有子部门不能删除
                DataTable dt_sub = JpDepts.GetSubDepts(id);
                if (dt_sub.Rows.Count > 0)
                {
                    ls_tip = "有下一级组织的信息无法删除,请先删除下一级信息!";
                }
                else
                {
                    //判断部门下边是否存在人员,存在人员也不能删除!
                    DataTable dt_user = JpUsers.GetUsersBydeptid(id);
                    if (dt_user.Rows.Count > 0)
                    {
                        ls_tip = "该组织下还存在用户,无法进行删除!";
                    }
                    else
                    {
                        JpDepts.deptid = id;
                        JpDepts.Delete();
                    }
                }
            }
        }
        string pageUrl = JpCommon.CombUrlTxt("list_bmxx.aspx", "page={0}&rnd={1}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "");

        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "删除", "批量删除组织记录", Session["uid"].ToString(), Session["uname"].ToString());
        Response.Write("<script>alert('" + ls_tip + "');window.location='" + pageUrl + "';</script>");
    }
Пример #6
0
    //初始化密码
    protected void btnpwd_Click(object sender, EventArgs e)
    {
        TPortalClass.JpUsers users = new TPortalClass.JpUsers();
        users.ResetPwd(this.txtuid.Text);

        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        string pageUrl = JpCommon.CombUrlTxt("list_user.aspx", "page={0}&rnd={1}&keywords={2}&deptid={3}",
            "" + this.txtPage.Text + "", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.ddldept.SelectedValue + "");

        //写系统日志
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        JpCommon.WriteLog(userip, "初始化密码", "初始化密码[用户ID:" + this.txtuid.Text + "]", Session["uid"].ToString(), Session["uname"].ToString());

        Response.Write("<script>alert('初始化密码成功!');window.location='" + pageUrl + "';</script>");
    }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //if (!this.IsPostBack)
     //{
     if (Session["uid"].ToString() == "")
     {
         this.Response.Redirect("login.aspx?url=" + this.Request.RawUrl.ToString());
     }
     else
     {
         TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers(Session["uid"].ToString());
         lbluserinfo.Text = JpUsers.uname;
         if (JpUsers.deptid != "")
         {
             TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
             DataTable dt = JpDepts.GetDept(JpUsers.deptid);
             if (dt.Rows.Count > 0)
             {
                 lbluserinfo.Text += "(" + dt.Rows[0]["deptname"].ToString() + ")";
             }
         }
         TPortalClass.JpSite JpSite = new TPortalClass.JpSite();
         webname.Text = JpSite.SiteName;
         weburl.Text = JpSite.host;
         webcompany.Text = "宁波移信";
         dbname.Text = JpSite.dbname;
         versions.Text = JpSite.version;
         //读取登录信息
         TPortalClass.JpLog JpLog = new TPortalClass.JpLog();
         DataTable dt_log = JpLog.Getlogs();
         if (dt_log.Rows.Count > 0)
         {
             litIP.Text = dt_log.Rows[0]["hy_oppip"].ToString();
         }
         if (dt_log.Rows.Count > 1)
         {
             litBackIP.Text = dt_log.Rows[1]["hy_oppip"].ToString();
             litBackTime.Text = dt_log.Rows[1]["hy_createtime"].ToString();
         }
     }
     //}
 }
Пример #8
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (Session["checkcode"].ToString().Equals(this.txt_checkcode.Value))
        {
            String password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txt_password.Value, "MD5");
            TPortalClass.JpUsers Users = new TPortalClass.JpUsers();
            if (Users.Login(this.txt_username.Value, password))
            {
                TPortalClass.JpUsers userinfo = new TPortalClass.JpUsers(this.txt_username.Value);
                Session["uid"] = userinfo.uid;
                Session["uname"] = userinfo.uname;
                TPortalClass.JpRoles roles = new TPortalClass.JpRoles();
                Session["role"] = roles.GetRolesListByUID(userinfo.uid);
                String aa = Session["role"].ToString();

                //写系统日志
                TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
                string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (userip == null || userip == "")
                {
                    userip = Request.ServerVariables["REMOTE_ADDR"];
                }
                JpCommon.WriteLog(userip, "登录", "后台登录", Session["uid"].ToString(), Session["uname"].ToString());
                this.Response.Redirect(this.lblurl.Text);
            }
            else
            {
                Response.Write("<script>alert('输入的用户名或者密码不正确!');window.location.href = window.location.href;</script>");
                return;
            }
        }
        else
        {
            Response.Write("<script>alert('校验码不正确!');window.location.href = window.location.href;</script>");
            return;
        }
    }
Пример #9
0
 private void DataPlay()
 {
     if (this.Request.QueryString["op"] != null)
     {
         this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
     }
     if (this.Request.QueryString["id"] != null)
     {
         this.txtuid.Text = this.Request.QueryString["id"].ToString();     //部门ID
     }
     TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers();
     //新文档
     if (this.txtop.Value == "add")
     {
         if (this.Request.QueryString["deptid"] != null)
         {
             this.ddldept.SelectedValue = this.Request.QueryString["deptid"].ToString();     //上级部门ID
         }
     }
     //旧文档
     if (this.txtop.Value == "modify")
     {
         DataTable dt = JpUsers.GetJpUser(this.txtuid.Text);
         this.txtuid.Enabled = false;
         if (dt.Rows.Count > 0)
         {
             this.txtuname.Text = dt.Rows[0]["uname"].ToString();
             this.ddldept.SelectedValue = dt.Rows[0]["deptid"].ToString();
             this.txtusort.Text = dt.Rows[0]["usort"].ToString();
         }
     }
 }
Пример #10
0
    //得到下一级部门的信息
    private void GetNextDept(string pis_DeptId, string ls_users)
    {
        //得到二级部门
        TPortalClass.JpDepts Hyoa_dept = new TPortalClass.JpDepts();
        DataTable dtdept = Hyoa_dept.GetSubDeptsOrderbysort(pis_DeptId);
        if (dtdept.Rows.Count > 0)
        {
            for (int i = 0; i < dtdept.Rows.Count; i++)
            {
                //输出二级部门头部
                Response.Write("<dd class=\"folderClose\">");
                Response.Write("<input type=\"checkbox\" name=\"Dept" + dtdept.Rows[i]["deptid"].ToString() + "\" value=\"" + dtdept.Rows[i]["deptid"].ToString() + "\">");
                Response.Write(dtdept.Rows[i]["deptname"].ToString());
                Response.Write("<dl>");

                //有下一级部门
                if (Hyoa_dept.isHaveSubDept(dtdept.Rows[i]["deptid"].ToString()) == true)
                {
                    GetNextDept(dtdept.Rows[i]["deptid"].ToString(), ls_users);
                }

                //输出二级部门的人员
                TPortalClass.JpUsers Hyoa_user = new TPortalClass.JpUsers();
                DataTable dtuser = Hyoa_user.GetUsers(dtdept.Rows[i]["deptid"].ToString());
                if (dtuser.Rows.Count > 0)
                {
                    for (int j = 0; j < dtuser.Rows.Count; j++)
                    {
                        //判断已选中
                        if (ls_users.Contains("," + dtuser.Rows[j]["uid"].ToString() + ","))
                        {
                            Response.Write("<dt>");
                            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("<dt>");
                            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>");
            }
        }
    }
Пример #11
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>");
        }
    }
Пример #12
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
        }
    }
Пример #13
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.ddldept.SelectedValue = this.deptid;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers();
        DataTable dt = JpUsers.GetUsersOrderbyDeptsort_Usersort(ddldept.SelectedValue, 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();
        string pageUrl = JpCommon.CombUrlTxt("list_user.aspx", "page={0}&rnd={1}&keywords={2}&deptid={3}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtKeywords.Text + "", "" + this.ddldept.SelectedValue + "");
        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }