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

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

            string ls_type = "";
            if (this.Request.QueryString["type"] != null)
                ls_type = this.Request.QueryString["type"].ToString();

            //默认选中当前所在部门  这个功能先取消
            //if (this.Request.QueryString["deptid"] != null)
            //{
            //    ls_string = this.Request.QueryString["deptid"].ToString();
            //}
            Response.Write("<HTML><Head><Title></Title>");
            Response.Write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">");
            Response.Write("<link href=\"/hyhtml/ltree/resources/css/css.css\" rel=\"stylesheet\" type=\"text/css\" />");
            Response.Write("<link href=\"/hyhtml/ltree/resources/css/lTREE.default.css\" rel=\"stylesheet\" type=\"text/css\" />");
            Response.Write("<script language=\"JavaScript\" src=\"/hyhtml/ltree/js/lTREE.js\"></script>");
            Response.Write("<SCRIPT language=JavaScript src=\"/hyhtml/tree/xtree.js\"></SCRIPT>");
            Response.Write("<SCRIPT language=JavaScript src=\"/hyhtml/tree/OrgSwitchForTree.js\"></SCRIPT>");
            Response.Write("<SCRIPT language=JavaScript src=\"/hyhtml/tree/DeptSelection.js\"></SCRIPT>");
            Response.Write("</Head>");
            Response.Write("<Body topmargin=10 leftmargin=10  vlink=#FFFFFF >");
            Response.Write("<style type=\"text/css\">");
            Response.Write("#lTREEMenu {width:380px;border:0px solid #ccc;margin:3px;padding:3px;}");
            Response.Write("BODY{ PADDING-RIGHT:0px;  PADDING-LEFT:0px;  PADDING-BOTTOM:0px;  PADDING-TOP:0px;}");
            Response.Write("</style>");

            Response.Write("<Form>");

            Response.Write("<TABLE width=\"98%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"BORDER-left: #D4D4D4 1px solid;BORDER-right: #D4D4D4 1px solid;BORDER-top: #D4D4D4 1px solid\">");
            Response.Write("<TR class=\"treeshow\">");
            Response.Write("<td align=\"left\" valign=\"top\" class=\"lTREEMenu lTREENormal\" id=\"lTREEMenu\">");

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

            //得到第一级部门
            HyoaClass.Hyoa_gwk_class Hyoa_gwk_class = new HyoaClass.Hyoa_gwk_class();
            DataTable dt = Hyoa_gwk_class.GetFirstlevClasss_type(ls_type);
            if (dt.Rows.Count > 0)
            {
                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    //判断有子部门
                    if (Hyoa_gwk_class.isHaveSubClass_type(dt.Rows[i]["id"].ToString(), ls_type) == true)
                    {
                        //存在子部门
                        Response.Write("<dd class=\"folderClose\">");
                        //if (ls_string != "")
                        //{
                        //    if (ls_string == dt.Rows[i]["id"].ToString())
                        //    {
                        //        Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["id"].ToString() + "\" value=\"" + dt.Rows[i]["id"].ToString() + "\" text=\"" + dt.Rows[i]["hy_name"].ToString() + "\" checked=\"checked\" align=\"left\" onclick=\"SelDept(this.name)\" style=\"width:13;\"> ");
                        //        Response.Write(dt.Rows[i]["hy_name"].ToString());
                        //    }
                        //    else
                        //    {
                        //        Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["id"].ToString() + "\" value=\"" + dt.Rows[i]["id"].ToString() + "\" text=\"" + dt.Rows[i]["hy_name"].ToString() + "\" align=\"left\" onclick=\"SelDept(this.name)\" style=\"width:13;\"> ");
                        //        Response.Write(dt.Rows[i]["hy_name"].ToString());
                        //    }
                        //}
                        //else
                        //{
                            Response.Write("<input type=\"checkbox\" name=\"Dept" + dt.Rows[i]["id"].ToString() + "\" value=\"" + dt.Rows[i]["id"].ToString() + "\" text=\"" + dt.Rows[i]["hy_name"].ToString() + "\" align=\"left\" onclick=\"SelDept(this.name)\" style=\"width:13;\"> ");
                            Response.Write(dt.Rows[i]["hy_name"].ToString());
                        //}
                        Response.Write("<dl>");

                        //显示子部门
                        GetNextDept(dt.Rows[i]["id"].ToString(), "Dept" + dt.Rows[i]["id"].ToString(), ls_string,ls_type);

                        Response.Write("</dl>");
                        Response.Write("</dd>");
                    }
                    else
                    {
                        //不存在子部门
                        Response.Write("<dt>");
                        //if (ls_string != "")
                        //{
                        //    if (ls_string == dt.Rows[i]["id"].ToString())
                        //    {
                        //        Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["id"].ToString() + "\" value=\"");
                        //        Response.Write(dt.Rows[i]["id"].ToString() + "\" text=\"" + dt.Rows[i]["hy_name"].ToString() + "\" checked=\"checked\" align=\"left\" style=\"width:13;\"> ");
                        //    }
                        //    else
                        //    {
                        //        Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["id"].ToString() + "\" value=\"");
                        //        Response.Write(dt.Rows[i]["id"].ToString() + "\" text=\"" + dt.Rows[i]["hy_name"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                        //    }
                        //}
                        //else
                        //{
                            Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["id"].ToString() + "\" value=\"");
                            Response.Write(dt.Rows[i]["id"].ToString() + "\" text=\"" + dt.Rows[i]["hy_name"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                        //}
                        Response.Write(dt.Rows[i]["hy_name"].ToString());
                        Response.Write("</dt>");
                    }
                }
            }

            Response.Write("</dl>");
            Response.Write("</dd>");
            Response.Write("</dl>");
            Response.Write("</td>");
            Response.Write("</TR>");
            Response.Write("</TABLE>");
            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("        lTree.build(\"lTREEMenu\");");
            Response.Write("      </script>");
            Response.Write("</Form>");
            Response.Write("</Body></HTML>");
        }
    }
