Exemplo n.º 1
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        //写系统日志start
        HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
        Hyoa_log.ID = System.Guid.NewGuid().ToString();
        Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
        string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
        if (userip == null || userip == "")
        {
            userip = Request.ServerVariables["REMOTE_ADDR"];
        }
        Hyoa_log.hy_oppip = userip;
        Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
        Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();

        //新文档时
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        if (this.txtop.Value == "add")
        {
            Hyoa_dept.hy_deptid = this.hy_deptid.Text;
            Hyoa_dept.hy_deptname = this.hy_deptname.Text;
            Hyoa_dept.hy_deptsort = System.Int32.Parse(this.hy_deptsort.Text.ToString());
            Hyoa_dept.hy_isenabled = this.hy_isenabled.SelectedValue.ToString();
            Hyoa_dept.hy_createtime = System.DateTime.Now.ToString();
            Hyoa_dept.Insert();
            Hyoa_log.hy_opptype = "新增";
            Hyoa_log.hy_oppcontent = "新增部门:" + this.hy_deptname.Text;
        }
        else
        {
            Hyoa_dept.hy_deptid = this.txtdocid.Value;
            Hyoa_dept.hy_deptname = this.hy_deptname.Text;
            Hyoa_dept.hy_deptsort = System.Int32.Parse(this.hy_deptsort.Text.ToString());
            Hyoa_dept.hy_isenabled = this.hy_isenabled.SelectedValue.ToString();
            Hyoa_dept.Update();
            Hyoa_log.hy_opptype = "修改";
            Hyoa_log.hy_oppcontent = "修改部门:" + this.hy_deptname.Text;
        }

        Hyoa_log.Insert();

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
Exemplo n.º 2
0
    protected void btndelinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        String[] v_uids = this.txtuids.Value.Split(',');
        for(var i=0;i<v_uids.Length;i++)
        {
            if (v_uids[i] != "")
            {
                //this.Response.Write("<script>alert('aaa')</script>");
                //判断是否有人员
                DataTable dt_dept = Hyoa_dept.Getdept(v_uids[i]);
                DataTable dt_user = Hyoa_user.Getusersbydeptid(v_uids[i]);
                if (dt_user.Rows.Count > 0)
                {
                    Response.Write("<script>alert('" + dt_dept.Rows[0]["hy_deptname"].ToString() + "下存在人员,不能进行删除!');</script>");
                    return;
                }
                //判断是否有子部门
                DataTable dt_subdept = Hyoa_dept.GetSubDepts(v_uids[i]);
                if (dt_subdept.Rows.Count > 0)
                {
                    Response.Write("<script>alert('" + dt_dept.Rows[0]["hy_deptname"].ToString() + "下存在子部门,不能进行删除!');</script>");
                    return;
                }

                //写删除部门系统日志start
                HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
                Hyoa_log.ID = System.Guid.NewGuid().ToString();
                Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
                string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (userip == null || userip == "")
                {
                    userip = Request.ServerVariables["REMOTE_ADDR"];
                }
                Hyoa_log.hy_oppip = userip;
                Hyoa_log.hy_opptype = "删除";
                Hyoa_log.hy_oppcontent = "删除部门:" + dt_dept.Rows[0]["hy_deptname"].ToString();
                Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
                Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
                Hyoa_log.Insert();

                Hyoa_dept.hy_deptid = v_uids[i];
                Hyoa_dept.Delete();
            }
        }
        this.txtuids.Value = "";
        //DataPlay(1);
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
Exemplo n.º 3
0
 protected void btndelinfo_Click(object sender, EventArgs e)
 {
     HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
         String[] v_uids = this.txtuids.Value.Split(',');
         for(var i=0;i<v_uids.Length;i++)
         {
             if (v_uids[i] != "")
             {
                 //this.Response.Write("<script>alert('aaa')</script>");
                 Hyoa_dept.hy_deptid = v_uids[i];
                 Hyoa_dept.Delete();
             }
         }
         this.txtuids.Value = "";
         //DataPlay(1);
         DataPlay(System.Int32.Parse(this.curpage.Text));
 }
Exemplo n.º 4
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("/login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        if (this.txtop.Value == "add")
        {
            Hyoa_dept.hy_deptid = this.hy_deptid.Text ;
            Hyoa_dept.hy_deptname = this.hy_deptname.Text ;
            Hyoa_dept.hy_deptsort = System.Int32.Parse (this.hy_deptsort.Text.ToString ());
            Hyoa_dept.hy_isenabled = this.hy_isenabled.SelectedValue.ToString();
            Hyoa_dept.hy_createtime = System.DateTime.Now.ToString();
            Hyoa_dept.Insert();

        }
        else
        {
            Hyoa_dept.hy_deptid = this.txtdocid.Value;
            Hyoa_dept.hy_deptname = this.hy_deptname.Text;
            Hyoa_dept.hy_deptsort = System.Int32.Parse(this.hy_deptsort.Text.ToString());
            Hyoa_dept.hy_isenabled = this.hy_isenabled.SelectedValue.ToString();
            Hyoa_dept.Update();

        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
Exemplo n.º 5
0
 //根据部门id得到所有的部门名称(包括上级的部门名称)
 public string GetAllDeptNameByDeptId(string pi_deptid)
 {
     string ls_deptname="";
     HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
     if (pi_deptid.Length > 3)
     {
         int m = pi_deptid.Length / 3;
         string ls_deptid="";
         for (int i = 0; i < m; i++)
         {
             ls_deptid = pi_deptid.Substring(0, 3 + (i * 3));
             DataTable dt = Hyoa_dept.Getdept(ls_deptid);
             if (dt.Rows.Count > 0)
             {
                 if (ls_deptname == "")
                     ls_deptname = dt.Rows[0]["hy_deptname"].ToString();
                 else
                     ls_deptname += "[" + dt.Rows[0]["hy_deptname"].ToString()+"]";
             }
         }
     }
     return ls_deptname;
 }
Exemplo n.º 6
0
    //递归函数
    public string GetNextDept(string ls_deptid)
    {
        string ls_retrun = "";
        //根据部门ID得到下一级的部门
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        DataTable dt = Hyoa_dept.GetSubDeptsOrderbysort(ls_deptid);

        if (dt.Rows.Count > 0)
        {
            for (var i = 0; i < dt.Rows.Count; i++)
            {
                //判断是否有子部门
                DataTable dtsub = Hyoa_dept.GetSubDeptsOrderbysort(dt.Rows[i]["hy_deptid"].ToString());
                if (dtsub.Rows.Count > 0)
                {
                    ls_retrun += "<dd class=\"folderClose\">";
                    ls_retrun += "<a href=\"/system/list_user.aspx?deptid=" + dt.Rows[i]["hy_deptid"].ToString() + "\" target=\"RightIframeWin\">" + dt.Rows[i]["hy_deptname"].ToString();
                    ls_retrun += "</a><dl>";

                    //输出子部门
                    ls_retrun += GetNextDept(dt.Rows[i]["hy_deptid"].ToString());

                    ls_retrun += "</dl>";
                    ls_retrun += "</dd>";
                }
                else
                {
                    //没有子部门
                    ls_retrun += "<dt>";
                    ls_retrun += "<a href=\"/system/list_user.aspx?deptid=" + dt.Rows[i]["hy_deptid"].ToString() + "\" target=\"RightIframeWin\">" + dt.Rows[i]["hy_deptname"].ToString();
                    ls_retrun += "</a></dt>";
                }
            }
        }

        return ls_retrun;
    }
Exemplo n.º 7
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改

            //判断当前用户是否有保存的权限
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
            {
                this.btn_submit.Visible = true; //保存
            }
            else
            {
                this.btn_submit.Visible = false; //保存
            }

            //新文档
            if (this.Request.QueryString["op"] == "add")
            {
                if (this.hy_deptid.Text != "")
                {
                    //根据部门ID得到部门名称
                    HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
                    DataTable dtdept = Hyoa_dept.Getdept(this.hy_deptid.Text);
                    if (dtdept.Rows.Count > 0)
                        this.hy_deptname.Text = dtdept.Rows[0]["hy_deptname"].ToString();

                    this.ddlifleader.Items.Insert(0, "否");
                    this.ddlifleader.Items.Insert(1, "是");

                    this.ddlisenabled.Items.Insert(0, "是");
                    this.ddlisenabled.Items.Insert(1, "否");

                    this.ddlxb.Items.Insert(0, "--请选择--");
                    this.ddlxb.Items.Insert(1, "男");
                    this.ddlxb.Items.Insert(2, "女");

                    dtdept.Clear();
                }
            }
            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                if (this.Request.QueryString["userid"] != null)
                {
                    this.ddlifleader.Items.Insert(0, "否");
                    this.ddlifleader.Items.Insert(1, "是");

                    this.ddlisenabled.Items.Insert(0, "是");
                    this.ddlisenabled.Items.Insert(1, "否");

                    this.ddlxb.Items.Insert(0, "--请选择--");
                    this.ddlxb.Items.Insert(1, "男");
                    this.ddlxb.Items.Insert(2, "女");

                    //根据用户ID得到信息
                    this.txtuserid.Text = this.Request.QueryString["userid"].ToString();
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    HyoaClass.Hyoa_user_detail Hyoa_user_detail = new HyoaClass.Hyoa_user_detail();
                    DataTable dtuser = Hyoa_user.Getuserallinfo(this.txtuserid.Text);
                    if (dtuser.Rows.Count > 0)
                    {
                        this.txtusername.Value = dtuser.Rows[0]["hy_username"].ToString();
                        this.hy_deptid.Text = dtuser.Rows[0]["hy_deptid"].ToString();
                        this.hy_deptname.Text = dtuser.Rows[0]["hy_deptname"].ToString();
                        this.txtposition.Value = dtuser.Rows[0]["hy_post"].ToString();

                        if (dtuser.Rows[0]["hy_ifleader"].ToString() == "是")
                            this.ddlifleader.SelectedIndex = 1;
                        else
                            this.ddlifleader.SelectedIndex = 0;

                        this.txtofficetel.Value = dtuser.Rows[0]["hy_officetel"].ToString();
                        this.txthometel.Value = dtuser.Rows[0]["hy_hometel"].ToString();
                        this.txtmobile.Value = dtuser.Rows[0]["hy_mobile"].ToString();
                        this.txtvirtualtel.Value = dtuser.Rows[0]["hy_virtualnumber"].ToString();
                        this.txtuserno.Value = dtuser.Rows[0]["hy_sort"].ToString();

                        if (dtuser.Rows[0]["hy_isenabled"].ToString() == "是")
                            this.ddlisenabled.SelectedIndex = 0;
                        else
                            this.ddlisenabled.SelectedIndex = 1;

                        DataTable dtdetail = Hyoa_user_detail.Getuserdetail(this.txtuserid.Text);
                        if (dtdetail.Rows.Count > 0)
                        {
                            this.txtbirthday.Value = System.DateTime.Parse(dtdetail.Rows[0]["hy_birthday"].ToString()).ToString("yyyy-MM-dd");
                            this.txtfjh.Value = dtdetail.Rows[0]["hy_fjh"].ToString();
                            this.ddlxb.SelectedValue = dtdetail.Rows[0]["hy_xb"].ToString();
                            this.txtzzmm.Value = dtdetail.Rows[0]["hy_zzmm"].ToString();
                            this.txtxl.Value = dtdetail.Rows[0]["hy_xl"].ToString();
                            this.txtbyyx.Value = dtdetail.Rows[0]["hy_byyx"].ToString();

                            if (dtdetail.Rows[0]["hy_jdwsj"].ToString() != "" && dtdetail.Rows[0]["hy_jdwsj"].ToString() != null && dtdetail.Rows[0]["hy_jdwsj"].ToString() != "1900-01-01")
                                this.txtjdwsj.Value = System.DateTime.Parse(dtdetail.Rows[0]["hy_jdwsj"].ToString()).ToShortDateString();

                            this.txtjtzz.Value = dtdetail.Rows[0]["hy_jtzz"].ToString();
                            this.txtsfzhm.Value = dtdetail.Rows[0]["hy_sfzhm"].ToString();
                        }

                        if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()))
                        { }
                        else
                        {
                            this.txtsfzhm.Value = "您无权查看,如有需要请联系管理员!";
                        }

                    }
                    dtuser.Clear();
                    this.txtuserid.Enabled = false;
                }
            }
        }
    }
