protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() =="")
            this.Response.Redirect("../login.aspx?url="+this.Request.RawUrl);

        if (!IsPostBack)
        {
            //更新当前用户的在线时间
            HyoaClass.Hyoa_jstx_zxry Hyoa_jstx_zxry = new HyoaClass.Hyoa_jstx_zxry();
            DataTable dt = Hyoa_jstx_zxry.GetDocByUserid(this.Session["hyuid"].ToString());
            if (dt.Rows.Count > 0)
            {
                Hyoa_jstx_zxry.ID = dt.Rows[0]["ID"].ToString();
                Hyoa_jstx_zxry.hy_userid = dt.Rows[0]["hy_userid"].ToString();
                Hyoa_jstx_zxry.hy_username = dt.Rows[0]["hy_username"].ToString();
                Hyoa_jstx_zxry.hy_datetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                Hyoa_jstx_zxry.Update();
            }
            else
            {
                Hyoa_jstx_zxry.ID = System.Guid.NewGuid().ToString();
                Hyoa_jstx_zxry.hy_userid = this.Session["hyuid"].ToString();
                Hyoa_jstx_zxry.hy_username = this.Session["hyuname"].ToString();
                Hyoa_jstx_zxry.hy_datetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                Hyoa_jstx_zxry.Insert();
            }
            //删除已经过期的在线用户数据(时间距离当前时间已有15分钟)
            Hyoa_jstx_zxry.Delete_offline(15);
        }
    }
 public string Hy_ifonline(string ls_userid)
 {
     string ls_retrun = "0";
     HyoaClass.Hyoa_jstx_zxry Hyoa_jstx_zxry = new HyoaClass.Hyoa_jstx_zxry();
     DataTable dtonlineuser = Hyoa_jstx_zxry.GetDocByUserid(ls_userid);
     if (dtonlineuser.Rows.Count > 0)
     {
         ls_retrun = "1";
     }
     else {
         ls_retrun = "0";
     }
     return ls_retrun;
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        //得到待办事宜数
        HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy();
        DataTable dt = Hyoa_dbsy.Getdbsys_dbanddy(Session["hyuid"].ToString());
        this.Response.Write(dt.Rows.Count.ToString());

        this.Response.Write("|");

        //得到未读站内消息
        HyoaClass.Hyoa_jstx_info Hyoa_jstx_info = new HyoaClass.Hyoa_jstx_info();
        DataTable dt2 = Hyoa_jstx_info.GetDocByReceiveuserid_wd(Session["hyuid"].ToString());
        this.Response.Write(dt2.Rows.Count.ToString());

        this.Response.Write("|");

        //在线用户(得到人数前先更新一下数据)
        //更新当前用户的在线时间
        HyoaClass.Hyoa_jstx_zxry Hyoa_jstx_zxry = new HyoaClass.Hyoa_jstx_zxry();
        DataTable dt3 = Hyoa_jstx_zxry.GetDocByUserid(this.Session["hyuid"].ToString());
        if (dt3.Rows.Count > 0)
        {
            Hyoa_jstx_zxry.ID = dt3.Rows[0]["ID"].ToString();
            Hyoa_jstx_zxry.hy_userid = dt3.Rows[0]["hy_userid"].ToString();
            Hyoa_jstx_zxry.hy_username = dt3.Rows[0]["hy_username"].ToString();
            Hyoa_jstx_zxry.hy_datetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            Hyoa_jstx_zxry.Update();
        }
        else
        {
            Hyoa_jstx_zxry.ID = System.Guid.NewGuid().ToString();
            Hyoa_jstx_zxry.hy_userid = this.Session["hyuid"].ToString();
            Hyoa_jstx_zxry.hy_username = this.Session["hyuname"].ToString();
            Hyoa_jstx_zxry.hy_datetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            Hyoa_jstx_zxry.Insert();
        }
        //删除已经过期的在线用户数据(时间距离当前时间已有15分钟)
        Hyoa_jstx_zxry.Delete_offline(15);
        DataTable dt_zxry = Hyoa_jstx_zxry.GetDocs();
        this.Response.Write(dt_zxry.Rows.Count.ToString());

        //return ;
    }
 //在线用户(得到人数前先更新一下数据)
 protected string getzxyhs()
 {
     HyoaClass.Hyoa_jstx_zxry Hyoa_jstx_zxry = new HyoaClass.Hyoa_jstx_zxry();
     if (this.Session["hyuid"].ToString() != "")
     {
         //更新当前用户的在线时间
         DataTable dt = Hyoa_jstx_zxry.GetDocByUserid(this.Session["hyuid"].ToString());
         if (dt.Rows.Count > 0)
         {
             Hyoa_jstx_zxry.ID = dt.Rows[0]["ID"].ToString();
             Hyoa_jstx_zxry.hy_userid = dt.Rows[0]["hy_userid"].ToString();
             Hyoa_jstx_zxry.hy_username = dt.Rows[0]["hy_username"].ToString();
             Hyoa_jstx_zxry.hy_datetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             Hyoa_jstx_zxry.Update();
         }
         else
         {
             Hyoa_jstx_zxry.ID = System.Guid.NewGuid().ToString();
             Hyoa_jstx_zxry.hy_userid = this.Session["hyuid"].ToString();
             Hyoa_jstx_zxry.hy_username = this.Session["hyuname"].ToString();
             Hyoa_jstx_zxry.hy_datetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             Hyoa_jstx_zxry.Insert();
         }
     }
     //删除已经过期的在线用户数据(时间距离当前时间已有15分钟)
     Hyoa_jstx_zxry.Delete_offline(15);
     DataTable dt_zxry = Hyoa_jstx_zxry.GetDocs();
     return dt_zxry.Rows.Count.ToString();
 }
    //弹出的对话窗口
    //public string ls_urllinkstart = "<a href='#' onclick='window.open(\"/system/main_mail.aspx?op=add&mid=mail&tableid=&listid=&recuserid=replaceuserid\")'>";
    //public string ls_urllinkend = "</a>";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        if (!this.IsPostBack)
        {
            string ls_id="";
            string ls_users="";

            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("<meta http-equiv='refresh' content='120;url=Hy_Tree_onlineuser.aspx'>");
            Response.Write("<link type=\"text/css\" rel=\"stylesheet\" href=\"/hyhtml/ltree_zxyh/resources/css/lTREE.checkbox.css\" />");
            Response.Write("<script type=\"text/javascript\" src=\"/hyhtml/ltree_zxyh/js/DeptSelection.js\"></script>");
            Response.Write("<style type=\"text/css\">");
            Response.Write("#lTREEMenuDEMO {width:230px;height:365px;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("BODY{ PADDING-RIGHT:0px;  PADDING-LEFT:0px;  PADDING-BOTTOM:0px;  PADDING-TOP:0px;}");
            Response.Write(".btn7 {BORDER-RIGHT: 0px; BORDER-TOP: 0px; FONT-SIZE: 9pt; BACKGROUND-IMAGE: url(../hyhtml/images/an_bj7.gif); BORDER-LEFT: 0px; WIDTH: 66px; COLOR: #000000; PADDING-TOP: 2px; BORDER-BOTTOM: 0px; FONT-FAMILY: 宋体; HEIGHT: 21px}");
            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>");
            //Response.Write("<form>");
            Response.Write("<div>");
            Response.Write("&nbsp;<input type=\"button\" value=\"&nbsp;&nbsp;发起对话\" class=\"btn7\" onclick=\"fqdh();\" >");
            Response.Write("</div>");

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

            Response.Write("<dl>");
            Response.Write("<dd><input type=\"checkbox\" value=\"\" /><b>在线用户</b>");
            Response.Write("<dl>");

            HyoaClass.Hyoa_jstx_zxry Hyoa_jstx_zxry = new HyoaClass.Hyoa_jstx_zxry();
            DataTable dt = Hyoa_jstx_zxry.GetDocs();
            if (dt.Rows.Count > 0)
            {
                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    Response.Write("<dt class='online'>");
                    Response.Write("<input type=\"checkbox\" name=\"User" + dt.Rows[i]["hy_userid"].ToString() + "_subuser\" value=\"");
                    Response.Write(dt.Rows[i]["hy_userid"].ToString() + "\" text=\"" + dt.Rows[i]["hy_username"].ToString() + "\">");
                    Response.Write(dt.Rows[i]["hy_username"].ToString());
                    Response.Write("</dt>");
                }
            }

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

            Response.Write("<script type=\"text/javascript\" src=\"/hyhtml/ltree_zxyh/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>");

        }
    }