Пример #1
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-------
    }
Пример #2
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-------
    }