Exemplo n.º 8
0
    private void DataPlay()
    {
        if (this.Request.QueryString["op"] != null)
        {
            this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改

            //判断当前用户是否有保存的权限
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            if (Hyoa_global.isHaveRole("Role9990", this.Session["hyuid"].ToString()))
            {
                this.btn_submit.Visible = true; //保存
            }
            else
            {
                this.btn_submit.Visible = false; //保存
            }
            //新文档
            if (this.Request.QueryString["op"] == "add")
            {
                //对部门ID处理开始start
                HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
                DataTable dt;
                string lsdeptid;
                lsdeptid = "";
                //this.Response.Write("<script>alert('" + this.Request.QueryString["deptid"] + "')</script>");
                if (this.Request.QueryString["deptid"] == "")
                {
                    //部门ID为空,说明是第一级部门
                    dt = Hyoa_dept.GetFirstdeptsOrderByDeptid();
                    if (dt.Rows.Count > 0)
                    {
                        //判断当前部门是不是有数据的
                        lsdeptid = (System.Int32.Parse(dt.Rows[0]["hy_deptid"].ToString()) + 1).ToString();
                        if (lsdeptid.Length == 1)
                        {
                            this.hy_deptid.Text = "00" + lsdeptid;
                        }
                        else if (lsdeptid.Length == 2)
                        {
                            this.hy_deptid.Text = "0" + lsdeptid;
                        }
                        else
                        {
                            this.hy_deptid.Text = lsdeptid;
                        }
                    }
                    else
                    {
                        this.hy_deptid.Text = "001";
                    }

                }
                else
                {
                    //部门ID不为空,说明不是第一级部门
                    dt = Hyoa_dept.GetSubDeptsOrderByDeptid(this.Request.QueryString["deptid"].ToString());
                    if (dt.Rows.Count > 0)
                    {
                        //判断当前部门是不是有数据的
                        lsdeptid = (long.Parse(dt.Rows[0]["hy_deptid"].ToString()) + 1).ToString();
                        this.hy_deptid.Text = this.Request.QueryString["deptid"].ToString() + lsdeptid.Substring(lsdeptid.Length - 3, 3).ToString();
                    }
                    else
                    {
                        this.hy_deptid.Text = this.Request.QueryString["deptid"].ToString() + "001";
                    }
                }
                //对部门ID处理结束end

                this.hy_isenabled.Items.Insert(0, "是");
                this.hy_isenabled.Items.Insert(1, "否");
            }
            //旧文档
            if (this.Request.QueryString["op"] == "modify")
            {
                    this.txtdocid.Value = this.Request.QueryString["docid"].ToString();

                    HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
                    DataTable dt = Hyoa_dept.Getdept(this.txtdocid.Value);
                    if (dt.Rows.Count > 0)
                    {
                        this.hy_deptid.Text = dt.Rows[0]["hy_deptid"].ToString();
                        this.hy_deptname.Text  = dt.Rows[0]["hy_deptname"].ToString();
                        this.hy_deptsort.Text = dt.Rows[0]["hy_deptsort"].ToString();
                        //this.Response.Write("<script>alert('" + dt.Rows[0]["hy_isenabled"].ToString() + "')</script>");

                        this.hy_isenabled.Items.Insert(0, "是");
                        this.hy_isenabled.Items.Insert(1, "否");
                        if (dt.Rows[0]["hy_isenabled"].ToString() == "是")
                            this.hy_isenabled.SelectedIndex = 0;
                        else
                            this.hy_isenabled.SelectedIndex = 1;
                    }
                    dt.Clear();
            }
        }
    }
Exemplo n.º 9
0
    //得到下一级部门的信息
    private void GetNextDept(string pis_DeptId, string ls_users)
    {
        //得到二级部门
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        DataTable dtdept = Hyoa_dept.GetSubDeptsOrderbysort(pis_DeptId);
        if (dtdept.Rows.Count > 0)
        {
            for (var i = 0; i < dtdept.Rows.Count; i++)
            {
                //输出二级部门头部
                Response.Write("<dd class=\"folderClose\">");
                Response.Write("<input type=\"checkbox\" name=\"Dept" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\">");
                Response.Write(dtdept.Rows[i]["hy_deptname"].ToString());
                Response.Write("<dl>");

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

                //输出二级部门的人员
                HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                DataTable dtuser = Hyoa_user.GetUsers(dtdept.Rows[i]["hy_deptid"].ToString());
                if (dtuser.Rows.Count > 0)
                {
                    for (var j = 0; j < dtuser.Rows.Count; j++)
                    {
                        //判断已选中
                        if (ls_users.Contains("," + dtuser.Rows[j]["hy_userid"].ToString() + ","))
                        {
                            Response.Write("<dt>");
                            Response.Write("<input type=\"checkbox\" checked=\"checked\" name=\"User" + dtuser.Rows[j]["hy_userid"].ToString() + "_subuser\" value=\"");
                            Response.Write(dtuser.Rows[j]["hy_userid"].ToString() + "|" + dtuser.Rows[j]["hy_username"].ToString() + "\" text=\"" + dtuser.Rows[j]["hy_username"].ToString() + "\">");
                            Response.Write(dtuser.Rows[j]["hy_username"].ToString());
                            Response.Write("</dt>");
                        }
                        else
                        {
                            Response.Write("<dt>");
                            Response.Write("<input type=\"checkbox\" name=\"User" + dtuser.Rows[j]["hy_userid"].ToString() + "_subuser\" value=\"");
                            Response.Write(dtuser.Rows[j]["hy_userid"].ToString() + "|" + dtuser.Rows[j]["hy_username"].ToString() + "\" text=\"" + dtuser.Rows[j]["hy_username"].ToString() + "\">");
                            Response.Write(dtuser.Rows[j]["hy_username"].ToString());
                            Response.Write("</dt>");
                        }
                    }
                }

                //输出二级部门尾部
                Response.Write("</dl>");
                Response.Write("</dd>");
            }
        }
    }
Exemplo n.º 10
0
    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="";
            HyoaClass.Hyoa_groupuser Hyoa_groupuser = new HyoaClass.Hyoa_groupuser();
            if (this.Request.QueryString["id"] != null)
            {
                ls_id = this.Request.QueryString["id"].ToString();
                //得到该权限下边已经配置的人员
                DataTable dtjudeg = Hyoa_groupuser.Getgroupusersbygroupid(ls_id);
                if (dtjudeg.Rows.Count > 0)
                {
                    for (var i = 0; i < dtjudeg.Rows.Count; i++)
                    {
                        ls_users += "," + dtjudeg.Rows[i]["hy_userid"].ToString();
                    }
                    ls_users += ",";
                }
            }
            string hy_ifshowgroup = "";
            if (this.Request.QueryString["ifshowgroup"] != null)
            {
                hy_ifshowgroup = this.Request.QueryString["ifshowgroup"].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("<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("<dd><input type=\"checkbox\" value=\"\" /><b>人员列表</b>");
            Response.Write("<dl>");

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

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

                    //输出一级部门的人员
                    HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                    DataTable dtuser = Hyoa_user.GetUsers(dt.Rows[i]["hy_deptid"].ToString());
                    if (dtuser.Rows.Count > 0)
                    {
                        for (var j = 0; j < dtuser.Rows.Count; j++)
                        {
                            Response.Write("<dt>");
                            //判断已选中
                            if (ls_users.Contains("," + dtuser.Rows[j]["hy_userid"].ToString() + ","))
                            {
                                Response.Write("<input type=\"checkbox\" checked=\"checked\" name=\"User" + dtuser.Rows[j]["hy_userid"].ToString() + "_subuser\" value=\"");
                                Response.Write(dtuser.Rows[j]["hy_userid"].ToString() + "|" + dtuser.Rows[j]["hy_username"].ToString() + "\" text=\"" + dtuser.Rows[j]["hy_username"].ToString() + "\">");
                                Response.Write(dtuser.Rows[j]["hy_username"].ToString());
                                Response.Write("</dt>");
                            }
                            else
                            {
                                Response.Write("<input type=\"checkbox\" name=\"User" + dtuser.Rows[j]["hy_userid"].ToString() + "_subuser\" value=\"");
                                Response.Write(dtuser.Rows[j]["hy_userid"].ToString() + "|" + dtuser.Rows[j]["hy_username"].ToString() + "\" text=\"" + dtuser.Rows[j]["hy_username"].ToString() + "\">");
                                Response.Write(dtuser.Rows[j]["hy_username"].ToString());
                                Response.Write("</dt>");
                            }
                        }
                    }

                    //输出一级部门尾部
                    Response.Write("</dl>");
                    Response.Write("</dd>");
                }
            }
            //输出群组
            if (hy_ifshowgroup == "1")
            {
                Hy_showgroup(ls_users);
            }
            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>");
        }
    }