Example #2
0
    private void DataPlay(int PageNo)
    {
        //得到当前模块对应的role
        HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
        string ls_role = "Rolegwk";
        if (dt_mudel.Rows.Count > 0)
            ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString();

        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString()))
        {
            this.isrole.Value = "1";
            this.tdnewdoc.Visible = true;
            this.tddeldoc.Visible = true;
        }
        else
        {
            this.isrole.Value = "0";
            this.tdnewdoc.Visible = false;
            this.tddeldoc.Visible = false;
        }

        //如果id等于空,则返回按钮隐藏
        if (this.txtid.Value== "")
        {
            this.btnreturnback.Visible = false;
        }

        //得到当前页号
        this.curpage.Text = PageNo.ToString();
        HyoaClass.Hyoa_gwk_class Hyoa_gwk_class = new HyoaClass.Hyoa_gwk_class();

        DataTable dt;
        if (this.txtid.Value == "")
        {
            dt = Hyoa_gwk_class.GetFirstlevClasss_type(this.txttype.Value);
        }
        else
        {
            dt = Hyoa_gwk_class.GetSubClasss_type(this.txtid.Value,this.txttype.Value);
        }

        DataTable tempTable = dt.Clone();
        for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); 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);
        }

        int TotalRecord = dt.Rows.Count;
        this.sumts.Text = TotalRecord.ToString();
        this.sumts2.Text = TotalRecord.ToString();
        this.ShowTotalRecord.Text = TotalRecord.ToString();
        //计算及显示总页数
        int TotalPage;
        if (TotalRecord < System.Int32.Parse(PageSize.Text))
        {
            TotalPage = 1;
        }
        else
        {
            if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0)
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1;

            }
            else
            {
                TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text);

            }
        }
        this.ShowTotalPage.Text = TotalPage.ToString();
        this.rptlist.DataSource = tempTable;
        this.rptlist.DataBind();
        dt.Clear();
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        if (!this.IsPostBack)
        {
            string ls_string="";
            string ls_temp = "";
            string ls_type = "";
            if (this.Request.QueryString["type"] != null)
                ls_type = this.Request.QueryString["type"].ToString();

            //默认选中当前所在部门  这个功能先取消
            //if (this.Request.QueryString["deptid"] != null)
            //{
            //    ls_string = this.Request.QueryString["deptid"].ToString();
            //}
            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("<link href=\"/hyhtml/ltree/resources/css/lTREE.default.css\" rel=\"stylesheet\" type=\"text/css\" />");
            Response.Write("<script language=\"JavaScript\" src=\"/hyhtml/ltree/js/lTREE.js\"></script>");
            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("</Head>");
            Response.Write("<body style=\"padding:2px;\">");

            //<!--lTREEMenu Start:-->
            Response.Write("<div class=\"lTREEMenu lTREENormal\" id=\"lTREEMenuDEMO\">");

            Response.Write("<dl>");
            Response.Write("<dd> <b>公文列表</b>");
            Response.Write("<dl>");

            //得到第一级部门
            HyoaClass.Hyoa_gwk_class Hyoa_gwk_class = new HyoaClass.Hyoa_gwk_class();
            DataTable dt = Hyoa_gwk_class.GetFirstlevClasss_type(ls_type);
            if (dt.Rows.Count > 0)
            {
                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    //判断有子部门
                    if (Hyoa_gwk_class.isHaveSubClass_type(dt.Rows[i]["id"].ToString(), ls_type) == true)
                    {
                        //存在子部门
                        Response.Write("<dd class=\"folderClose\">");

                            //Response.Write("<input type=\"checkbox\" name=\"Dept" + dt.Rows[i]["id"].ToString() + "\" value=\"" + dt.Rows[i]["id"].ToString() + "\" text=\"" + dt.Rows[i]["hy_name"].ToString() + "\" align=\"left\" onclick=\"SelDept(this.name)\" style=\"width:13;\"> ");
                        Response.Write("<a href='list.aspx?type=" + dt.Rows[i]["id"].ToString() + "' target='RightIframeWin' >");
                        Response.Write(dt.Rows[i]["hy_name"].ToString());
                        Response.Write("</a>");

                        Response.Write("<dl>");

                        //显示子部门
                        GetNextDept(dt.Rows[i]["id"].ToString(), "Dept" + dt.Rows[i]["id"].ToString(), ls_string,ls_type);

                        Response.Write("</dl>");
                        Response.Write("</dd>");
                    }
                    else
                    {
                        //不存在子部门
                        Response.Write("<dt>");

                            //Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["id"].ToString() + "\" value=\"");
                            //Response.Write(dt.Rows[i]["id"].ToString() + "\" text=\"" + dt.Rows[i]["hy_name"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                        Response.Write("<a href='list.aspx?type=" + dt.Rows[i]["id"].ToString() + "' target='RightIframeWin' >");
                        Response.Write(dt.Rows[i]["hy_name"].ToString());
                        Response.Write("</a>");

                        Response.Write("</dt>");
                    }
                }
            }

            Response.Write("</dl>");
            Response.Write("</dd>");
            Response.Write("</dl>");
            Response.Write("</div>");
            //<!--lTREEMenuDEMO End-->

            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("        lTree.build(\"lTREEMenuDEMO\");");
            Response.Write("      </script>");
            Response.Write("</Body></HTML>");
        }
    }