Exemplo n.º 11
0
    private void DataPlay(int PageNo)
    {
        //判断当前用户是否有新建删除权限
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (Hyoa_global.isHaveRole("Role9999", 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; //删除
        }
        //如果depid等于空,则返回按钮隐藏
        if (this.Request.QueryString["deptid"] == null || this.Request.QueryString["deptid"] == "")
        {
            this.btnreturnback.Visible = false;
        }

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

        DataTable dt;
        if (this.hy_deptname.Value != "")
        {
            //先判断是不是查询的,如果是查询的话,就不用管是哪一级了。全部列出来
            Hyoa_dept.hy_deptname = this.hy_deptname.Value;
            dt = Hyoa_dept.GetdeptsBydeptname();
        }
        else
        {
            if (this.txtdeptid.Value == "")
            {
                dt = Hyoa_dept.GetFirstlevdepts();
            }
            else
            {
                dt = Hyoa_dept.GetSubDeptsOrderbysort(this.txtdeptid.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();
    }
Exemplo n.º 12
0
 //得到下一级部门的信息
 private void GetNextDept(string pis_DeptId, string pis_DeptName, string pi_num, string pis_name, string ls_users)
 {
     //循环二级部门
     HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
     DataTable dtdept = Hyoa_dept.GetSubDepts(pis_DeptId);
     if (dtdept.Rows.Count > 0)
     {
         for (var i = 0; i < dtdept.Rows.Count; i++)
         {
             //判断是否有三级部门
             if (Hyoa_dept.isHaveSubDept(dtdept.Rows[i]["hy_deptid"].ToString()) == true)
             {
                 //存在三级部门
                 Response.Write("<dd class=\"folderClose\">");
                 Response.Write("<input type=\"checkbox\" name=\"Dept" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" align=\"left\" onclick=\"SelDept(this.name)\" style=\"width:13;\"> ");
                 Response.Write(dtdept.Rows[i]["hy_deptname"].ToString());
                 Response.Write("<dl>");
                 //显示三级部门以及部门人员
                 GetNextDept(dtdept.Rows[i]["hy_deptid"].ToString(), dtdept.Rows[i]["hy_deptname"].ToString(), i.ToString() + i.ToString() + i.ToString(), pis_name + "_sub" + i.ToString(), ls_users);
                 Response.Write("</dl>");
                 Response.Write("</dd>");
             }
             else
             {
                 //不存在子部门
                 Response.Write("<dd class=\"folderClose\">");
                 Response.Write("<input type=\"checkbox\" name=\""+pis_name+"_sub"+i.ToString()+"\" value=\"" + dtdept.Rows[i]["hy_deptid"].ToString()+"\" align=\"left\" onclick=\"SelDept(this.name)\" style=\"width:13;\"> ");
                 Response.Write(dtdept.Rows[i]["hy_deptname"].ToString());
                 Response.Write("<dl>");
                 //输出当前部门下的人员
                 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                 DataTable dtuser = Hyoa_user.GetUsers(dtdept.Rows[i]["hy_deptid"].ToString());
                 if (dtuser.Rows.Count > 0)
                 {
                     for (var j = 0; j < dtuser.Rows.Count; j++)
                     {
                         //判断已选中
                         if (ls_users.Contains("," + dtuser.Rows[j]["hy_userid"].ToString() + ","))
                         {
                             Response.Write("<dt>");
                             Response.Write("<input type=\"checkbox\" checked=\"checked\" name=\"" + pis_name + "_subuser" + j.ToString() + "\" value=\"");
                             Response.Write(dtuser.Rows[j]["hy_userid"].ToString() + "\" text=\"" + dtuser.Rows[j]["hy_username"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                             Response.Write(dtuser.Rows[j]["hy_username"].ToString());
                             Response.Write("</dt>");
                         }
                         else
                         {
                             Response.Write("<dt>");
                             Response.Write("<input type=\"checkbox\" name=\"" + pis_name + "_subuser" + j.ToString() + "\" value=\"");
                             Response.Write(dtuser.Rows[j]["hy_userid"].ToString() + "\" text=\"" + dtuser.Rows[j]["hy_username"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                             Response.Write(dtuser.Rows[j]["hy_username"].ToString());
                             Response.Write("</dt>");
                         }
                     }
                 }
                 Response.Write("</dl>");
                 Response.Write("</dd>");
             }
         }
     }
     //显示当前部门下的人员
     HyoaClass.Hyoa_user Hyoa_user_curdept = new HyoaClass.Hyoa_user();
     DataTable dtuser_curdept = Hyoa_user_curdept.GetUsers(pis_DeptId);
     if (dtuser_curdept.Rows.Count > 0)
     {
         for (var k = 0; k < dtuser_curdept.Rows.Count; k++)
         {
             //判断已选中
             if (ls_users.Contains("," + dtuser_curdept.Rows[k]["hy_userid"].ToString() + ","))
             {
                 Response.Write("<dt>");
                 Response.Write("<input type=\"checkbox\" checked=\"checked\" name=\"" + pis_name + "_sub_subuser" + k.ToString() + "\" value=\"");
                 Response.Write(dtuser_curdept.Rows[k]["hy_userid"].ToString() + "\" text=\"" + dtuser_curdept.Rows[k]["hy_username"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                 Response.Write(dtuser_curdept.Rows[k]["hy_username"].ToString());
                 Response.Write("</dt>");
             }
             else
             {
                 Response.Write("<dt>");
                 Response.Write("<input type=\"checkbox\" name=\"" + pis_name + "_sub_subuser" + k.ToString() + "\" value=\"");
                 Response.Write(dtuser_curdept.Rows[k]["hy_userid"].ToString() + "\" text=\"" + dtuser_curdept.Rows[k]["hy_username"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                 Response.Write(dtuser_curdept.Rows[k]["hy_username"].ToString());
                 Response.Write("</dt>");
             }
         }
     }
 }
Exemplo n.º 13
0
    protected void Hy_nexttachename_SelectedIndexChanged(object sender, EventArgs e)
    {
        //后序环节处理人部门
        HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
        DataTable dt2 = Hyoa_flowtacheuser.GetDeptInfobyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
        if (dt2.Rows.Count > 0)
        {
            this.Hy_deptlist_clr.DataSource = dt2;
            this.Hy_deptlist_clr.DataTextField = "hy_deptname";
            this.Hy_deptlist_clr.DataValueField = "hy_deptid";
            this.Hy_deptlist_clr.DataBind();
            this.Hy_deptlist_clr.Items.Insert(0, "--请选择--");
            this.Hy_deptlist_clr.SelectedIndex = 0;
        }
        dt2.Clear();
        //后序环节传阅人员
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        dt2 = Hyoa_dept.Getdepts();
        if (dt2.Rows.Count > 0)
        {
            this.Hy_deptlist.DataSource = dt2;
            this.Hy_deptlist.DataTextField = "hy_deptname";
            this.Hy_deptlist.DataValueField = "hy_deptid";
            this.Hy_deptlist.DataBind();
            this.Hy_deptlist.SelectedIndex = 0;
        }
        dt2.Clear();

        //后序环节处理人员
        dt2 = Hyoa_flowtacheuser.Getcuruserinfobyflowidtacheiddeptid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString(), this.Hy_deptlist_clr.SelectedValue.ToString());
        if (dt2.Rows.Count > 0)
        {
            this.Hy_hjclr.DataSource = dt2;
            this.Hy_hjclr.DataTextField = "hy_username";
            this.Hy_hjclr.DataValueField = "hy_userid";
            this.Hy_hjclr.DataBind();
            this.Hy_hjclr.SelectedIndex = 0;
        }
        dt2.Clear();

        //后序环节传阅人员
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        dt2 = Hyoa_user.Getusersbydeptid(this.Hy_deptlist.SelectedValue.ToString());
        if (dt2.Rows.Count > 0)
        {
            this.Hy_rylist.DataSource = dt2;
            this.Hy_rylist.DataTextField = "hy_username";
            this.Hy_rylist.DataValueField = "hy_userid";
            this.Hy_rylist.DataBind();
            this.Hy_rylist.SelectedIndex = 0;
        }
        dt2.Clear();

        //得到 后续环节的默认环节 对应的 提醒默认值,然后进行赋值
        string ls_temp_tacheid = this.Hy_nexttachename.SelectedValue.ToString();
        HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
        DataTable dt_getrddoissendsmsandmsg = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.txtflowid.Text, ls_temp_tacheid);
        if (dt_getrddoissendsmsandmsg.Rows.Count > 0)
        {
            if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendSms"].ToString() == "是")
                this.f_isSendsms_clr.Checked = true;
            else
                this.f_isSendsms_clr.Checked = false;

            if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendMessage"].ToString() == "是")
                this.f_isSendjstx_clr.Checked = true;
            else
                this.f_isSendjstx_clr.Checked = false;

            if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendSms"].ToString() == "是")
                this.f_isSendsms_cyr.Checked = true;
            else
                this.f_isSendsms_cyr.Checked = false;

            if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendMessage"].ToString() == "是")
                this.f_isSendjstx_cyr.Checked = true;
            else
                this.f_isSendjstx_cyr.Checked = false;

            //this.txthy_ifshowcurcomp.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurcomp"].ToString();
            this.txthy_ifshowcurdept.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurdept"].ToString();
        }
        //----只显示当前用户本部门人员start-----
        if (this.txthy_ifshowcurdept.Text == "是")
        {
            HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
            if (Request.QueryString["docid"] != null)
            {
                DataTable tempTable = new DataTable();
                DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列
                tempTable.Columns.Add(col);  //追加一列  add
                DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
                tempTable.Columns.Add(col2);  //追加一列  add

                //更新部门
                for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
                {
                    string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                    if (ls_dept1 == Session["hydeptid"].ToString())
                    {
                        DataRow dr = tempTable.NewRow();
                        dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                        dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                        tempTable.Rows.Add(dr);
                    }
                }
                //先清空
                this.Hy_deptlist_clr.Items.Clear();
                this.Hy_hjclr.Items.Clear();
                if (tempTable.Rows.Count > 0)
                {
                    this.Hy_deptlist_clr.DataSource = tempTable;
                    this.Hy_deptlist_clr.DataTextField = "value1";
                    this.Hy_deptlist_clr.DataValueField = "value2";
                    this.Hy_deptlist_clr.DataBind();
                    //在调用这个部门对应的人员
                    DataTable dt = Hyoa_flowtacheuser.Getcuruserinfobyflowidtacheiddeptid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString(), this.Hy_deptlist_clr.SelectedValue.ToString());
                    if (dt.Rows.Count > 0)
                    {
                        this.Hy_hjclr.DataSource = dt;
                        this.Hy_hjclr.DataTextField = "hy_username";
                        this.Hy_hjclr.DataValueField = "hy_userid";
                        this.Hy_hjclr.DataBind();
                    }
                }

            }
        }
        //----只显示当前用户本部门人员end-------
    }
Exemplo n.º 14
0
    protected void Hy_nexttachename_SelectedIndexChanged(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        //后序环节处理人部门
        HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
        DataTable dt = new DataTable();
        //先清空
        this.Hy_deptlist_clr.DataSource = dt;
        this.Hy_deptlist_clr.DataTextField = "hy_deptname";
        this.Hy_deptlist_clr.DataValueField = "hy_deptid";
        this.Hy_deptlist_clr.DataBind();
        //先得到后续环节处理人集合
        DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
        if (dt_nextflowuser.Rows.Count > 0)
        {
            string ls_temp1 = "";
            for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
            {
                ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
            }
            ls_temp1 += ",";
            string sql = "";
            if (Session["conntype"].ToString() == "SQL")
            {
                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
            }
            dt = Hyoa_global.GetDataTable_USER(sql);
            if (dt.Rows.Count > 0)
            {
                this.Hy_deptlist_clr.Items.Insert(0, "--请选择--");
                ls_temp1 = "";
                int t = 1;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_deptid"].ToString() + ","))
                    {
                    }
                    else
                    {
                        //解决多级部门后续提交时部门显示的问题  added by xf 20131226
                        string ls_deptname = "";
                        if (dt.Rows[i]["hy_deptid"].ToString().Length == 3)
                        {
                            ls_deptname = dt.Rows[i]["hy_deptname"].ToString();
                        }
                        else
                        {
                            ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString());
                        }
                        this.Hy_deptlist_clr.Items.Insert(t, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString()));
                        t += 1;
                        ls_temp1 += "," + dt.Rows[i]["hy_deptid"].ToString();
                    }
                }
                this.Hy_deptlist_clr.SelectedIndex = 0;
            }
        }
        dt.Clear();
        //后序环节传阅人员部门
        //先清空
        this.Hy_deptlist.DataSource = dt;
        this.Hy_deptlist.DataTextField = "hy_deptname";
        this.Hy_deptlist.DataValueField = "hy_deptid";
        this.Hy_deptlist.DataBind();
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        dt = Hyoa_dept.Getdepts();
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                //解决多级部门后续提交时部门显示的问题  added by xf 20131226
                string ls_deptname = "";
                if (dt.Rows[i]["hy_deptid"].ToString().Length == 3)
                {
                    ls_deptname = dt.Rows[i]["hy_deptname"].ToString();
                }
                else
                {
                    ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString());
                }
                this.Hy_deptlist.Items.Insert(i, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString()));
            }
            this.Hy_deptlist.SelectedIndex = 0;
        }
        dt.Clear();
        //后序环节处理人员
        //先得到后续环节处理人集合
        //先清空
        this.Hy_hjclr.DataSource = dt;
        this.Hy_hjclr.DataTextField = "hy_username";
        this.Hy_hjclr.DataValueField = "hy_userid";
        this.Hy_hjclr.DataBind();
        dt_nextflowuser.Clear();
        dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
        if (dt_nextflowuser.Rows.Count > 0)
        {
            string ls_temp1 = "";
            for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
            {
                ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
            }
            ls_temp1 += ",";
            string sql = "";
            if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
            {
                if (Session["conntype"].ToString() == "SQL")
                {
                    sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                }
                if (Session["conntype"].ToString() == "ORACLE")
                {
                    sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                }
            }
            else
            {
                if (Session["conntype"].ToString() == "SQL")
                {
                    sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                }
                if (Session["conntype"].ToString() == "ORACLE")
                {
                    sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                }
            }
            dt = Hyoa_global.GetDataTable_USER(sql);
            if (dt.Rows.Count > 0)
            {
                ls_temp1 = "";
                int t = 0;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                    {
                    }
                    else
                    {
                        this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                        t += 1;
                        ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                    }
                }
            }
        }
        dt.Clear();
        //后序环节传阅人员
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        dt = Hyoa_user.Getusersbydeptid(this.Hy_deptlist.SelectedValue.ToString());
        if (dt.Rows.Count > 0)
        {
            this.Hy_rylist.DataSource = dt;
            this.Hy_rylist.DataTextField = "hy_username";
            this.Hy_rylist.DataValueField = "hy_userid";
            this.Hy_rylist.DataBind();
        }
        dt.Clear();
        //得到 后续环节的默认环节 对应的 提醒默认值,然后进行赋值
        string ls_temp_tacheid = this.Hy_nexttachename.SelectedValue.ToString();
        HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
        DataTable dt_getrddoissendsmsandmsg = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.txtflowid.Text, ls_temp_tacheid);
        if (dt_getrddoissendsmsandmsg.Rows.Count > 0)
        {
            if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendSms"].ToString() == "是")
                this.f_isSendsms_clr.Checked = true;
            else
                this.f_isSendsms_clr.Checked = false;

            if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendMessage"].ToString() == "是")
                this.f_isSendjstx_clr.Checked = true;
            else
                this.f_isSendjstx_clr.Checked = false;

            if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendSms"].ToString() == "是")
                this.f_isSendsms_cyr.Checked = true;
            else
                this.f_isSendsms_cyr.Checked = false;

            if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendMessage"].ToString() == "是")
                this.f_isSendjstx_cyr.Checked = true;
            else
                this.f_isSendjstx_cyr.Checked = false;

            this.txthy_ifshowcurcomp.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurcomp"].ToString();
            this.txthy_ifshowcurdept.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurdept"].ToString();
        }

        //----考虑只显示本单位的情况start-----
        if (this.txthy_ifshowcurcomp.Text == "是")
        {
            DataTable tempTable = new DataTable();
            DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列
            tempTable.Columns.Add(col);  //追加一列  add
            DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
            tempTable.Columns.Add(col2);  //追加一列  add

            //更新部门
            for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
            {
                string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                ls_dept1 = ls_dept1.Substring(0, 3);
                string ls_curdept = Session["hydeptid"].ToString();
                ls_curdept = ls_curdept.Substring(0, 3);

                if (ls_dept1 == ls_curdept)
                {
                    DataRow dr = tempTable.NewRow();
                    dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                    dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                    tempTable.Rows.Add(dr);
                }
            }
            //先清空
            this.Hy_deptlist_clr.Items.Clear();

            this.Hy_deptlist_clr.DataSource = tempTable;
            this.Hy_deptlist_clr.DataTextField = "value1";
            this.Hy_deptlist_clr.DataValueField = "value2";
            this.Hy_deptlist_clr.DataBind();

            this.Hy_hjclr.Items.Clear();

            //在调用这个部门对应的人员
            //先得到后续环节处理人集合
            dt_nextflowuser.Clear();
            dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
            if (dt_nextflowuser.Rows.Count > 0)
            {
                string ls_temp1 = "";
                for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                {
                    ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                }
                ls_temp1 += ",";
                string sql = "";
                if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                    }
                }
                else
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                    }
                }
                dt = Hyoa_global.GetDataTable_USER(sql);
                if (dt.Rows.Count > 0)
                {
                    ls_temp1 = "";
                    int t = 0;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                        {
                        }
                        else
                        {
                            this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                            t += 1;
                            ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                        }
                    }
                }
            }
            dt.Clear();
        }
        //----考虑只显示本单位的情况end-------

        //----考虑只显示和登记人同单位的情况start-----
        if (this.txthy_ifshowcurcomp.Text == "和登记人同单位")
        {
            if (Request.QueryString["docid"] != null)
            {
                //得到登记人的部门ID
                string ls_djrbmid = "";
                string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'";
                DataTable dt_flowmain = Hyoa_global.GetDataTable(sql);
                if (dt_flowmain.Rows.Count > 0)
                {
                    ls_djrbmid = dt_flowmain.Rows[0]["hy_djrbmid"].ToString();

                    DataTable tempTable = new DataTable();
                    DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列
                    tempTable.Columns.Add(col);  //追加一列  add
                    DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
                    tempTable.Columns.Add(col2);  //追加一列  add

                    //更新部门
                    for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
                    {
                        string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                        if (ls_dept1.Substring(0, 3) == ls_djrbmid.Substring(0, 3))
                        {
                            DataRow dr = tempTable.NewRow();
                            dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                            dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                            tempTable.Rows.Add(dr);
                        }
                    }
                    //先清空
                    this.Hy_deptlist_clr.Items.Clear();

                    this.Hy_deptlist_clr.DataSource = tempTable;
                    this.Hy_deptlist_clr.DataTextField = "value1";
                    this.Hy_deptlist_clr.DataValueField = "value2";
                    this.Hy_deptlist_clr.DataBind();

                    this.Hy_hjclr.Items.Clear();

                    //在调用这个部门对应的人员
                    dt_nextflowuser.Clear();
                    dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
                    if (dt_nextflowuser.Rows.Count > 0)
                    {
                        string ls_temp1 = "";
                        for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                        {
                            ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                        }
                        ls_temp1 += ",";
                        if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                            }
                        }
                        else
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                            }
                        }
                        dt = Hyoa_global.GetDataTable_USER(sql);
                        if (dt.Rows.Count > 0)
                        {
                            ls_temp1 = "";
                            int t = 0;
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                                {
                                }
                                else
                                {
                                    this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                                    t += 1;
                                    ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                                }
                            }
                        }
                    }
                    dt.Clear();
                }
            }
        }
        //----考虑只显示和登记人同单位的情况end-------

        //----考虑只显示登记人的分管领导的情况start-----
        if (this.txthy_ifshowcurcomp.Text == "登记人的分管领导")
        {
            if (Request.QueryString["docid"] != null)
            {
                //得到登记人的部门ID
                string ls_djrbmid = "";
                string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'";
                DataTable dt_flowmain = Hyoa_global.GetDataTable(sql);
                if (dt_flowmain.Rows.Count > 0)
                {
                    ls_djrbmid = dt_flowmain.Rows[0]["hy_djrbmid"].ToString();

                    DataTable tempTable = new DataTable();
                    DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列
                    tempTable.Columns.Add(col);  //追加一列  add
                    DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
                    tempTable.Columns.Add(col2);  //追加一列  add

                    //更新部门
                    for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
                    {
                        string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                        if (ls_dept1.Substring(3) == ls_djrbmid.Substring(3))
                        {
                            DataRow dr = tempTable.NewRow();
                            dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                            dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                            tempTable.Rows.Add(dr);
                        }
                    }
                    //先清空
                    this.Hy_deptlist_clr.Items.Clear();

                    this.Hy_deptlist_clr.DataSource = tempTable;
                    this.Hy_deptlist_clr.DataTextField = "value1";
                    this.Hy_deptlist_clr.DataValueField = "value2";
                    this.Hy_deptlist_clr.DataBind();

                    this.Hy_hjclr.Items.Clear();

                    //在调用这个部门对应的人员
                    dt_nextflowuser.Clear();
                    dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
                    if (dt_nextflowuser.Rows.Count > 0)
                    {
                        string ls_temp1 = "";
                        for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                        {
                            ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                        }
                        ls_temp1 += ",";
                        if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                            }
                        }
                        else
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                            }
                        }
                        dt = Hyoa_global.GetDataTable_USER(sql);
                        if (dt.Rows.Count > 0)
                        {
                            ls_temp1 = "";
                            int t = 0;
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                                {
                                }
                                else
                                {
                                    this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                                    t += 1;
                                    ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                                }
                            }
                        }
                    }
                    dt.Clear();
                }
            }
        }
        //----考虑只显示登记人的分管领导的情况end-------

        //----只显示登记人start-----
        if (this.txthy_ifshowcurdept.Text == "只显示登记人")
        {
            if (Request.QueryString["docid"] != null)
            {
                string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'";
                DataTable dt_flowmain = Hyoa_global.GetDataTable(sql);
                if (dt_flowmain.Rows.Count > 0)
                {
                    //先清空
                    this.Hy_deptlist_clr.Items.Clear();
                    Hy_deptlist_clr.Items.Insert(0, new ListItem(dt_flowmain.Rows[0]["hy_djrbmname"].ToString(), dt_flowmain.Rows[0]["hy_djrbmid"].ToString()));

                    //先清空
                    this.Hy_hjclr.Items.Clear();
                    Hy_hjclr.Items.Insert(0, new ListItem(dt_flowmain.Rows[0]["hy_djrname"].ToString(), dt_flowmain.Rows[0]["hy_djrid"].ToString()));
                }
            }
        }
        //----只显示登记人end-------

        //----只显示当前用户本部门人员start-----
        if (this.txthy_ifshowcurdept.Text == "是")
        {
            if (Request.QueryString["docid"] != null)
            {
                DataTable tempTable = new DataTable();
                DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列
                tempTable.Columns.Add(col);  //追加一列  add
                DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
                tempTable.Columns.Add(col2);  //追加一列  add
                //更新部门
                for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
                {
                    string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                    if (ls_dept1 == Session["hydeptid"].ToString())
                    {
                        DataRow dr = tempTable.NewRow();
                        dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                        dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                        tempTable.Rows.Add(dr);
                    }
                }
                //先清空
                this.Hy_deptlist_clr.Items.Clear();

                this.Hy_deptlist_clr.DataSource = tempTable;
                this.Hy_deptlist_clr.DataTextField = "value1";
                this.Hy_deptlist_clr.DataValueField = "value2";
                this.Hy_deptlist_clr.DataBind();

                this.Hy_hjclr.Items.Clear();

                //在调用这个部门对应的人员
                dt_nextflowuser.Clear();
                dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
                if (dt_nextflowuser.Rows.Count > 0)
                {
                    string ls_temp1 = "";
                    for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                    {
                        ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                    }
                    ls_temp1 += ",";
                    string sql = "";
                    if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                    {
                        if (Session["conntype"].ToString() == "SQL")
                        {
                            sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                        }
                        if (Session["conntype"].ToString() == "ORACLE")
                        {
                            sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                        }
                    }
                    else
                    {
                        if (Session["conntype"].ToString() == "SQL")
                        {
                            sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                        }
                        if (Session["conntype"].ToString() == "ORACLE")
                        {
                            sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                        }
                    }
                    dt = Hyoa_global.GetDataTable_USER(sql);
                    if (dt.Rows.Count > 0)
                    {
                        ls_temp1 = "";
                        int t = 0;
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                            {
                            }
                            else
                            {
                                this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                                t += 1;
                                ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                            }
                        }
                    }
                }
                dt.Clear();
            }
        }
        //----只显示当前用户本部门人员end-------
    }
Exemplo n.º 15
0
    private void DataPlay()
    {
        ////////得到当前模块对应的role
        //////HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
        //////DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
        //////string ls_role = "Role9999";
        //////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.Button_Return.Visible = true; //统计
        //////}
        //////else
        //////{
        //////    this.isrole.Value = "0";
        //////    this.Button_Return.Visible = false; //统计
        //////}
        HyoaClass.DAO db = new HyoaClass.DAO();

        DataTable tempTable = new DataTable();
        DataColumn coldeptname = new DataColumn("deptname", typeof(String));
        tempTable.Columns.Add(coldeptname);
        DataColumn colusername = new DataColumn("username", typeof(String));
        tempTable.Columns.Add(colusername);
        DataColumn col1 = new DataColumn("tatalvalue1", typeof(String));
        tempTable.Columns.Add(col1);
        DataColumn col2 = new DataColumn("tatalvalue2", typeof(String));
        tempTable.Columns.Add(col2);
        DataColumn col3 = new DataColumn("tatalvalue3", typeof(String));
        tempTable.Columns.Add(col3);

        string sql = "";
        Double li_depttotal = 0;
        Double li_deptusernum = 0;
        Double li_dept_fts = 0;
        float li_usertotal = 0;

        //先得到部门,然后按部门进行统计
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        DataTable dt = Hyoa_dept.Getdepts();
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        double lisum = 0;
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                li_depttotal = 0;
                li_deptusernum = 0;
                li_dept_fts = 0;

                //得到部门在选择时间段内的公摊总值
                //sql = "select sum(a.hy_field36*a.hy_field37+a.hy_field38*a.hy_field40+a.hy_field39*a.hy_field71+a.hy_field76*a.hy_field81+a.hy_field77*a.hy_field82+a.hy_field78*a.hy_field83+a.hy_field79*a.hy_field84) as depttotal from hyp_flowmain a,hyp_flowmain b where a.hy_mudelid='" + this.txtmudelid.Value + "' and a.hy_tableid='" + this.txttableid.Value + "' and a.hy_curtacheid='**' and a.hy_djrbmid='" + dt.Rows[i]["hy_deptid"].ToString() + "' and a.hy_field1=b.hy_field3 and a.hy_field4=b.hy_field1 and b.hy_field2='否'";
                sql = "select sum(a.hy_field36*a.hy_field37+a.hy_field38*a.hy_field40+a.hy_field39*a.hy_field71+a.hy_field76*a.hy_field81+a.hy_field77*a.hy_field82+a.hy_field78*a.hy_field83+a.hy_field79*a.hy_field84) as depttotal from hyp_flowmain a where a.hy_mudelid='" + this.txtmudelid.Value + "' and a.hy_tableid='" + this.txttableid.Value + "' and a.hy_curtacheid='**' and a.hy_djrbmid='" + dt.Rows[i]["hy_deptid"].ToString() + "' and a.hy_field7='否'";
                if (this.hy_djsj_start_1.Value != "")
                    sql += " and a.hy_djsj >= '" + this.hy_djsj_start_1.Value + "' ";

                if (this.hy_djsj_end_1.Value != "")
                    sql += " and a.hy_djsj <= '" + this.hy_djsj_end_1.Value + "' ";

                DataTable dt_depttatle = db.GetDataTable(sql);
                if (dt_depttatle.Rows.Count > 0 && dt_depttatle.Rows[0]["depttotal"].ToString() != null && dt_depttatle.Rows[0]["depttotal"].ToString()!="")
                    li_depttotal = System.Double.Parse(dt_depttatle.Rows[0]["depttotal"].ToString());

                //得到当前部门有几个人员
                sql = "select count(*) as deptusernum from hyt_user where hy_deptid='" + dt.Rows[i]["hy_deptid"].ToString() + "'";
                DataTable dt_deptusernum = db.GetDataTable(sql);
                li_deptusernum = System.Int32.Parse(dt_deptusernum.Rows[0]["deptusernum"].ToString());

                //部门分摊数
                if (li_deptusernum == 0)
                { }
                else
                {
                    li_dept_fts = li_depttotal / li_deptusernum;
                }

                //得到该部门下边的人员
                DataTable dt_user = Hyoa_user.Getusersbydeptid(dt.Rows[i]["hy_deptid"].ToString());
                if (dt_user.Rows.Count > 0)
                {
                    for (int j = 0; j < dt_user.Rows.Count; j++)
                    {
                        li_usertotal = 0;

                        //根据人员进行统计
                        sql = "select sum(a.hy_field36*a.hy_field37+a.hy_field38*a.hy_field40+a.hy_field39*a.hy_field71+a.hy_field76*a.hy_field81+a.hy_field77*a.hy_field82+a.hy_field78*a.hy_field83+a.hy_field79*a.hy_field84) as depttotal from hyp_flowmain a where a.hy_mudelid='" + this.txtmudelid.Value + "' and a.hy_tableid='" + this.txttableid.Value + "' and a.hy_curtacheid='**' and a.hy_bt='" + dt_user.Rows[j]["hy_username"].ToString() + "'  and a.hy_field7='是'";
                        if (this.hy_djsj_start_1.Value != "")
                            sql += " and a.hy_djsj >= '" + this.hy_djsj_start_1.Value + "' ";

                        if (this.hy_djsj_end_1.Value != "")
                            sql += " and a.hy_djsj <= '" + this.hy_djsj_end_1.Value + "' ";

                        DataTable dt_usertatle = db.GetDataTable(sql);
                        if (dt_usertatle.Rows.Count > 0 && dt_usertatle.Rows[0]["depttotal"].ToString() != null && dt_usertatle.Rows[0]["depttotal"].ToString() != "")
                        {
                            li_usertotal = float.Parse(dt_usertatle.Rows[0]["depttotal"].ToString());

                        }

                        DataRow dr = tempTable.NewRow();
                        dr["deptname"] = dt.Rows[i]["hy_deptname"].ToString();
                        dr["username"] = dt_user.Rows[j]["hy_username"].ToString();
                        dr["tatalvalue1"] = li_usertotal.ToString("F2");
                        dr["tatalvalue2"] = li_dept_fts.ToString("F2");
                        dr["tatalvalue3"] = (li_usertotal + li_dept_fts).ToString("F2");
                        lisum += li_usertotal + li_dept_fts;
                        tempTable.Rows.Add(dr);
                    }
                }
            }
        }

        this.lblsum.Text = "合计总额:" + lisum.ToString("F2");
        this.rptlist.DataSource = tempTable;
        this.rptlist.DataBind();
        dt.Clear();
    }
Exemplo n.º 16
0
    //得到下一级部门的信息
    private void GetNextDept(string pis_DeptId, string ls_users)
    {
        //得到二级部门
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        DataTable dtdept = Hyoa_dept.GetSubDeptsOrderbysort(pis_DeptId);
        if (dtdept.Rows.Count > 0)
        {
            for (var i = 0; i < dtdept.Rows.Count; i++)
            {
                //有下一级部门
                if (Hyoa_dept.isHaveSubDept(dtdept.Rows[i]["hy_deptid"].ToString()) == true)
                {
                    //输出二级部门头部
                    Response.Write("<dd class=\"folderClose\">");
                    Response.Write("<input type=\"checkbox\" name=\"Dept" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" id=\"" + dtdept.Rows[i]["hy_deptname"].ToString() + "\">");
                    Response.Write(dtdept.Rows[i]["hy_deptname"].ToString());
                    Response.Write("<dl>");
                    GetNextDept(dtdept.Rows[i]["hy_deptid"].ToString(), ls_users);
                    //输出二级部门尾部
                    Response.Write("</dl>");
                    Response.Write("</dd>");
                }
                else
                {
                    //输出二级部门头部
                    Response.Write("<dt>");
                    Response.Write("<input type=\"checkbox\" name=\"Dept" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" id=\"" + dtdept.Rows[i]["hy_deptname"].ToString() + "\">");
                    Response.Write(dtdept.Rows[i]["hy_deptname"].ToString());
                    //输出二级部门尾部
                    Response.Write("</dt>");
                }

            }
        }
    }
Exemplo n.º 17
0
    private void DataPlay()
    {
        if (this.Request.QueryString["id"] != null)
        {
            this.txtid.Value = this.Request.QueryString["id"].ToString();
        }
        HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd();
        DataTable dt = Hyoa_wjcd.Getdoc(this.txtid.Value);
        if (dt.Rows.Count > 0)
        {
            this.txtdocid.Value = dt.Rows[0]["DOCID"].ToString();
            this.txtid.Value = dt.Rows[0]["ID"].ToString();

            this.lblhy_fsrid.Text = dt.Rows[0]["hy_fsrid"].ToString();
            this.lblhy_fsrname.Text = dt.Rows[0]["hy_fsrname"].ToString();
            this.lblhy_datetime.Text = dt.Rows[0]["hy_datetime"].ToString();
            this.txthy_jsrname.Text = dt.Rows[0]["hy_jsrname"].ToString();
            this.txthy_jsrid.Text = dt.Rows[0]["hy_jsrid"].ToString();
            this.txthy_title.Text = dt.Rows[0]["hy_title"].ToString();
            this.ddlhy_foldername.Text = dt.Rows[0]["hy_foldername"].ToString();
            if (dt.Rows[0]["hy_jzsj"] == System.DBNull.Value)
            {
                this.jzsj.Text = "";
            }
            else
            {
                if (System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString() == "1900-1-1")
                {
                    this.jzsj.Text = "";
                }
                else
                {
                    this.jzsj.Text = System.DateTime.Parse(dt.Rows[0]["hy_jzsj"].ToString()).ToShortDateString();
                }
            }
            if (dt.Rows[0]["hy_txfs"] == System.DBNull.Value)
            {
                this.txfs.Text = "";
            }
            else
            {
                this.txfs.Text = dt.Rows[0]["hy_txfs"].ToString();
            }
            //附件
            HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
            DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(this.txtdocid.Value);
            if (dt_fileatt.Rows.Count > 0)
            {
                string ls_temp = "";
                for (var i = 0; i < dt_fileatt.Rows.Count; i++)
                {
                    string ls_path = dt_fileatt.Rows[i]["hy_filepath"].ToString();
                    ls_path = ls_path.Replace("+","%2B");
                    ls_temp += (i + 1).ToString() + "、<a href='/" + ls_path + "' target='_blank'>" + dt_fileatt.Rows[i]["hy_filename"].ToString() + "</a><br />";
                }
                this.lblhy_field2.Text = ls_temp;
            }

            this.hy_content1.Text = dt.Rows[0]["hy_body"].ToString();

            //显示回复列表
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            //string ls_hfsql = "select * from hyp_gzlxdhf where hy_fsrdocid='" + this.txtdocid.Value + "' ";
            string ls_jsrsql = "select * from hyp_wjcd where hy_type='收件' and DOCID='" + this.txtdocid.Value + "' order by  hy_jsrid asc";
            DataTable dt_jsr = Hyoa_global.GetDataTable(ls_jsrsql);
            if (dt_jsr.Rows.Count > 0)
            {
                //输出回复记录
                this.lblhf.Text = "";
                this.lblhf.Text = "<table width=\"95%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" class=\"tb1-main\">";
                this.lblhf.Text += "<tr><td colspan='7' class='Tdcellright'>回复情况:共" + dt_jsr.Rows.Count + "人</td></tr>";
                this.lblhf.Text += "<tr>";
                this.lblhf.Text += "<td width='10%' class='Tdcellleft' align='center'>序号</td>";
                this.lblhf.Text += "<td width='15%' class='Tdcellleft' align='center'>部门名称</td>";
                this.lblhf.Text += "<td width='10%' class='Tdcellleft' align='center'>回复人</td>";
                this.lblhf.Text += "<td width='15%' class='Tdcellleft' align='center'>回复时间</td>";
                this.lblhf.Text += "<td class='Tdcellleft' align='center'>回复内容</td>";
                this.lblhf.Text += "<td width='15%' class='Tdcellleft' align='center'>附件</td>";
                this.lblhf.Text += "<td width='10%' class='Tdcellleft' align='center'>上报情况</td>";
                this.lblhf.Text += "</tr>";
                for (var i = 0; i < dt_jsr.Rows.Count; i++)
                {
                    string ls_bmmc = "";
                    string ls_hfr = "";
                    string ls_hfsj = "";
                    string ls_hfnr = "";
                    string ls_fj = "";
                    string ls_sbqk = "";

                    if (dt_jsr.Rows[i]["hy_ifyhf"].ToString() == "1")
                    {
                        string ls_hfsql = "select * from hyp_gzlxdhf where hy_fsrdocid='" + this.txtdocid.Value + "' and hy_jsrdocid='" + dt_jsr.Rows[i]["ID"].ToString() + "' ";
                        DataTable dt_hf = Hyoa_global.GetDataTable(ls_hfsql);
                        if (dt_hf.Rows.Count > 0)
                        {
                            ls_bmmc = dt_hf.Rows[0]["hy_deptname"].ToString();
                            ls_hfr = dt_hf.Rows[0]["hy_username"].ToString();
                            ls_hfsj = dt_hf.Rows[0]["hy_time"].ToString();
                            ls_hfnr = dt_hf.Rows[0]["hy_body"].ToString();
                            //附件
                            DataTable dt_fileatt2 = Hyoa_fileatt.GetfileattByFatherid(dt_hf.Rows[0]["hy_jsrdocid"].ToString());
                            if (dt_fileatt2.Rows.Count > 0)
                            {
                                for (var j = 0; j < dt_fileatt2.Rows.Count; j++)
                                {
                                    if (ls_fj != "")
                                    {
                                        ls_fj += "<br />";
                                    }
                                    ls_fj += (j + 1).ToString() + "、<a href='/" + dt_fileatt2.Rows[j]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt2.Rows[j]["hy_filename"].ToString() + "</a>";
                                }
                            }
                            //上报情况
                            System.TimeSpan ts = System.DateTime.Parse(dt_hf.Rows[0]["hy_time"].ToString()) - System.DateTime.Parse(dt_jsr.Rows[0]["hy_jzsj"].ToString());
                            int days = ts.Days;
                            if (days > 0)
                            {
                                ls_sbqk = "逾期上报";
                            }
                            else
                            {
                                ls_sbqk = "按期上报";
                            }
                        }
                    }
                    else
                    {
                        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
                        DataTable dt_user = Hyoa_user.Getuserallinfo(dt_jsr.Rows[i]["hy_jsrid"].ToString());
                        if (dt_user.Rows.Count > 0)
                        {
                            HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
                            DataTable dt_dept = Hyoa_dept.Getdept(dt_user.Rows[0]["hy_deptid"].ToString());
                            if (dt_dept.Rows.Count > 0)
                            {
                                ls_bmmc = dt_dept.Rows[0]["hy_deptname"].ToString();
                            }
                        }
                        ls_hfr = dt_jsr.Rows[i]["hy_jsrname"].ToString();
                        //附件
                        DataTable dt_fileatt2 = Hyoa_fileatt.GetfileattByFatherid(dt_jsr.Rows[i]["ID"].ToString());
                        if (dt_fileatt.Rows.Count > 0)
                        {
                            for (var j = 0; j < dt_fileatt2.Rows.Count; j++)
                            {
                                ls_fj += (j + 1).ToString() + "、<a href='/" + dt_fileatt2.Rows[j]["hy_filepath"].ToString() + "' target='_blank'>" + dt_fileatt2.Rows[j]["hy_filename"].ToString() + "</a><br />";
                            }
                        }
                        //上报情况
                        ls_sbqk = "未上报";
                    }

                    this.lblhf.Text += "<tr>";
                    this.lblhf.Text += "<td width='10%' class='Tdcellright' align='center'>" + (i + 1).ToString() + "</td>";
                    this.lblhf.Text += "<td width='15%' class='Tdcellright' align='center'>" + ls_bmmc + "</td>";
                    this.lblhf.Text += "<td width='10%' class='Tdcellright' align='center'>" + ls_hfr + "</td>";
                    this.lblhf.Text += "<td width='15%' class='Tdcellright' align='center'>" + ls_hfsj + "&nbsp;</td>";
                    this.lblhf.Text += "<td class='Tdcellright' align='center'>" + ls_hfnr + "&nbsp;</td>";
                    this.lblhf.Text += "<td width='20%' class='Tdcellright' align='center'>" + ls_fj + "&nbsp;</td>";
                    this.lblhf.Text += "<td width='10%' class='Tdcellright' align='center'>" + ls_sbqk + "</td>";
                    this.lblhf.Text += "</tr>";
                }
                this.lblhf.Text += "</table>";
            }
        }
    }
Exemplo n.º 18
0
    //得到下一级部门的信息
    private void GetNextDept(string pis_DeptId, string pis_DeptName, string pi_num, string pis_name, string ls_string)
    {
        //循环二级部门
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        DataTable dtdept = Hyoa_dept.GetSubDepts(pis_DeptId);
        if (dtdept.Rows.Count > 0)
        {
            for (var i = 0; i < dtdept.Rows.Count; i++)
            {
                //判断是否有三级部门
                if (Hyoa_dept.isHaveSubDept(dtdept.Rows[i]["hy_deptid"].ToString()) == true)
                {
                    //存在三级部门
                    Response.Write("<dd class=\"folderClose\">");
                    if (ls_string != "")
                    {
                        if (ls_string == dtdept.Rows[i]["hy_deptid"].ToString())
                        {
                            Response.Write("<input type=\"checkbox\" name=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dtdept.Rows[i]["hy_deptname"].ToString() + "\" checked=\"checked\" align=\"left\" style=\"width:13;\"> ");
                            Response.Write(dtdept.Rows[i]["hy_deptname"].ToString());
                        }
                        else
                        {
                            Response.Write("<input type=\"checkbox\" name=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dtdept.Rows[i]["hy_deptname"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                            Response.Write(dtdept.Rows[i]["hy_deptname"].ToString());
                        }
                    }
                    else
                    {
                        Response.Write("<input type=\"checkbox\" name=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dtdept.Rows[i]["hy_deptname"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                        Response.Write(dtdept.Rows[i]["hy_deptname"].ToString());
                    }
                    Response.Write("<dl>");

                    //显示子部门以及部门人员
                    GetNextDept(dtdept.Rows[i]["hy_deptid"].ToString(), dtdept.Rows[i]["hy_deptname"].ToString(), i.ToString(), "Dept" + dtdept.Rows[i]["hy_deptid"].ToString(), ls_string);

                    Response.Write("</dl>");
                    Response.Write("</dd>");
                }
                else
                {
                    //不存在子部门
                    Response.Write("<dt>");
                    if (ls_string != "")
                    {
                        if (ls_string == dtdept.Rows[i]["hy_deptid"].ToString())
                        {
                            Response.Write("<input type=\"checkbox\" name=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"");
                            Response.Write(dtdept.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dtdept.Rows[i]["hy_deptname"].ToString() + "\" checked=\"checked\" align=\"left\" style=\"width:13;\"> ");
                        }
                        else
                        {
                            Response.Write("<input type=\"checkbox\" name=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"");
                            Response.Write(dtdept.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dtdept.Rows[i]["hy_deptname"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                        }
                    }
                    else
                    {
                        Response.Write("<input type=\"checkbox\" name=\"" + dtdept.Rows[i]["hy_deptid"].ToString() + "\" value=\"");
                        Response.Write(dtdept.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dtdept.Rows[i]["hy_deptname"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                    }
                    Response.Write(dtdept.Rows[i]["hy_deptname"].ToString());
                    Response.Write("</dt>");
                }
            }
        }
    }
Exemplo n.º 19
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="";
            //默认选中当前所在部门  这个功能先取消
            //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_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
            DataTable dt = Hyoa_dept.GetFirstlevdepts();
            if (dt.Rows.Count > 0)
            {
                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    //判断有子部门
                    if (Hyoa_dept.isHaveSubDept(dt.Rows[i]["hy_deptid"].ToString())==true)
                    {
                        //存在子部门
                        Response.Write("<dd class=\"folderClose\">");
                        if (ls_string != "")
                        {
                            if (ls_string == dt.Rows[i]["hy_deptid"].ToString())
                            {
                                Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dt.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dt.Rows[i]["hy_deptname"].ToString() + "\" checked=\"checked\" align=\"left\" style=\"width:13;\"> ");
                                Response.Write(dt.Rows[i]["hy_deptname"].ToString());
                            }
                            else
                            {
                                Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dt.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dt.Rows[i]["hy_deptname"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                                Response.Write(dt.Rows[i]["hy_deptname"].ToString());
                            }
                        }
                        else
                        {
                            Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["hy_deptid"].ToString() + "\" value=\"" + dt.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dt.Rows[i]["hy_deptname"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                            Response.Write(dt.Rows[i]["hy_deptname"].ToString());
                        }
                        Response.Write("<dl>");

                        //显示子部门以及部门人员
                        GetNextDept(dt.Rows[i]["hy_deptid"].ToString(), dt.Rows[i]["hy_deptname"].ToString(), i.ToString(), "Dept" + dt.Rows[i]["hy_deptid"].ToString(), ls_string);

                        Response.Write("</dl>");
                        Response.Write("</dd>");
                    }
                    else
                    {
                        //不存在子部门
                        Response.Write("<dt>");
                        if (ls_string != "")
                        {
                            if (ls_string == dt.Rows[i]["hy_deptid"].ToString())
                            {
                                Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["hy_deptid"].ToString() + "\" value=\"");
                                Response.Write(dt.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dt.Rows[i]["hy_deptname"].ToString() + "\" checked=\"checked\" align=\"left\" style=\"width:13;\"> ");
                            }
                            else
                            {
                                Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["hy_deptid"].ToString() + "\" value=\"");
                                Response.Write(dt.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dt.Rows[i]["hy_deptname"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                            }
                        }
                        else
                        {
                            Response.Write("<input type=\"checkbox\" name=\"" + dt.Rows[i]["hy_deptid"].ToString() + "\" value=\"");
                            Response.Write(dt.Rows[i]["hy_deptid"].ToString() + "\" text=\"" + dt.Rows[i]["hy_deptname"].ToString() + "\" align=\"left\" style=\"width:13;\"> ");
                        }
                        Response.Write(dt.Rows[i]["hy_deptname"].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>");
        }
    }
Exemplo n.º 20
0
    private void DataPlay()
    {
        //文档ID
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        if (this.Request.QueryString["tableid"] != null)
        {
            this.txttableid.Text = this.Request.QueryString["tableid"].ToString();
        }
        if (this.Request.QueryString["flowid"] != null)
        {
            this.txtflowid.Text = this.Request.QueryString["flowid"].ToString();
        }
        if (this.Request.QueryString["tacheid"] != null)
        {
           this.txtcurtacheid.Text = this.Request.QueryString["tacheid"].ToString();
        }
        if (this.Request.QueryString["nexttacheids"] != null)
        {
            string pis_nexttacheids = this.Request.QueryString["nexttacheids"].ToString();
            string pis_nexttachenames = this.Request.QueryString["nexttachenames"].ToString();

            //-----条件流程的情况 start-----
            //根据模块ID得到流程信息
            DataTable dt = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.txtflowid.Text, this.txtcurtacheid.Text);
            if (dt.Rows.Count > 0)
            {
                //给相应的域赋值
                //当前环节
                this.Hy_CurrTacheName_Show.Text = dt.Rows[0]["hy_curtachename"].ToString();
                //后续环节
                if (pis_nexttacheids != "")
                {
                    string[] piv_nexttacheids = pis_nexttacheids.Split(',');
                    string[] piv_nexttachenames = pis_nexttachenames.Split(',');
                    for (var i = 0; i < piv_nexttacheids.Length; i++)
                    {
                        Hy_nexttachename.Items.Add(new ListItem(piv_nexttachenames[i], piv_nexttacheids[i]));
                    }
                    this.Hy_nexttachename.SelectedIndex = 0;

                    //得到 后续环节的默认环节 对应的 提醒默认值,然后进行赋值
                    string ls_temp_tacheid = piv_nexttacheids[0];
                    HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
                    DataTable dt_getrddoissendsmsandmsg = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.txtflowid.Text, ls_temp_tacheid);
                    if (dt_getrddoissendsmsandmsg.Rows.Count > 0)
                    {
                        if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendSms"].ToString() == "是")
                            this.f_isSendsms_clr.Checked = true;

                        if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendMessage"].ToString() == "是")
                            this.f_isSendjstx_clr.Checked = true;

                        if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendSms"].ToString() == "是")
                            this.f_isSendsms_cyr.Checked = true;

                        if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendMessage"].ToString() == "是")
                            this.f_isSendjstx_cyr.Checked = true;

                        this.txthy_ifshowcurcomp.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurcomp"].ToString();
                        this.txthy_ifshowcurdept.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurdept"].ToString();
                    }

                }
            }
            dt.Clear();
            //后序环节处理人部门
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            //先得到后续环节处理人集合
            DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
            if (dt_nextflowuser.Rows.Count > 0)
            {
                string ls_temp1 = "";
                for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                {
                    ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                }
                ls_temp1 += ",";
                string sql = "";
                if (Session["conntype"].ToString() == "SQL")
                {
                    sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                }
                if (Session["conntype"].ToString() == "ORACLE")
                {
                    sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                }
                dt = Hyoa_global.GetDataTable_USER(sql);
                if (dt.Rows.Count > 0)
                {
                    this.Hy_deptlist_clr.Items.Insert(0, "--请选择--");
                    ls_temp1 = "";
                    int t = 1;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_deptid"].ToString() + ","))
                        {
                        }
                        else
                        {
                            //解决多级部门后续提交时部门显示的问题  added by xf 20131226
                            string ls_deptname = "";
                            if (dt.Rows[i]["hy_deptid"].ToString().Length == 3)
                            {
                                ls_deptname = dt.Rows[i]["hy_deptname"].ToString();
                            }
                            else
                            {
                                ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString());
                            }
                            this.Hy_deptlist_clr.Items.Insert(t, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString()));
                            t += 1;
                            ls_temp1 += "," + dt.Rows[i]["hy_deptid"].ToString();
                        }
                    }
                    this.Hy_deptlist_clr.SelectedIndex = 0;
                }
            }
            dt.Clear();
            //后序环节传阅人部门
            HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
            dt = Hyoa_dept.Getdepts();
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //解决多级部门后续提交时部门显示的问题  added by xf 20131226
                    string ls_deptname = "";
                    if (dt.Rows[i]["hy_deptid"].ToString().Length == 3)
                    {
                        ls_deptname = dt.Rows[i]["hy_deptname"].ToString();
                    }
                    else
                    {
                        ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString());
                    }
                    this.Hy_deptlist.Items.Insert(i, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString()));
                }
                //this.Hy_deptlist.DataSource = dt;
                //this.Hy_deptlist.DataTextField = "hy_deptname";
                //this.Hy_deptlist.DataValueField = "hy_deptid";
                //this.Hy_deptlist.DataBind();
                this.Hy_deptlist.SelectedIndex = 0;
            }
            dt.Clear();
            //后序环节处理人员
            //先得到后续环节处理人集合
            dt_nextflowuser.Clear();
            dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
            if (dt_nextflowuser.Rows.Count > 0)
            {
                string ls_temp1 = "";
                for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                {
                    ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                }
                ls_temp1 += ",";
                string sql = "";
                if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                    }
                }
                else
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                    }
                }
                dt = Hyoa_global.GetDataTable_USER(sql);
                if (dt.Rows.Count > 0)
                {
                    ls_temp1 = "";
                    int t = 0;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                        {
                        }
                        else
                        {
                            this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                            t += 1;
                            ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                        }
                    }
                }
            }
            dt.Clear();
            //后序环节传阅人员
            dt = Hyoa_user.Getusersbydeptid(this.Hy_deptlist.SelectedValue.ToString());
            if (dt.Rows.Count > 0)
            {
                this.Hy_rylist.DataSource = dt;
                this.Hy_rylist.DataTextField = "hy_username";
                this.Hy_rylist.DataValueField = "hy_userid";
                this.Hy_rylist.DataBind();
                //this.Hy_rylist.SelectedIndex = 0;
            }
            dt.Clear();
            //-----条件流程的情况 end-----
        }
        else
        {
            //-----非条件流程的情况 start-----
            //根据模块ID得到流程信息
            DataTable dt = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.txtflowid.Text, this.txtcurtacheid.Text);
            if (dt.Rows.Count > 0)
            {
                //给相应的域赋值
                //当前环节
                this.Hy_CurrTacheName_Show.Text = dt.Rows[0]["hy_curtachename"].ToString();
                //后续环节
                this.Hy_nexttachename.DataSource = dt;
                this.Hy_nexttachename.DataTextField = "hy_nexttachename";
                this.Hy_nexttachename.DataValueField = "hy_nexttacheid";
                this.Hy_nexttachename.DataBind();
                this.Hy_nexttachename.SelectedIndex = 0;

                //得到 后续环节的默认环节 对应的 提醒默认值,然后进行赋值
                string ls_temp_tacheid = dt.Rows[0]["hy_nexttacheid"].ToString();
                HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
                DataTable dt_getrddoissendsmsandmsg = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.txtflowid.Text, ls_temp_tacheid);
                if (dt_getrddoissendsmsandmsg.Rows.Count > 0)
                {
                    if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendSms"].ToString() == "是")
                        this.f_isSendsms_clr.Checked = true;

                    if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendMessage"].ToString() == "是")
                        this.f_isSendjstx_clr.Checked = true;

                    if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendSms"].ToString() == "是")
                        this.f_isSendsms_cyr.Checked = true;

                    if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendMessage"].ToString() == "是")
                        this.f_isSendjstx_cyr.Checked = true;

                    this.txthy_ifshowcurcomp.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurcomp"].ToString();
                    this.txthy_ifshowcurdept.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurdept"].ToString();
                }
            }
            dt.Clear();
            //后序环节处理人部门
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            //先得到后续环节处理人集合
            DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
            if (dt_nextflowuser.Rows.Count > 0)
            {
                string ls_temp1 = "";
                for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                {
                    ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                }
                ls_temp1 += ",";
                string sql = "";
                if (Session["conntype"].ToString() == "SQL")
                {
                    sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                }
                if (Session["conntype"].ToString() == "ORACLE")
                {
                    sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                }
                dt = Hyoa_global.GetDataTable_USER(sql);

                if (dt.Rows.Count > 0)
                {
                    this.Hy_deptlist_clr.Items.Insert(0, "--请选择--");
                    ls_temp1 = "";
                    int t = 1;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_deptid"].ToString() + ","))
                        {
                        }
                        else
                        {
                            //解决多级部门后续提交时部门显示的问题  added by xf 20131226
                            string ls_deptname = "";
                            if (dt.Rows[i]["hy_deptid"].ToString().Length == 3)
                            {
                                ls_deptname = dt.Rows[i]["hy_deptname"].ToString();
                            }
                            else
                            {
                                ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString());
                            }
                            this.Hy_deptlist_clr.Items.Insert(t, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString()));
                            t += 1;
                            ls_temp1 += "," + dt.Rows[i]["hy_deptid"].ToString();
                        }
                    }
                    this.Hy_deptlist_clr.SelectedIndex = 0;
                }
            }
            dt.Clear();
            //后序环节传阅人部门
            HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
            dt = Hyoa_dept.Getdepts();
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //解决多级部门后续提交时部门显示的问题  added by xf 20131226
                    string ls_deptname = "";
                    if (dt.Rows[i]["hy_deptid"].ToString().Length == 3)
                    {
                        ls_deptname = dt.Rows[i]["hy_deptname"].ToString();
                    }
                    else
                    {
                        ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString());
                    }
                    this.Hy_deptlist.Items.Insert(i, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString()));
                }
                //this.Hy_deptlist.DataSource = dt;
                //this.Hy_deptlist.DataTextField = "hy_deptname";
                //this.Hy_deptlist.DataValueField = "hy_deptid";
                //this.Hy_deptlist.DataBind();
                this.Hy_deptlist.SelectedIndex = 0;
            }
            dt.Clear();
            //后序环节处理人员
            //先得到后续环节处理人集合
            dt_nextflowuser.Clear();
            dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
            if (dt_nextflowuser.Rows.Count > 0)
            {
                string ls_temp1 = "";
                for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                {
                    ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                }
                ls_temp1 += ",";
                string sql="";
                if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                    }
                }
                else
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                    }
                }
                dt = Hyoa_global.GetDataTable_USER(sql);
                if (dt.Rows.Count > 0)
                {
                    ls_temp1 = "";
                    int t = 0;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                        {
                        }
                        else
                        {
                            this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                            t += 1;
                            ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                        }
                    }
                }
            }
            dt.Clear();
            //后序环节传阅人员
            dt = Hyoa_user.Getusersbydeptid(this.Hy_deptlist.SelectedValue.ToString());
            if (dt.Rows.Count > 0)
            {
                this.Hy_rylist.DataSource = dt;
                this.Hy_rylist.DataTextField = "hy_username";
                this.Hy_rylist.DataValueField = "hy_userid";
                this.Hy_rylist.DataBind();
                //this.Hy_rylist.SelectedIndex = 0;
            }
            dt.Clear();
            //-----非条件流程的情况 end-----
        }

        //----考虑只显示本单位的情况start-----
        if (this.txthy_ifshowcurcomp.Text == "是")
        {
            DataTable tempTable = new DataTable();
            DataColumn col  = new DataColumn("value1", typeof(String)); //定义新的一列
            tempTable.Columns.Add(col);  //追加一列  add
            DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
            tempTable.Columns.Add(col2);  //追加一列  add

            //更新部门
            for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
            {
                string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                ls_dept1 = ls_dept1.Substring(0, 3);
                string ls_curdept = Session["hydeptid"].ToString();
                ls_curdept = ls_curdept.Substring(0, 3);

                if (ls_dept1 == ls_curdept)
                {
                    DataRow dr = tempTable.NewRow();
                    dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                    dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                    tempTable.Rows.Add(dr);
                }
            }
            //先清空
            this.Hy_deptlist_clr.Items.Clear();

            this.Hy_deptlist_clr.DataSource = tempTable;
            this.Hy_deptlist_clr.DataTextField = "value1";
            this.Hy_deptlist_clr.DataValueField = "value2";
            this.Hy_deptlist_clr.DataBind();

            this.Hy_hjclr.Items.Clear();

            //在调用这个部门对应的人员
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
            if (dt_nextflowuser.Rows.Count > 0)
            {
                string ls_temp1 = "";
                for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                {
                    ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                }
                ls_temp1 += ",";
                string sql = "";
                if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                    }
                }
                else
                {
                    if (Session["conntype"].ToString() == "SQL")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                    }
                    if (Session["conntype"].ToString() == "ORACLE")
                    {
                        sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                    }
                }
                DataTable dt = Hyoa_global.GetDataTable_USER(sql);
                if (dt.Rows.Count > 0)
                {
                    ls_temp1 = "";
                    int t = 0;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                        {
                        }
                        else
                        {
                            this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                            t += 1;
                            ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                        }
                    }
                }
                dt.Clear();
            }
        }
        //----考虑只显示本单位的情况end-------

        //----考虑只显示和登记人同单位的情况start-----
        if (this.txthy_ifshowcurcomp.Text == "和登记人同单位")
        {
            if (Request.QueryString["docid"] != null)
            {
                //得到登记人的部门ID
                string ls_djrbmid = "";
                string sql = "select * from hyc_" + this.txttableid.Text+" where DOCID='" + Request.QueryString["docid"].ToString()+"'";
                DataTable dt_flowmain = Hyoa_global.GetDataTable(sql);
                if (dt_flowmain.Rows.Count > 0)
                {
                    ls_djrbmid = dt_flowmain.Rows[0]["hy_djrbmid"].ToString();
                    DataTable tempTable = new DataTable();
                    DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列
                    tempTable.Columns.Add(col);  //追加一列  add
                    DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
                    tempTable.Columns.Add(col2);  //追加一列  add

                    //更新部门
                    for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
                    {
                        string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                        if (ls_dept1.Substring(0, 3) == ls_djrbmid.Substring(0, 3))
                        {
                            DataRow dr = tempTable.NewRow();
                            dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                            dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                            tempTable.Rows.Add(dr);
                        }
                    }
                    //先清空
                    this.Hy_deptlist_clr.Items.Clear();

                    this.Hy_deptlist_clr.DataSource = tempTable;
                    this.Hy_deptlist_clr.DataTextField = "value1";
                    this.Hy_deptlist_clr.DataValueField = "value2";
                    this.Hy_deptlist_clr.DataBind();

                    this.Hy_hjclr.Items.Clear();

                    //在调用这个部门对应的人员
                    HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
                    DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
                    if (dt_nextflowuser.Rows.Count > 0)
                    {
                        string ls_temp1 = "";
                        for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                        {
                            ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                        }
                        ls_temp1 += ",";
                        if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                            }
                        }
                        else
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                            }
                        }
                        DataTable dt = Hyoa_global.GetDataTable_USER(sql);
                        if (dt.Rows.Count > 0)
                        {
                            ls_temp1 = "";
                            int t = 0;
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                                {
                                }
                                else
                                {
                                    this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                                    t += 1;
                                    ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                                }
                            }
                        }
                        dt.Clear();
                    }
                }
            }
        }
        //----考虑只显示和登记人同单位的情况end-------

        //----考虑只显示登记人的分管领导的情况start-----
        if (this.txthy_ifshowcurcomp.Text == "登记人的分管领导")
        {
            if (Request.QueryString["docid"] != null)
            {
                //得到登记人的部门ID
                string ls_djrbmid = "";
                string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'";
                DataTable dt_flowmain = Hyoa_global.GetDataTable(sql);
                if (dt_flowmain.Rows.Count > 0)
                {
                    ls_djrbmid = dt_flowmain.Rows[0]["hy_djrbmid"].ToString();
                    DataTable tempTable = new DataTable();
                    DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列
                    tempTable.Columns.Add(col);  //追加一列  add
                    DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
                    tempTable.Columns.Add(col2);  //追加一列  add

                    //更新部门(登记人的分管领导(部门ID前3位不一样后边一样))
                    for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
                    {
                        string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                        if (ls_dept1.Substring(3) == ls_djrbmid.Substring(3))
                        {
                            DataRow dr = tempTable.NewRow();
                            dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                            dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                            tempTable.Rows.Add(dr);
                        }
                    }
                    //先清空
                    this.Hy_deptlist_clr.Items.Clear();

                    this.Hy_deptlist_clr.DataSource = tempTable;
                    this.Hy_deptlist_clr.DataTextField = "value1";
                    this.Hy_deptlist_clr.DataValueField = "value2";
                    this.Hy_deptlist_clr.DataBind();

                    this.Hy_hjclr.Items.Clear();

                    //在调用这个部门对应的人员
                    HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
                    DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
                    if (dt_nextflowuser.Rows.Count > 0)
                    {
                        string ls_temp1 = "";
                        for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                        {
                            ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                        }
                        ls_temp1 += ",";
                        if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                            }
                        }
                        else
                        {
                            if (Session["conntype"].ToString() == "SQL")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                            }
                            if (Session["conntype"].ToString() == "ORACLE")
                            {
                                sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                            }
                        }
                        DataTable dt = Hyoa_global.GetDataTable_USER(sql);
                        if (dt.Rows.Count > 0)
                        {
                            ls_temp1 = "";
                            int t = 0;
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                                {
                                }
                                else
                                {
                                    this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                                    t += 1;
                                    ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                                }
                            }
                        }
                        dt.Clear();
                    }
                }
            }
        }
        //----考虑只显示登记人的分管领导的情况end-------

        //----只显示登记人start-----
        if (this.txthy_ifshowcurdept.Text == "只显示登记人")
        {
            if (Request.QueryString["docid"] != null)
            {
                string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'";
                DataTable dt_flowmain = Hyoa_global.GetDataTable(sql);
                if (dt_flowmain.Rows.Count > 0)
                {
                    //先清空
                    this.Hy_deptlist_clr.Items.Clear();
                    Hy_deptlist_clr.Items.Insert(0, new ListItem(dt_flowmain.Rows[0]["hy_djrbmname"].ToString(), dt_flowmain.Rows[0]["hy_djrbmid"].ToString()));

                    //先清空
                    this.Hy_hjclr.Items.Clear();
                    Hy_hjclr.Items.Insert(0, new ListItem(dt_flowmain.Rows[0]["hy_djrname"].ToString(), dt_flowmain.Rows[0]["hy_djrid"].ToString()));
                }
            }
        }
        //----只显示登记人end-------

        //----只显示当前用户本部门人员start-----
        if (this.txthy_ifshowcurdept.Text == "是")
        {
            if (Request.QueryString["docid"] != null)
            {
                DataTable tempTable = new DataTable();
                DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列
                tempTable.Columns.Add(col);  //追加一列  add
                DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
                tempTable.Columns.Add(col2);  //追加一列  add

                //更新部门
                for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
                {
                    string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                    if (ls_dept1 == Session["hydeptid"].ToString())
                    {
                        DataRow dr = tempTable.NewRow();
                        dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                        dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                        tempTable.Rows.Add(dr);
                    }
                }
                //先清空
                this.Hy_deptlist_clr.Items.Clear();

                this.Hy_deptlist_clr.DataSource = tempTable;
                this.Hy_deptlist_clr.DataTextField = "value1";
                this.Hy_deptlist_clr.DataValueField = "value2";
                this.Hy_deptlist_clr.DataBind();

                this.Hy_hjclr.Items.Clear();

                //在调用这个部门对应的人员
                HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
                DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
                if (dt_nextflowuser.Rows.Count > 0)
                {
                    string ls_temp1 = "";
                    for (int i = 0; i < dt_nextflowuser.Rows.Count; i++)
                    {
                        ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString();
                    }
                    ls_temp1 += ",";
                    string sql = "";
                    if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--")
                    {
                        if (Session["conntype"].ToString() == "SQL")
                        {
                            sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort";
                        }
                        if (Session["conntype"].ToString() == "ORACLE")
                        {
                            sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort";
                        }
                    }
                    else
                    {
                        if (Session["conntype"].ToString() == "SQL")
                        {
                            sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                        }
                        if (Session["conntype"].ToString() == "ORACLE")
                        {
                            sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort";
                        }
                    }
                    DataTable dt = Hyoa_global.GetDataTable_USER(sql);
                    if (dt.Rows.Count > 0)
                    {
                        ls_temp1 = "";
                        int t = 0;
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                            {
                            }
                            else
                            {
                                this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString()));
                                t += 1;
                                ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                            }
                        }
                    }
                    dt.Clear();
                }
            }
        }
        //----只显示当前用户本部门人员end-------

        //----自动传阅 start------------
        DataTable dt_zdcy = Hyoa_flowwork.Getflowworkbyflowidtacheidnexttacheid(this.txtflowid.Text, this.txtcurtacheid.Text, this.Hy_nexttachename.SelectedValue);
        if (dt_zdcy.Rows.Count > 0)
        {
            if (dt_zdcy.Rows[0]["hy_zdcyuserids"] != null)
            {
                if (dt_zdcy.Rows[0]["hy_zdcyuserids"].ToString() != "")
                {
            int ii=0;
                    //自动加载
                    string[] lv_zdcyuserids = dt_zdcy.Rows[0]["hy_zdcyuserids"].ToString().Split(',');
                    for (int i = 0; i < lv_zdcyuserids.Length; i++)
                    {
                        //根据系统名得到中文名
                        DataTable dt_user = Hyoa_user.Getuserallinfobyloginid(lv_zdcyuserids[i]);
                        if (dt_user.Rows.Count > 0)
                        {
                            this.Hy_selectedcyr.Items.Insert(ii, new ListItem(dt_user.Rows[0]["hy_username"].ToString(), lv_zdcyuserids[i]));
                ii = ii + 1;
                        }
                    }
                }
            }
        }
        //----自动传阅 end------------
    }
Exemplo n.º 21
0
    private void DataPlay()
    {
        //文档ID
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (this.Request.QueryString["flowid"] != null)
        {
            this.txtflowid.Text = this.Request.QueryString["flowid"].ToString();
        }
        if (this.Request.QueryString["tacheid"] != null)
        {
           this.txtcurtacheid.Text = this.Request.QueryString["tacheid"].ToString();
        }
        //根据模块ID得到流程信息
        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
        DataTable dt = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.txtflowid.Text, this.txtcurtacheid.Text);

        if (dt.Rows.Count > 0)
        {
            //给相应的域赋值
            //当前环节
            this.Hy_CurrTacheName_Show.Text = dt.Rows[0]["hy_curtachename"].ToString();
            //后续环节
            this.Hy_nexttachename.DataSource = dt;
            this.Hy_nexttachename.DataTextField = "hy_nexttachename";
            this.Hy_nexttachename.DataValueField = "hy_nexttacheid";
            this.Hy_nexttachename.DataBind();
            this.Hy_nexttachename.SelectedIndex = 0;

            //得到 后续环节的默认环节 对应的 提醒默认值,然后进行赋值
            string ls_temp_tacheid = dt.Rows[0]["hy_nexttacheid"].ToString();
            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
            DataTable dt_getrddoissendsmsandmsg = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.txtflowid.Text, ls_temp_tacheid);
            if (dt_getrddoissendsmsandmsg.Rows.Count > 0)
            {
                if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendSms"].ToString() == "是")
                    this.f_isSendsms_clr.Checked = true;

                if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendMessage"].ToString() == "是")
                    this.f_isSendjstx_clr.Checked = true;

                if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendSms"].ToString() == "是")
                    this.f_isSendsms_cyr.Checked = true;

                if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendMessage"].ToString() == "是")
                    this.f_isSendjstx_cyr.Checked = true;

                this.txthy_ifshowcurdept.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurdept"].ToString();
            }
        }
        dt.Clear();
        //后序环节处理人部门
        HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
        dt = Hyoa_flowtacheuser.GetDeptInfobyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString());
        if (dt.Rows.Count > 0)
        {
            this.Hy_deptlist_clr.DataSource = dt;
            this.Hy_deptlist_clr.DataTextField = "hy_deptname";
            this.Hy_deptlist_clr.DataValueField = "hy_deptid";
            this.Hy_deptlist_clr.DataBind();
            this.Hy_deptlist_clr.Items.Insert(0, "--请选择--");
            this.Hy_deptlist_clr.SelectedIndex = 0;
        }
        dt.Clear();
        //后序环节传阅人部门
        HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept();
        dt = Hyoa_dept.Getdepts();
        if (dt.Rows.Count > 0)
        {
            this.Hy_deptlist.DataSource = dt;
            this.Hy_deptlist.DataTextField = "hy_deptname";
            this.Hy_deptlist.DataValueField = "hy_deptid";
            this.Hy_deptlist.DataBind();
            this.Hy_deptlist.SelectedIndex = 0;
        }
        dt.Clear();

        //后序环节处理人员
        dt = Hyoa_flowtacheuser.Getcuruserinfobyflowidtacheiddeptid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString(), this.Hy_deptlist_clr.SelectedValue.ToString ());
        if (dt.Rows.Count > 0)
        {
            this.Hy_hjclr.DataSource = dt;
            this.Hy_hjclr.DataTextField = "hy_username";
            this.Hy_hjclr.DataValueField = "hy_userid";
            this.Hy_hjclr.DataBind();
            //this.Hy_hjclr.SelectedIndex = 0;
        }
        dt.Clear();

        //后序环节传阅人员
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        dt = Hyoa_user.Getusersbydeptid(this.Hy_deptlist.SelectedValue.ToString());
        if (dt.Rows.Count > 0)
        {
            this.Hy_rylist.DataSource = dt;
            this.Hy_rylist.DataTextField = "hy_username";
            this.Hy_rylist.DataValueField = "hy_userid";
            this.Hy_rylist.DataBind();
            //this.Hy_rylist.SelectedIndex = 0;
        }
        dt.Clear();

        //----只显示当前用户本部门人员start-----
        //this.Response.Write("<script>alert('" + this.txthy_ifshowcurdept.Text + "');</script>");
        if (this.txthy_ifshowcurdept.Text == "是")
        {
            HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain();
            if (Request.QueryString["docid"] != null)
            {
                DataTable tempTable = new DataTable();
                DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列
                tempTable.Columns.Add(col);  //追加一列  add
                DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列
                tempTable.Columns.Add(col2);  //追加一列  add

                //更新部门
                for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++)
                {
                    string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value;
                    if (ls_dept1 == Session["hydeptid"].ToString())
                    {
                        DataRow dr = tempTable.NewRow();
                        dr["value1"] = Hy_deptlist_clr.Items[j].Text;
                        dr["value2"] = Hy_deptlist_clr.Items[j].Value;
                        tempTable.Rows.Add(dr);
                    }
                }

                //先清空
                this.Hy_deptlist_clr.Items.Clear();
                this.Hy_hjclr.Items.Clear();
                if (tempTable.Rows.Count > 0)
                {
                    this.Hy_deptlist_clr.DataSource = tempTable;
                    this.Hy_deptlist_clr.DataTextField = "value1";
                    this.Hy_deptlist_clr.DataValueField = "value2";
                    this.Hy_deptlist_clr.DataBind();

                    //在调用这个部门对应的人员
                    //HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
                    dt = Hyoa_flowtacheuser.Getcuruserinfobyflowidtacheiddeptid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString(), this.Hy_deptlist_clr.SelectedValue.ToString());
                    if (dt.Rows.Count > 0)
                    {
                        this.Hy_hjclr.DataSource = dt;
                        this.Hy_hjclr.DataTextField = "hy_username";
                        this.Hy_hjclr.DataValueField = "hy_userid";
                        this.Hy_hjclr.DataBind();
                    }
                }
            }
        }
        //----只显示当前用户本部门人员end-------
    }