Exemplo n.º 1
0
    protected void btndelinfo_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
        HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
        HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();

        String[] v_uids = this.txtuids.Value.Split(',');
        for (var i = 0; i < v_uids.Length; i++)
        {
            if (v_uids[i] != "")
            {
                //删除流程信息
                Hyoa_flowinfor.hy_flowid = v_uids[i];
                Hyoa_flowinfor.Delete();
                //删除环节信息
                Hyoa_flowtache.DeleteByflowid(v_uids[i]);
                //删除流转信息
                Hyoa_flowwork.DeleteAllbyflowid(v_uids[i]);
                //删除流程对应的域
                Hyoa_flowfield.DeleteAllbyflowid(v_uids[i]);
                //删除流程环节对应的域
                Hyoa_flowtachefield.DeleteAllbyflowid(v_uids[i]);
                //删除流程环节对应的用户
                Hyoa_flowtacheuser.DeleteAllbyflowid(v_uids[i]);
            }
        }
        this.txtuids.Value = "";
        //DataPlay(1);
        DataPlay(System.Int32.Parse(this.curpage.Text));
    }
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_roleuser Hyoa_roleuser = new HyoaClass.Hyoa_roleuser();
        ////---增加模块权限-------
        if (this.fdAddRoleid.Value != "")
        {
            string[] v_AddRoleid = this.fdAddRoleid.Value.Split(',');
            for (var i = 0; i < v_AddRoleid.Length; i++)
            {
                Hyoa_roleuser.ID = Hyoa_global.GetRandom();
                Hyoa_roleuser.hy_roleid = v_AddRoleid[i].ToString();
                Hyoa_roleuser.hy_userid = this.txtuserid.Value;
                Hyoa_roleuser.Insert();
            }
        }
        ////---删除模块权限-------
        if (this.fdDelRoleid.Value != "")
        {
            string[] v_DelRoleid = this.fdDelRoleid.Value.Split(',');
            for (var i = 0; i < v_DelRoleid.Length; i++)
            {
                Hyoa_roleuser.Deletebyroleidanduserid(v_DelRoleid[i].ToString(), this.txtuserid.Value);
            }
        }
        HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
        ////---增加流程权限-------
        if (this.fdAddFlowTacheid.Value != "")
        {
            string[] v_AddFlowTacheid = this.fdAddFlowTacheid.Value.Split(',');
            for (var i = 0; i < v_AddFlowTacheid.Length; i++)
            {
                Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                Hyoa_flowtacheuser.hy_flowid = v_AddFlowTacheid[i].ToString().Substring(0,v_AddFlowTacheid[i].ToString().IndexOf('^'));
                Hyoa_flowtacheuser.hy_tacheid = v_AddFlowTacheid[i].ToString().Substring(v_AddFlowTacheid[i].ToString().IndexOf('^')+1, (v_AddFlowTacheid[i].ToString().Length - v_AddFlowTacheid[i].ToString().IndexOf('^')-1));
                Hyoa_flowtacheuser.hy_userid = this.txtuserid.Value;
                Hyoa_flowtacheuser.Insert();
            }
        }
        //---删除流程权限-------
        if (this.fdDelFlowTacheid.Value != "")
        {
            string[] v_DelFlowTacheid = this.fdDelFlowTacheid.Value.Split(',');
            string ls_flowid;
            string ls_tacheid;
            for (var i = 0; i < v_DelFlowTacheid.Length; i++)
            {
                ls_flowid = v_DelFlowTacheid[i].ToString().Substring(0, v_DelFlowTacheid[i].ToString().IndexOf('^'));
                ls_tacheid = v_DelFlowTacheid[i].ToString().Substring(v_DelFlowTacheid[i].ToString().IndexOf('^') + 1, (v_DelFlowTacheid[i].ToString().Length - v_DelFlowTacheid[i].ToString().IndexOf('^') - 1));
                Hyoa_flowtacheuser.Deletebyroleidtacheiduserid(ls_flowid, ls_tacheid, this.txtuserid.Value);
            }
        }

        Response.Write("<script>alert('保存成功!');self.close();</script>");
    }
Exemplo n.º 3
0
    //流程权限列表
    protected string fflowtacherole()
    {
        string ls_return = "";
        string ls_userid = "";
        string ls_flowtaches = "";
        if (this.Request.QueryString["userid"] != null)
        {
            ls_userid = this.Request.QueryString["userid"].ToString();
            //得到已有的流程权限
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            DataTable dtflowtacheuser = Hyoa_flowtacheuser.Getflowtachesbyuserid(ls_userid);
            if (dtflowtacheuser.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowtacheuser.Rows.Count; i++)
                {
                    ls_flowtaches += "," + dtflowtacheuser.Rows[i]["hy_flowid"].ToString() + "_" + dtflowtacheuser.Rows[i]["hy_tacheid"].ToString();
                }
                this.fdHaveFlowTacheid.Value = ls_flowtaches + ",";
            }

            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
            DataTable dt = Hyoa_flowtache.Getflowtachesorderbyflowidandsort();
            //加载
            if (dt.Rows.Count > 0)
            {
                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    if (ls_flowtaches == "")
                    {
                        ls_return += "<td width=\"25%\"><input type=\"checkbox\" name=\"fFlowTacheName\" value=\"" + dt.Rows[i]["hy_flowid"].ToString() + "_" + dt.Rows[i]["hy_tacheid"].ToString() + "\">" + dt.Rows[i]["hy_flowname"].ToString() + "_" + dt.Rows[i]["hy_tachename"].ToString() + "</td>";
                    }
                    else
                    {
                        if (ls_flowtaches.Contains(dt.Rows[i]["hy_flowid"].ToString() + "_" + dt.Rows[i]["hy_tacheid"].ToString()))
                        {
                            ls_return += "<td width=\"25%\"><input type=\"checkbox\" checked=\"checked\" name=\"fFlowTacheName\" value=\"" + dt.Rows[i]["hy_flowid"].ToString() + "_" + dt.Rows[i]["hy_tacheid"].ToString() + "\">" + dt.Rows[i]["hy_flowname"].ToString() + "_" + dt.Rows[i]["hy_tachename"].ToString() + "</td>";
                        }
                        else
                        {
                            ls_return += "<td width=\"25%\"><input type=\"checkbox\" name=\"fFlowTacheName\" value=\"" + dt.Rows[i]["hy_flowid"].ToString() + "_" + dt.Rows[i]["hy_tacheid"].ToString() + "\">" + dt.Rows[i]["hy_flowname"].ToString() + "_" + dt.Rows[i]["hy_tachename"].ToString() + "</td>";
                        }
                    }

                    if (((i + 1) % 4) == 0 && i < dt.Rows.Count)
                        ls_return += "</tr><tr>";

                }
            }
            dtflowtacheuser.Clear();
            dt.Clear();
        }
        return ls_return;
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     string ls_value = "";
     //后续处理人
     HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
     HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
     DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(Request.QueryString["flowid"].ToString(), Request.QueryString["tacheid"].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_tj = "";
         if (Session["conntype"].ToString() == "SQL")
         {
             sql_tj = "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_tj = "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";
         }
         DataTable dt2 = Hyoa_global.GetDataTable_USER(sql_tj);
         if (dt2.Rows.Count > 0)
         {
             ls_temp1 = "";
             int t = 0;
             for (int i = 0; i < dt2.Rows.Count; i++)
             {
                 if ((ls_temp1 + ",").Contains("," + dt2.Rows[i]["hy_userid"].ToString() + ","))
                 {
                 }
                 else
                 {
                     if (ls_value == "")
                     {
                         ls_value = dt2.Rows[i]["hy_userid"].ToString() + "+" + dt2.Rows[i]["hy_username"].ToString();
                     }
                     else
                     {
                         ls_value += "," + dt2.Rows[i]["hy_userid"].ToString() + "+" + dt2.Rows[i]["hy_username"].ToString();
                     }
                     t += 1;
                     ls_temp1 += "," + dt2.Rows[i]["hy_userid"].ToString();
                 }
             }
         }
     }
     Response.Write(ls_value);
 }
Exemplo n.º 5
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.º 6
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.º 7
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "复制成功!";

        try
        {
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            HyoaClass.Hyoa_role Hyoa_role = new HyoaClass.Hyoa_role();
            HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
            HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
            HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
            HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield();
            HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
            HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
            HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
            #region 生成权限
            DataTable dt = Hyoa_role.Getrole("Role" + this.txtmudelid.Text);
            if (dt.Rows.Count > 0)
            {
                Response.Write("<script>alert('该权限编号已存在,请重新填写!');history.back();</script>");
                return;
            }
            else
            {
                Hyoa_role.hy_roleid = "Role" + this.txtmudelid.Text;
                Hyoa_role.hy_rolename = this.txtmudelname.Text;
                Hyoa_role.hy_sort = System.Int32.Parse(this.txtno.Value);
                Hyoa_role.Insert();
            }
            #endregion

            #region 生成模块
            dt = Hyoa_mudel.Getmudel("Mudel" + this.txtmudelid.Text);
            if (dt.Rows.Count > 0)
            {
                Response.Write("<script>alert('该模块编号已存在,请重新填写!');history.back();</script>");
                return;
            }
            else
            {
                Hyoa_mudel.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                Hyoa_mudel.hy_mudelname = this.txtmudelname.Text;
                Hyoa_mudel.hy_sort = System.Int32.Parse(this.txtno.Value);
                Hyoa_mudel.hy_isenabled = "是";
                Hyoa_mudel.hy_roleid = "Role" + this.txtmudelid.Text;
                Hyoa_mudel.hy_qqroleid = "Role" + this.txtmudelid.Text;
                Hyoa_mudel.Insert();
            }
            #endregion

            #region 生成表单
            DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.ddlmudelid.SelectedValue);
            if (tableconfigdt.Rows.Count > 0)
            {
                Hyoa_tableconfig.ID = "Table" + this.txtmudelid.Text;
                Hyoa_tableconfig.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                Hyoa_tableconfig.hy_name = this.txtmudelname.Text;
                Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString();
                Hyoa_tableconfig.hy_sort = float.Parse(this.txtno.Value);
                Hyoa_tableconfig.hy_ifflowdoc = tableconfigdt.Rows[0]["hy_ifflowdoc"].ToString();
                Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString();
                Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString();
                Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString();
                Hyoa_tableconfig.hy_ifcomment = tableconfigdt.Rows[0]["hy_ifcomment"].ToString();
                Hyoa_tableconfig.hy_colnum = float.Parse(tableconfigdt.Rows[0]["hy_colnum"].ToString());
                Hyoa_tableconfig.hy_field1 = tableconfigdt.Rows[0]["hy_field1"].ToString();
                Hyoa_tableconfig.hy_field2 = tableconfigdt.Rows[0]["hy_field2"].ToString();
                Hyoa_tableconfig.hy_field3 = tableconfigdt.Rows[0]["hy_field3"].ToString();
                Hyoa_tableconfig.hy_field4 = tableconfigdt.Rows[0]["hy_field4"].ToString();
                Hyoa_tableconfig.hy_field5 = tableconfigdt.Rows[0]["hy_field5"].ToString();
                Hyoa_tableconfig.Insert();
            }
            #endregion

            #region 生成表单字段
            int i;
            DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.ddltableid.SelectedValue);
            if (flowfielddt.Rows.Count > 0)
            {
                for (i = 0; i < flowfielddt.Rows.Count; i++)
                {
                    Hyoa_flowfield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowfield.hy_tableid = "Table" + this.txtmudelid.Text;
                    Hyoa_flowfield.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                    Hyoa_flowfield.hy_flowid = "Flow" + this.txtmudelid.Text;
                    Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString();
                    Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString();
                    Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString();
                    Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString());
                    Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString();
                    Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString());
                    Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString();
                    Hyoa_flowfield.hy_onclick = flowfielddt.Rows[i]["hy_onclick"].ToString();
                    Hyoa_flowfield.hy_ondblclick = flowfielddt.Rows[i]["hy_ondblclick"].ToString();
                    Hyoa_flowfield.hy_onchange = flowfielddt.Rows[i]["hy_onchange"].ToString();
                    Hyoa_flowfield.hy_onkeydown = flowfielddt.Rows[i]["hy_onkeydown"].ToString();
                    Hyoa_flowfield.hy_onkeyup = flowfielddt.Rows[i]["hy_onkeyup"].ToString();
                    Hyoa_flowfield.hy_onfocus = flowfielddt.Rows[i]["hy_onfocus"].ToString();
                    Hyoa_flowfield.hy_onblur = flowfielddt.Rows[i]["hy_onblur"].ToString();
                    Hyoa_flowfield.hy_sqlfield = flowfielddt.Rows[i]["hy_sqlfield"].ToString();
                    Hyoa_flowfield.hy_class = flowfielddt.Rows[i]["hy_class"].ToString();
                    Hyoa_flowfield.hy_width = flowfielddt.Rows[i]["hy_width"].ToString();
                    Hyoa_flowfield.hy_height = flowfielddt.Rows[i]["hy_height"].ToString();
                    Hyoa_flowfield.hy_tdnums = System.Int32.Parse(flowfielddt.Rows[i]["hy_tdnums"].ToString());
                    Hyoa_flowfield.hy_config = flowfielddt.Rows[i]["hy_config"].ToString();
                    Hyoa_flowfield.hy_sort = float.Parse(flowfielddt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowfield.hy_wordlimit = System.Int32.Parse(flowfielddt.Rows[i]["hy_wordlimit"].ToString());
                    Hyoa_flowfield.hy_required = flowfielddt.Rows[i]["hy_required"].ToString();
                    Hyoa_flowfield.hy_align = flowfielddt.Rows[i]["hy_align"].ToString();
                    Hyoa_flowfield.hy_ifhiddle = flowfielddt.Rows[i]["hy_ifhiddle"].ToString();
                    Hyoa_flowfield.hy_ifdbsybt = flowfielddt.Rows[i]["hy_ifdbsybt"].ToString();
                    Hyoa_flowfield.hy_field1 = flowfielddt.Rows[i]["hy_field1"].ToString();
                    Hyoa_flowfield.hy_field2 = flowfielddt.Rows[i]["hy_field2"].ToString();
                    Hyoa_flowfield.hy_field3 = flowfielddt.Rows[i]["hy_field3"].ToString();
                    Hyoa_flowfield.hy_field4 = flowfielddt.Rows[i]["hy_field4"].ToString();
                    Hyoa_flowfield.hy_field5 = flowfielddt.Rows[i]["hy_field5"].ToString();
                    Hyoa_flowfield.Insert();
                }
            }
            #endregion

            #region 生成SQL/ORACLE中的表
            string sql = "";
            if (Session["conntype"].ToString() == "SQL")
            {
                sql = "select * into hyc_Table" + this.txtmudelid.Text + " from hyc_" + this.ddltableid.SelectedValue + " where 1=0";
            }
            if (Session["conntype"].ToString() == "ORACLE")
            {
                sql = "create table hyc_Table" + this.txtmudelid.Text + " as select * from hyc_" + this.ddltableid.SelectedValue + " where 1=2";
            }
            Hyoa_global.ExcuteSQL(sql);
            #endregion

            #region 生成列表
            DataTable listconfigdt = Hyoa_listconfig.GetlistconfigsbyMudelidAndTableid(this.ddlmudelid.SelectedValue, this.ddltableid.SelectedValue);
            //列表ID
            string strListId = Hyoa_global.GetRandom();
            if (listconfigdt.Rows.Count > 0)
            {
                Hyoa_listconfig.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                Hyoa_listconfig.hy_tableid = "Table" + this.txtmudelid.Text;
                Hyoa_listconfig.hy_ifflowdoc = listconfigdt.Rows[0]["hy_ifflowdoc"].ToString();
                Hyoa_listconfig.hy_sort = System.Int32.Parse(this.txtno.Value);
                Hyoa_listconfig.hy_columnshowid = listconfigdt.Rows[0]["hy_columnshowid"].ToString();
                Hyoa_listconfig.hy_columnshow = listconfigdt.Rows[0]["hy_columnshow"].ToString();
                Hyoa_listconfig.hy_ifsearch = listconfigdt.Rows[0]["hy_ifsearch"].ToString();
                Hyoa_listconfig.hy_ifshowsearch = listconfigdt.Rows[0]["hy_ifshowsearch"].ToString();
                Hyoa_listconfig.hy_width = listconfigdt.Rows[0]["hy_width"].ToString();
                Hyoa_listconfig.hy_listname = this.txtmudelname.Text;
                Hyoa_listconfig.hy_sortfield1 = listconfigdt.Rows[0]["hy_sortfield1"].ToString();
                Hyoa_listconfig.hy_sorttype1 = listconfigdt.Rows[0]["hy_sorttype1"].ToString();
                Hyoa_listconfig.hy_sortfield2 = listconfigdt.Rows[0]["hy_sortfield2"].ToString();
                Hyoa_listconfig.hy_sorttype2 = listconfigdt.Rows[0]["hy_sorttype2"].ToString();
                Hyoa_listconfig.hy_sortfield3 = listconfigdt.Rows[0]["hy_sortfield3"].ToString();
                Hyoa_listconfig.hy_sorttype3 = listconfigdt.Rows[0]["hy_sorttype3"].ToString();
                Hyoa_listconfig.hy_fieldid_fl1 = listconfigdt.Rows[0]["hy_fieldid_fl1"].ToString();
                Hyoa_listconfig.hy_fieldname_fl1 = listconfigdt.Rows[0]["hy_fieldname_fl1"].ToString();
                Hyoa_listconfig.hy_sql_fl1 = listconfigdt.Rows[0]["hy_sql_fl1"].ToString();
                Hyoa_listconfig.hy_fieldid_fl2 = listconfigdt.Rows[0]["hy_fieldid_fl2"].ToString();
                Hyoa_listconfig.hy_fieldname_fl2 = listconfigdt.Rows[0]["hy_fieldname_fl2"].ToString();
                Hyoa_listconfig.hy_sql_fl2 = listconfigdt.Rows[0]["hy_sql_fl2"].ToString();
                Hyoa_listconfig.hy_fieldid_fl3 = listconfigdt.Rows[0]["hy_fieldid_fl3"].ToString();
                Hyoa_listconfig.hy_fieldname_fl3 = listconfigdt.Rows[0]["hy_fieldname_fl3"].ToString();
                Hyoa_listconfig.hy_sql_fl3 = listconfigdt.Rows[0]["hy_sql_fl3"].ToString();
                Hyoa_listconfig.ID = strListId;
                Hyoa_listconfig.Insert();
            }
            #endregion

            #region 生成列表查询条件
            DataTable listsearchdt = Hyoa_listsearchfield.GetlistsearchfieldsbyMudelidAndTableid(this.ddlmudelid.SelectedValue, this.ddltableid.SelectedValue);
            for (int m = 0; m < listsearchdt.Rows.Count; m++)
            {
                Hyoa_listsearchfield.ID = Hyoa_global.GetRandom();
                Hyoa_listsearchfield.hy_listid = strListId;
                Hyoa_listsearchfield.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                Hyoa_listsearchfield.hy_tableid = "Table" + this.txtmudelid.Text;
                Hyoa_listsearchfield.hy_field = listsearchdt.Rows[m]["hy_field"].ToString();
                Hyoa_listsearchfield.hy_fieldid = listsearchdt.Rows[m]["hy_fieldid"].ToString();
                Hyoa_listsearchfield.hy_sort = m + 2;
                Hyoa_listsearchfield.Insert();
            }
            #endregion

            #region 生成流程信息
            string lssoureceflowid = "";
            if (tableconfigdt.Rows[0]["hy_ifflowdoc"].ToString() == "是")
            {
                DataTable flowinfordt = Hyoa_flowinfor.Getflowinforbymudelid(this.ddlmudelid.SelectedValue);
                if (flowinfordt.Rows.Count > 0)
                {
                    //得到老模块的flowid 后面要用到
                    lssoureceflowid = flowfielddt.Rows[0]["hy_flowid"].ToString();
                    //插入流程信息start
                    Hyoa_flowinfor.hy_flowid = "Flow" + this.txtmudelid.Text;
                    Hyoa_flowinfor.hy_flowname = this.txtmudelname.Text;
                    Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtno.Value);
                    Hyoa_flowinfor.hy_mudelid = "Mudel" + this.txtmudelid.Text;
                    // Hyoa_flowinfor.hy_addbyalluser = flowinfordt.Rows[0]["hy_addbyalluser"].ToString();
                    Hyoa_flowinfor.Insert();
                }
                //插入流程信息end

                //流程环节
                DataTable flowtachedt = Hyoa_flowtache.Getflowtachebyflowid(lssoureceflowid);
                if (flowtachedt.Rows.Count > 0)
                {
                    for (i = 0; i < flowtachedt.Rows.Count; i++)
                    {
                        Hyoa_flowtache.ID = Hyoa_global.GetRandom();
                        Hyoa_flowtache.hy_flowid = "Flow" + this.txtmudelid.Text;
                        Hyoa_flowtache.hy_tacheid = flowtachedt.Rows[i]["hy_tacheid"].ToString();
                        Hyoa_flowtache.hy_tachename = flowtachedt.Rows[i]["hy_tachename"].ToString();
                        Hyoa_flowtache.hy_sort = System.Int32.Parse(flowtachedt.Rows[i]["hy_sort"].ToString());
                        Hyoa_flowtache.hy_ifshowcurcomp = flowtachedt.Rows[i]["hy_ifshowcurcomp"].ToString();
                        Hyoa_flowtache.hy_ifshowcurdept = flowtachedt.Rows[i]["hy_ifshowcurdept"].ToString();
                        Hyoa_flowtache.hy_XValue = flowtachedt.Rows[i]["hy_XValue"].ToString();
                        Hyoa_flowtache.hy_YValue = flowtachedt.Rows[i]["hy_YValue"].ToString();
                        Hyoa_flowtache.hy_rdDoIsSendSms = flowtachedt.Rows[i]["hy_rdDoIsSendSms"].ToString();
                        Hyoa_flowtache.hy_rdDoIsSendMessage = flowtachedt.Rows[i]["hy_rdDoIsSendMessage"].ToString();
                        Hyoa_flowtache.hy_rdPassIsSendSms = flowtachedt.Rows[i]["hy_rdPassIsSendSms"].ToString();
                        Hyoa_flowtache.hy_rdPassIsSendMessage = flowtachedt.Rows[i]["hy_rdPassIsSendMessage"].ToString();
                        Hyoa_flowtache.hy_enablecondition = flowtachedt.Rows[i]["hy_enablecondition"].ToString();
                        Hyoa_flowtache.Insert();
                    }
                }

                //流程环节对应的域
                DataTable flowtachefielddt = Hyoa_flowtachefield.Getflowtachefieldbyflowid(lssoureceflowid);
                if (flowtachefielddt.Rows.Count > 0)
                {
                    for (i = 0; i < flowtachefielddt.Rows.Count; i++)
                    {
                        Hyoa_flowtachefield.ID = Hyoa_global.GetRandom();
                        Hyoa_flowtachefield.hy_flowid = "Flow" + this.txtmudelid.Text;
                        Hyoa_flowtachefield.hy_tacheid = flowtachefielddt.Rows[i]["hy_tacheid"].ToString();
                        Hyoa_flowtachefield.hy_fieldid = flowtachefielddt.Rows[i]["hy_fieldid"].ToString();
                        Hyoa_flowtachefield.Insert();
                    }
                }
                //流程环节对应的用户
                DataTable flowtacheuserdt = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(lssoureceflowid);
                if (flowtacheuserdt.Rows.Count > 0)
                {
                    for (i = 0; i < flowtacheuserdt.Rows.Count; i++)
                    {
                        Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                        Hyoa_flowtacheuser.hy_flowid = "Flow" + this.txtmudelid.Text;
                        Hyoa_flowtacheuser.hy_tacheid = flowtacheuserdt.Rows[i]["hy_tacheid"].ToString();
                        Hyoa_flowtacheuser.hy_userid = flowtacheuserdt.Rows[i]["hy_userid"].ToString();
                        Hyoa_flowtacheuser.Insert();
                    }
                }
                //工作流
                DataTable flowworkdt = Hyoa_flowwork.Getflowworksbyflowid(lssoureceflowid);
                if (flowworkdt.Rows.Count > 0)
                {
                    for (i = 0; i < flowworkdt.Rows.Count; i++)
                    {
                        Hyoa_flowwork.ID = Hyoa_global.GetRandom();
                        Hyoa_flowwork.hy_flowid = "Flow" + this.txtmudelid.Text;
                        Hyoa_flowwork.hy_curtacheid = flowworkdt.Rows[i]["hy_curtacheid"].ToString();
                        Hyoa_flowwork.hy_curtachename = flowworkdt.Rows[i]["hy_curtachename"].ToString();
                        Hyoa_flowwork.hy_nexttacheid = flowworkdt.Rows[i]["hy_nexttacheid"].ToString();
                        Hyoa_flowwork.hy_nexttachename = flowworkdt.Rows[i]["hy_nexttachename"].ToString();
                        Hyoa_flowwork.hy_sort = System.Int32.Parse(flowworkdt.Rows[i]["hy_sort"].ToString());
                        Hyoa_flowwork.hy_actiontype = flowworkdt.Rows[i]["hy_actiontype"].ToString();
                        Hyoa_flowwork.hy_identity_type = flowworkdt.Rows[i]["hy_identity_type"].ToString();
                        Hyoa_flowwork.hy_identity_id = flowworkdt.Rows[i]["hy_identity_id"].ToString();
                        Hyoa_flowwork.hy_jscondition = flowworkdt.Rows[i]["hy_jscondition"].ToString();
                        Hyoa_flowwork.hy_jscondition1 = flowworkdt.Rows[i]["hy_jscondition1"].ToString();
                        Hyoa_flowwork.hy_jscondition2 = flowworkdt.Rows[i]["hy_jscondition2"].ToString();
                        Hyoa_flowwork.hy_zdcyuserids = flowworkdt.Rows[i]["hy_zdcyuserids"].ToString();
                        Hyoa_flowwork.Insert();
                    }
                }

            }
            #endregion
        }
        catch
        {
            ls_tip = "复制失败!";
        }
        finally
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location.href='" + txturl.Text + "';</script>");
        }
    }
    //流程权限列表
    protected string fflowtacherole()
    {
        string ls_return = "";
        string ls_userid = "";
        string ls_flowtaches = "";
        if (this.Request.QueryString["userid"] != null)
        {
            ls_userid = this.Request.QueryString["userid"].ToString();
            //得到已有的流程权限
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            DataTable dtflowtacheuser = Hyoa_flowtacheuser.Getflowtachesbyuserid(ls_userid);
            if (dtflowtacheuser.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowtacheuser.Rows.Count; i++)
                {
                    ls_flowtaches += "," + dtflowtacheuser.Rows[i]["hy_flowid"].ToString() + "^" + dtflowtacheuser.Rows[i]["hy_tacheid"].ToString();
                }
                this.fdHaveFlowTacheid.Value = ls_flowtaches + ",";
            }

            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
            DataTable dt = Hyoa_flowtache.Getflowtachesorderbyflowidandsort();
            //加载
            int j = 0;
            if (dt.Rows.Count > 0)
            {
                string hy_flowname = "";
                for (var i = 0; i < dt.Rows.Count; i++)
                {
                    if (i == 0)
                    {
                        hy_flowname = dt.Rows[i]["hy_flowname"].ToString();
                        ls_return += "<tr><td colspan=\"4\" align=\"center\" style=\"border-bottom:1px solid #cccccc\"><font color=\"red\">" + hy_flowname + "</font></tr><tr>";
                    }
                    if (i > 0 && hy_flowname != dt.Rows[i]["hy_flowname"].ToString())
                    {
                        //先补齐前边没有输出的td
                        int n = 4 - j + 1;
                        for (int m = 0; m < n; m++)
                        {
                            //Response.Write(n + "<br />");
                            ls_return += "<td style=\"border-bottom:1px solid #cccccc\" width=\"25%\"></td>";
                        }
                        hy_flowname = dt.Rows[i]["hy_flowname"].ToString();
                        ls_return += "</tr><tr><td colspan=\"4\" align=\"center\" style=\"border-bottom:1px solid #cccccc\"><font color=\"red\">" + hy_flowname + "</font></tr><tr>";
                        j = 0;
                    }

                    if (ls_flowtaches == "")
                    {
                        ls_return += "<td style=\"border-bottom:1px solid #cccccc\" width=\"25%\"><input type=\"checkbox\" name=\"fFlowTacheName\" value=\"" + dt.Rows[i]["hy_flowid"].ToString() + "^" + dt.Rows[i]["hy_tacheid"].ToString() + "\">" + dt.Rows[i]["hy_flowname"].ToString() + "^" + dt.Rows[i]["hy_tachename"].ToString() + "</td>";
                    }
                    else
                    {
                        if (("," + ls_flowtaches + ",").Contains("," + dt.Rows[i]["hy_flowid"].ToString() + "^" + dt.Rows[i]["hy_tacheid"].ToString() + ","))
                        {
                            ls_return += "<td style=\"border-bottom:1px solid #cccccc\" width=\"25%\"><input type=\"checkbox\" checked=\"checked\" name=\"fFlowTacheName\" value=\"" + dt.Rows[i]["hy_flowid"].ToString() + "^" + dt.Rows[i]["hy_tacheid"].ToString() + "\">" + dt.Rows[i]["hy_flowname"].ToString() + "^" + dt.Rows[i]["hy_tachename"].ToString() + "</td>";
                        }
                        else
                        {
                            ls_return += "<td style=\"border-bottom:1px solid #cccccc\" width=\"25%\"><input type=\"checkbox\" name=\"fFlowTacheName\" value=\"" + dt.Rows[i]["hy_flowid"].ToString() + "^" + dt.Rows[i]["hy_tacheid"].ToString() + "\">" + dt.Rows[i]["hy_flowname"].ToString() + "^" + dt.Rows[i]["hy_tachename"].ToString() + "</td>";
                        }
                    }

                    if (((j + 1) % 4) == 0 && j < dt.Rows.Count)
                    {
                        ls_return += "</tr><tr>";
                        j = 0;
                    }
                    j += 1;

                }
            }
            dtflowtacheuser.Clear();
            dt.Clear();
        }
        return ls_return;
    }
Exemplo n.º 9
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_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();

        //判断目的表单ID是否重复
        DataTable dt_table = Hyoa_tableconfig.GetTable(txttableidbymd.Text);
        if (dt_table.Rows.Count > 0)
        {
            Response.Write("<script>alert('目的表单ID已存在!');</script>");
            return;
        }

        //插入TABLE配置
        DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.lbmudelidbysource.Text);
        if (tableconfigdt.Rows.Count > 0)
        {
            Hyoa_tableconfig.ID = txttableidbymd.Text;
            Hyoa_tableconfig.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
            Hyoa_tableconfig.hy_name = this.txttablenamebymd.Text;
            Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString();
            Hyoa_tableconfig.hy_sort = float.Parse(this.txttablesortbymd.Text);
            Hyoa_tableconfig.hy_ifflowdoc = this.ddlifflowdoc.SelectedValue;
            Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString();
            Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString();
            Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString();
            Hyoa_tableconfig.hy_ifcomment = tableconfigdt.Rows[0]["hy_ifcomment"].ToString();
            Hyoa_tableconfig.hy_colnum = float.Parse(tableconfigdt.Rows[0]["hy_colnum"].ToString());
            Hyoa_tableconfig.hy_field1 = tableconfigdt.Rows[0]["hy_field1"].ToString();
            Hyoa_tableconfig.hy_field2 = tableconfigdt.Rows[0]["hy_field2"].ToString();
            Hyoa_tableconfig.hy_field3 = tableconfigdt.Rows[0]["hy_field3"].ToString();
            Hyoa_tableconfig.hy_field4 = tableconfigdt.Rows[0]["hy_field4"].ToString();
            Hyoa_tableconfig.hy_field5 = tableconfigdt.Rows[0]["hy_field5"].ToString();
            Hyoa_tableconfig.Insert();
        }

        //插入FIELD配置
        int i;
        DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.lbtableidbysorce.Text);
        if (flowfielddt.Rows.Count > 0)
        {
            for (i = 0; i < flowfielddt.Rows.Count; i++)
            {
                Hyoa_flowfield.ID = Hyoa_global.GetRandom();
                Hyoa_flowfield.hy_tableid = txttableidbymd.Text;
                Hyoa_flowfield.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
                Hyoa_flowfield.hy_flowid = this.txtflowidbymd.Text;
                Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString();
                Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString();
                Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString();
                Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString();
                Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString());
                Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString();
                Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString());
                Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString();
                Hyoa_flowfield.hy_onclick = flowfielddt.Rows[i]["hy_onclick"].ToString();
                Hyoa_flowfield.hy_ondblclick = flowfielddt.Rows[i]["hy_ondblclick"].ToString();
                Hyoa_flowfield.hy_onchange = flowfielddt.Rows[i]["hy_onchange"].ToString();
                Hyoa_flowfield.hy_onkeydown = flowfielddt.Rows[i]["hy_onkeydown"].ToString();
                Hyoa_flowfield.hy_onkeyup = flowfielddt.Rows[i]["hy_onkeyup"].ToString();
                Hyoa_flowfield.hy_sqlfield = flowfielddt.Rows[i]["hy_sqlfield"].ToString();
                Hyoa_flowfield.hy_class = flowfielddt.Rows[i]["hy_class"].ToString();
                Hyoa_flowfield.hy_width = flowfielddt.Rows[i]["hy_width"].ToString();
                Hyoa_flowfield.hy_height = flowfielddt.Rows[i]["hy_height"].ToString();
                Hyoa_flowfield.hy_tdnums = System.Int32.Parse(flowfielddt.Rows[i]["hy_tdnums"].ToString());
                Hyoa_flowfield.hy_config = flowfielddt.Rows[i]["hy_config"].ToString();
                Hyoa_flowfield.hy_sort = float.Parse(flowfielddt.Rows[i]["hy_sort"].ToString());
                Hyoa_flowfield.hy_wordlimit = System.Int32.Parse(flowfielddt.Rows[i]["hy_wordlimit"].ToString());
                Hyoa_flowfield.hy_required = flowfielddt.Rows[i]["hy_required"].ToString();
                Hyoa_flowfield.hy_align = flowfielddt.Rows[i]["hy_align"].ToString();
                Hyoa_flowfield.hy_ifhiddle = flowfielddt.Rows[i]["hy_ifhiddle"].ToString();
                Hyoa_flowfield.hy_ifdbsybt = flowfielddt.Rows[i]["hy_ifdbsybt"].ToString();
                Hyoa_flowfield.hy_field1 = flowfielddt.Rows[i]["hy_field1"].ToString();
                Hyoa_flowfield.hy_field2 = flowfielddt.Rows[i]["hy_field2"].ToString();
                Hyoa_flowfield.hy_field3 = flowfielddt.Rows[i]["hy_field3"].ToString();
                Hyoa_flowfield.hy_field4 = flowfielddt.Rows[i]["hy_field4"].ToString();
                Hyoa_flowfield.hy_field5 = flowfielddt.Rows[i]["hy_field5"].ToString();
                Hyoa_flowfield.Insert();
            }
        }

        //生成SQL/ORACLE中的表
        string sql = "";
        if (Session["conntype"].ToString() == "SQL")
        {
            sql = "select * into hyc_" + txttableidbymd.Text + " from hyc_" + this.lbtableidbysorce.Text + " where 1=0";
        }
        if (Session["conntype"].ToString() == "ORACLE")
        {
            sql = "create table hyc_" + txttableidbymd.Text + " as select * from hyc_" + this.lbtableidbysorce.Text + " where 1=2";
        }
        Hyoa_global.ExcuteSQL(sql);

        //以下为流程模块的功能,非流程模块不需要执行
        if (this.ddlifflowdoc.SelectedValue == "是")
        {
            HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
            DataTable flowinfordt = Hyoa_flowinfor.Getflowinforbymudelid(this.lbmudelidbysource.Text);
            string lssoureceflowid = flowfielddt.Rows[0]["hy_flowid"].ToString();//得到老模块的flowid 后面要用到
            //插入流程信息start
            Hyoa_flowinfor.hy_flowid = this.txtflowidbymd.Text;
            Hyoa_flowinfor.hy_flowname =this.txtflownamebymd.Text;
            Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtflowsortbymd.Text);
            Hyoa_flowinfor.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
            Hyoa_flowinfor.Insert();
            //插入流程信息end

            //string lssql3 = "select * from hyt_flowtache where hy_flowid = 'flow0004'";//流程对应的环节
            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
            DataTable flowtachedt = Hyoa_flowtache.Getflowtachebyflowid(lssoureceflowid);
            if (flowtachedt.Rows.Count > 0)
            {
                for (i = 0; i < flowtachedt.Rows.Count; i++)
                {
                    Hyoa_flowtache.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtache.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtache.hy_tacheid = flowtachedt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtache.hy_tachename = flowtachedt.Rows[i]["hy_tachename"].ToString();
                    Hyoa_flowtache.hy_sort = System.Int32.Parse(flowtachedt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowtache.hy_ifshowcurcomp = flowtachedt.Rows[i]["hy_ifshowcurcomp"].ToString();
                    Hyoa_flowtache.hy_ifshowcurdept = flowtachedt.Rows[i]["hy_ifshowcurdept"].ToString();
                    Hyoa_flowtache.hy_XValue = flowtachedt.Rows[i]["hy_XValue"].ToString();
                    Hyoa_flowtache.hy_YValue = flowtachedt.Rows[i]["hy_YValue"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendSms = flowtachedt.Rows[i]["hy_rdDoIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendMessage = flowtachedt.Rows[i]["hy_rdDoIsSendMessage"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendSms = flowtachedt.Rows[i]["hy_rdPassIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendMessage = flowtachedt.Rows[i]["hy_rdPassIsSendMessage"].ToString();
                    Hyoa_flowtache.hy_enablecondition = flowtachedt.Rows[i]["hy_enablecondition"].ToString();
                    Hyoa_flowtache.Insert();
                }
            }

            //string lssql4 = "select * from hyt_flowtachefield where hy_flowid='flow0004'";//流程环节对应的域
            HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
            DataTable flowtachefielddt = Hyoa_flowtachefield.Getflowtachefieldbyflowid(lssoureceflowid);
            if (flowtachefielddt.Rows.Count > 0)
            {
                for (i = 0; i < flowtachefielddt.Rows.Count; i++)
                {
                    Hyoa_flowtachefield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtachefield.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtachefield.hy_tacheid = flowtachefielddt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtachefield.hy_fieldid = flowtachefielddt.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowtachefield.Insert();
                }
            }
            //string lssql5 = "select * from hyt_flowtacheuser where hy_flowid='flow0004'";//流程环节对应的用户
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            DataTable flowtacheuserdt = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(lssoureceflowid);
            if (flowtacheuserdt.Rows.Count > 0)
            {
                for (i = 0; i < flowtacheuserdt.Rows.Count; i++)
                {
                    Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtacheuser.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtacheuser.hy_tacheid = flowtacheuserdt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtacheuser.hy_userid = flowtacheuserdt.Rows[i]["hy_userid"].ToString();
                    Hyoa_flowtacheuser.Insert();
                }
            }
            //string lssql6 = "select * from hyt_flowwork where hy_flowid='flow0004'";//流程的下环节对应什么,即工作流
            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
            DataTable flowworkdt = Hyoa_flowwork.Getflowworksbyflowid(lssoureceflowid);
            if (flowworkdt.Rows.Count > 0)
            {
                for (i = 0; i < flowworkdt.Rows.Count; i++)
                {
                    Hyoa_flowwork.ID = Hyoa_global.GetRandom();
                    Hyoa_flowwork.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowwork.hy_curtacheid = flowworkdt.Rows[i]["hy_curtacheid"].ToString();
                    Hyoa_flowwork.hy_curtachename = flowworkdt.Rows[i]["hy_curtachename"].ToString();
                    Hyoa_flowwork.hy_nexttacheid = flowworkdt.Rows[i]["hy_nexttacheid"].ToString();
                    Hyoa_flowwork.hy_nexttachename = flowworkdt.Rows[i]["hy_nexttachename"].ToString();
                    Hyoa_flowwork.hy_sort = System.Int32.Parse(flowworkdt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowwork.hy_actiontype = flowworkdt.Rows[i]["hy_actiontype"].ToString();
                    Hyoa_flowwork.hy_identity_type = flowworkdt.Rows[i]["hy_identity_type"].ToString();
                    Hyoa_flowwork.hy_identity_id = flowworkdt.Rows[i]["hy_identity_id"].ToString();
                    Hyoa_flowwork.hy_jscondition = flowworkdt.Rows[i]["hy_jscondition"].ToString();
                    Hyoa_flowwork.hy_jscondition1 = flowworkdt.Rows[i]["hy_jscondition1"].ToString();
                    Hyoa_flowwork.hy_jscondition2 = flowworkdt.Rows[i]["hy_jscondition2"].ToString();
                    Hyoa_flowwork.hy_zdcyuserids = flowworkdt.Rows[i]["hy_zdcyuserids"].ToString();
                    Hyoa_flowwork.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.º 10
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("/login.aspx");

        string ls_tip = "保存成功!";

        //string lssql1 = "SELECT * FROM hyt_flowfield WHERE hy_tableid = '" + this.lbtableidbysorce.Text + "'"; //得到配置字段
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        int i;
        DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.lbtableidbysorce.Text);
        string newtableid;
        newtableid = Hyoa_global.GetRandom();
        if (flowfielddt.Rows.Count > 0)
        {
            for (i = 0; i < flowfielddt.Rows.Count; i++)
            {
                Hyoa_flowfield.ID = Hyoa_global.GetRandom();
                Hyoa_flowfield.hy_tableid = newtableid;
                Hyoa_flowfield.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
                Hyoa_flowfield.hy_flowid = this.txtflowidbymd.Text;
                Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString();
                Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString();
                Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString();
                Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString();
                Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString());
                Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString();
                Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString());
                Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString();
                Hyoa_flowfield.hy_onclick = flowfielddt.Rows[i]["hy_onclick"].ToString();
                Hyoa_flowfield.hy_ondblclick = flowfielddt.Rows[i]["hy_ondblclick"].ToString();
                Hyoa_flowfield.hy_onchange = flowfielddt.Rows[i]["hy_onchange"].ToString();
                Hyoa_flowfield.hy_onkeydown = flowfielddt.Rows[i]["hy_onkeydown"].ToString();
                Hyoa_flowfield.hy_onkeyup = flowfielddt.Rows[i]["hy_onkeyup"].ToString();
                Hyoa_flowfield.hy_sqlfield = flowfielddt.Rows[i]["hy_sqlfield"].ToString();
                Hyoa_flowfield.hy_class = flowfielddt.Rows[i]["hy_class"].ToString();
                Hyoa_flowfield.hy_width = flowfielddt.Rows[i]["hy_width"].ToString();
                Hyoa_flowfield.hy_height = flowfielddt.Rows[i]["hy_height"].ToString();
                Hyoa_flowfield.hy_tdnums = System.Int32.Parse(flowfielddt.Rows[i]["hy_tdnums"].ToString());
                Hyoa_flowfield.hy_config = flowfielddt.Rows[i]["hy_config"].ToString();
                Hyoa_flowfield.hy_sort = System.Int32.Parse(flowfielddt.Rows[i]["hy_sort"].ToString());
                Hyoa_flowfield.hy_wordlimit = System.Int32.Parse(flowfielddt.Rows[i]["hy_wordlimit"].ToString());
                Hyoa_flowfield.hy_required = flowfielddt.Rows[i]["hy_required"].ToString();
                Hyoa_flowfield.hy_align = flowfielddt.Rows[i]["hy_align"].ToString();
                Hyoa_flowfield.Insert();
            }
        }

        HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); //hyt_tableconfig
        DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.lbmudelidbysource.Text);
        if (tableconfigdt.Rows.Count > 0)
        {
            Hyoa_tableconfig.ID = newtableid;
            Hyoa_tableconfig.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
            Hyoa_tableconfig.hy_name = this.txttablenamebymd.Text;
            Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString();
            Hyoa_tableconfig.hy_sort = System.Int32.Parse(this.txttablesortbymd.Text);
            Hyoa_tableconfig.hy_ifflowdoc = this.ddlifflowdoc.SelectedValue;
            Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString();
            Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString();
            Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString();
            Hyoa_tableconfig.Insert();
        }

        //以下为流程模块的功能,非流程模块不需要执行
        if (this.ddlifflowdoc.SelectedValue == "是")
        {
            //string lssql2 = "SELECT * FROM hyt_flowinfor WHERE hy_mudelid = 'bgyply'";//得到模块对应的流程
            HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
            DataTable flowinfordt = Hyoa_flowinfor.Getflowinforbymudelid(this.lbmudelidbysource.Text);
            string lssoureceflowid = flowfielddt.Rows[0]["hy_flowid"].ToString();//得到老模块的flowid 后面要用到
            //插入流程信息start
            Hyoa_flowinfor.hy_flowid = this.txtflowidbymd.Text;
            Hyoa_flowinfor.hy_flowname =this.txtflownamebymd.Text;
            Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtflowsortbymd.Text);
            Hyoa_flowinfor.hy_mudelid = this.ddlmudelidbymd.SelectedValue;
            Hyoa_flowinfor.Insert();
            //插入流程信息end

            //string lssql3 = "select * from hyt_flowtache where hy_flowid = 'flow0004'";//流程对应的环节
            HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
            DataTable flowtachedt = Hyoa_flowtache.Getflowtachebyflowid(lssoureceflowid);
            if (flowtachedt.Rows.Count > 0)
            {
                for (i = 0; i < flowtachedt.Rows.Count; i++)
                {
                    Hyoa_flowtache.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtache.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtache.hy_tacheid = flowtachedt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtache.hy_tachename = flowtachedt.Rows[i]["hy_tachename"].ToString();
                    Hyoa_flowtache.hy_sort = System.Int32.Parse(flowtachedt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowtache.hy_ifshowcurdept = flowtachedt.Rows[i]["hy_ifshowcurdept"].ToString();
                    Hyoa_flowtache.hy_XValue = flowtachedt.Rows[i]["hy_XValue"].ToString();
                    Hyoa_flowtache.hy_YValue = flowtachedt.Rows[i]["hy_YValue"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendSms = flowtachedt.Rows[i]["hy_rdDoIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendMessage = flowtachedt.Rows[i]["hy_rdDoIsSendMessage"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendSms = flowtachedt.Rows[i]["hy_rdPassIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendMessage = flowtachedt.Rows[i]["hy_rdPassIsSendMessage"].ToString();
                    Hyoa_flowtache.Insert();
                }
            }

            //string lssql4 = "select * from hyt_flowtachefield where hy_flowid='flow0004'";//流程环节对应的域
            HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
            DataTable flowtachefielddt = Hyoa_flowtachefield.Getflowtachefieldbyflowid(lssoureceflowid);
            if (flowtachefielddt.Rows.Count > 0)
            {
                for (i = 0; i < flowtachefielddt.Rows.Count; i++)
                {
                    Hyoa_flowtachefield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtachefield.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtachefield.hy_tacheid = flowtachefielddt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtachefield.hy_fieldid = flowtachefielddt.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowtachefield.Insert();
                }
            }
            //string lssql5 = "select * from hyt_flowtacheuser where hy_flowid='flow0004'";//流程环节对应的用户
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            DataTable flowtacheuserdt = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(lssoureceflowid);
            if (flowtacheuserdt.Rows.Count > 0)
            {
                for (i = 0; i < flowtacheuserdt.Rows.Count; i++)
                {
                    Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtacheuser.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowtacheuser.hy_tacheid = flowtacheuserdt.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtacheuser.hy_userid = flowtacheuserdt.Rows[i]["hy_userid"].ToString();
                    Hyoa_flowtacheuser.Insert();
                }
            }
            //string lssql6 = "select * from hyt_flowwork where hy_flowid='flow0004'";//流程的下环节对应什么,即工作流
            HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
            DataTable flowworkdt = Hyoa_flowwork.Getflowworksbyflowid(lssoureceflowid);
            if (flowworkdt.Rows.Count > 0)
            {
                for (i = 0; i < flowworkdt.Rows.Count; i++)
                {
                    Hyoa_flowwork.ID = Hyoa_global.GetRandom();
                    Hyoa_flowwork.hy_flowid = this.txtflowidbymd.Text;
                    Hyoa_flowwork.hy_curtacheid = flowworkdt.Rows[i]["hy_curtacheid"].ToString();
                    Hyoa_flowwork.hy_curtachename = flowworkdt.Rows[i]["hy_curtachename"].ToString();
                    Hyoa_flowwork.hy_nexttacheid = flowworkdt.Rows[i]["hy_nexttacheid"].ToString();
                    Hyoa_flowwork.hy_nexttachename = flowworkdt.Rows[i]["hy_nexttachename"].ToString();
                    Hyoa_flowwork.hy_sort = System.Int32.Parse(flowworkdt.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowwork.hy_actiontype = flowworkdt.Rows[i]["hy_actiontype"].ToString();
                    Hyoa_flowwork.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.º 11
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_user Hyoa_user = new HyoaClass.Hyoa_user();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (this.txtop.Value == "add")
        {
            //先判断这个用户是否已经存在
            DataTable dtjudge = Hyoa_user.Getuserbyuserid(this.txtuserid.Text);
            if (dtjudge.Rows.Count > 0)
            {
                Response.Write("<script>alert('该用户名已注册,请重新注册!');history.back();</script>");
                return;
            }
            else
            {
                //判断是否超过用户数限制
                HyoaClass_conn.Hyoa_nbheyi Hyoa_nbheyi = new HyoaClass_conn.Hyoa_nbheyi();
                DataTable dt1 = Hyoa_nbheyi.Getfirstnbheyi();
                Int32 li_user1 = 0;
                if (dt1.Rows.Count > 0)
                {
                    li_user1 = System.Int32.Parse(dt1.Rows[0]["hy_usernum"].ToString()) + 1;
                }
                DataTable dt2 = Hyoa_user.Getusers_jzcw();
                Int32 li_user2 = 0;
                li_user2 = System.Int32.Parse(dt2.Rows.Count.ToString());
                if (li_user1 <= li_user2)
                {
                    //删除最近注册的账号
                    Response.Write("<script>alert('您的系统注册用户数授权已满,请联系管理员或宁波合益!');</script>");
                    return;
                }

                Hyoa_user.id = Hyoa_global.GetRandom();
                Hyoa_user.hy_loginuid = this.txtuserid.Text;
                Hyoa_user.hy_userid = this.txtuserid.Text;
                Hyoa_user.hy_deptid = this.hy_deptid.Text;
                Hyoa_user.hy_username = this.txtusername.Value;
                Hyoa_user.hy_post = this.txtposition.Value;
                Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
                Hyoa_user.hy_officetel = this.txtofficetel.Value;
                Hyoa_user.hy_hometel = this.txthometel.Value;
                Hyoa_user.hy_mobile = this.txtmobile.Value;
                Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
                Hyoa_user.hy_sort = float.Parse(this.txtuserno.Value);
                Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
                Hyoa_user.hy_createtime = System.DateTime.Now.ToString();
                Hyoa_user.hy_edittime = System.DateTime.Now.ToString();
                Hyoa_user.hy_birthday = this.txtbirthday.Value;
                Hyoa_user.hy_ifsrtx = "";
                Hyoa_user.hy_fjh = this.txtfjh.Value;
                Hyoa_user.hy_xb = this.ddlxb.SelectedValue;
                Hyoa_user.hy_zzmm = this.txtzzmm.Value;
                Hyoa_user.hy_xl = this.txtxl.Value;
                Hyoa_user.hy_byyx = this.txtbyyx.Value;
                Hyoa_user.hy_jdwsj = this.txtjdwsj.Value;
                Hyoa_user.hy_jtzz = this.txtjtzz.Value;
                Hyoa_user.hy_sfzhm = this.txtsfzhm.Value;
                Hyoa_user.hy_bz = "";
                Hyoa_user.hy_jsids = this.txtjsids.Value;
                Hyoa_user.hy_jsnames = this.txtjsnames.Value;
                Hyoa_user.hy_field1 = "";
                Hyoa_user.hy_field2 = this.ddlhy_field2.SelectedValue.ToString();
                Hyoa_user.hy_field3 = "";
                Hyoa_user.hy_field4 = "";
                Hyoa_user.hy_field5 = "";
                Hyoa_user.Insert();

                //写新增人员系统日志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 = "新增用户:" + this.txtusername.Value;
                Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
                Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
                Hyoa_log.Insert();
            }
        }
        else
        {
            Hyoa_user.id = this.txtid.Text;
            Hyoa_user.hy_loginuid = this.txtuserid.Text;
            Hyoa_user.hy_userid = this.txtuserid.Text;
            Hyoa_user.hy_deptid = this.hy_deptid.Text;
            Hyoa_user.hy_username = this.txtusername.Value;
            Hyoa_user.hy_post = this.txtposition.Value;
            Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
            Hyoa_user.hy_officetel = this.txtofficetel.Value;
            Hyoa_user.hy_hometel = this.txthometel.Value;
            Hyoa_user.hy_mobile = this.txtmobile.Value;
            Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
            Hyoa_user.hy_sort = float.Parse(this.txtuserno.Value);
            Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
            Hyoa_user.hy_edittime = System.DateTime.Now.ToString();
            Hyoa_user.hy_birthday = this.txtbirthday.Value;
            Hyoa_user.hy_ifsrtx = "";
            Hyoa_user.hy_fjh = this.txtfjh.Value;
            Hyoa_user.hy_xb = this.ddlxb.SelectedValue;
            Hyoa_user.hy_zzmm = this.txtzzmm.Value;
            Hyoa_user.hy_xl = this.txtxl.Value;
            Hyoa_user.hy_byyx = this.txtbyyx.Value;
            Hyoa_user.hy_jdwsj = this.txtjdwsj.Value;
            Hyoa_user.hy_jtzz = this.txtjtzz.Value;
            Hyoa_user.hy_sfzhm = this.txtsfzhm.Value;
            Hyoa_user.hy_bz = "";
            Hyoa_user.hy_jsids = this.txtjsids.Value;
            Hyoa_user.hy_jsnames = this.txtjsnames.Value;
            Hyoa_user.hy_field1 = "";
            Hyoa_user.hy_field2 = this.ddlhy_field2.SelectedValue.ToString();
            Hyoa_user.hy_field3 = "";
            Hyoa_user.hy_field4 = "";
            Hyoa_user.hy_field5 = "";
            Hyoa_user.Update();

            //写新增人员系统日志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 = "修改用户:" + this.txtusername.Value;
            Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
            Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
            Hyoa_log.Insert();
        }

        //根据角色分配权限
        if (this.txtjsids.Value != this.txtjsids2.Text)
        {
            //选择的角色有所变化,则需要更新

            HyoaClass.Hyoa_jiaose Hyoa_jiaose = new HyoaClass.Hyoa_jiaose();
            HyoaClass.Hyoa_roleuser Hyoa_roleuser = new HyoaClass.Hyoa_roleuser();
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();

            ///////////////////删除老角色的权限///////////////////////////////////
            string[] lv_deljiaoseid = this.txtjsids2.Text.Split(',');
            if (lv_deljiaoseid.Length > 0)
            {
                for (int i = 0; i < lv_deljiaoseid.Length; i++)
                {
                    if (lv_deljiaoseid[i] != "")
                    {
                        DataTable dt = Hyoa_jiaose.Getdocbyid(lv_deljiaoseid[i]);
                        if (dt.Rows.Count > 0)
                        {
                            //更新对应的ROLE
                            if (dt.Rows[0]["hy_roleids"].ToString() != "")
                            {
                                string[] lv_roleid;
                                lv_roleid = dt.Rows[0]["hy_roleids"].ToString().Split(',');
                                for (int j = 0; j < lv_roleid.Length; j++)
                                {
                                    if (lv_roleid[j] != "")
                                    {
                                        Hyoa_roleuser.Deletebyroleidanduserid(lv_roleid[j], this.txtuserid.Text);
                                    }
                                }
                            }
                            //更新对应的flowtache
                            if (dt.Rows[0]["hy_flowtacheids"].ToString() != "")
                            {
                                string[] lv_flowtacheidid;
                                lv_flowtacheidid = dt.Rows[0]["hy_flowtacheids"].ToString().Split(',');
                                for (int j = 0; j < lv_flowtacheidid.Length; j++)
                                {
                                    if (lv_flowtacheidid[j] != "")
                                    {
                                        string ls_temp = lv_flowtacheidid[j];
                                        string[] lv_temp = ls_temp.Split('_');
                                        if (lv_temp.Length == 2)
                                        {
                                            string ls_flowid = lv_temp[0];
                                            string ls_tacheid = lv_temp[1];
                                            Hyoa_flowtacheuser.Deletebyroleidtacheiduserid(ls_flowid, ls_tacheid, this.txtuserid.Text);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            ///////////////////增加新角色的权限///////////////////////////////////
            string[] lv_addjiaoseid = this.txtjsids.Value.Split(',');
            if (lv_addjiaoseid.Length > 0)
            {
                for (int i = 0; i < lv_addjiaoseid.Length; i++)
                {
                    if (lv_addjiaoseid[i] != "")
                    {
                        DataTable dt = Hyoa_jiaose.Getdocbyid(lv_addjiaoseid[i]);
                        if (dt.Rows.Count > 0)
                        {
                            //更新对应的ROLE
                            if (dt.Rows[0]["hy_roleids"].ToString() != "")
                            {
                                string[] lv_roleid;
                                lv_roleid = dt.Rows[0]["hy_roleids"].ToString().Split(',');
                                for (int j = 0; j < lv_roleid.Length; j++)
                                {
                                    if (lv_roleid[j] != "")
                                    {
                                        Hyoa_roleuser.ID = Hyoa_global.GetRandom();
                                        Hyoa_roleuser.hy_roleid = lv_roleid[j];
                                        Hyoa_roleuser.hy_userid = this.txtuserid.Text;
                                        Hyoa_roleuser.Insert();
                                    }
                                }
                            }
                            //更新对应的flowtache
                            if (dt.Rows[0]["hy_flowtacheids"].ToString() != "")
                            {
                                string[] lv_flowtacheidid;
                                lv_flowtacheidid = dt.Rows[0]["hy_flowtacheids"].ToString().Split(',');
                                for (int j = 0; j < lv_flowtacheidid.Length; j++)
                                {
                                    if (lv_flowtacheidid[j] != "")
                                    {
                                        string ls_temp = lv_flowtacheidid[j];
                                        string[] lv_temp = ls_temp.Split('_');
                                        if (lv_temp.Length == 2)
                                        {
                                            string ls_flowid = lv_temp[0];
                                            string ls_tacheid = lv_temp[1];
                                            Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                                            Hyoa_flowtacheuser.hy_flowid = ls_flowid;
                                            Hyoa_flowtacheuser.hy_tacheid = ls_tacheid;
                                            Hyoa_flowtacheuser.hy_userid = this.txtuserid.Text;
                                            Hyoa_flowtacheuser.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.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ls_flowid;
        string ls_nexttacheid;
        string ls_deptid;
        string ls_username;
        string ls_userid;
        string ls_opt;
        ls_flowid = "";
        ls_nexttacheid = "";
        ls_deptid = "";
        ls_username = "";
        ls_userid = "";
        ls_opt = "";

        if (this.Request.QueryString["flowid"] != null)
        {
            ls_flowid = this.Request.QueryString["flowid"].ToString();
        }
        if (this.Request.QueryString["nexttacheid"] != null)
        {
            ls_nexttacheid = this.Request.QueryString["nexttacheid"].ToString();
        }
        if (this.Request.QueryString["deptid"] != null)
        {
            ls_deptid = this.Request.QueryString["deptid"].ToString();
        }
        if (this.Request.QueryString["opt"] != null)
        {
            ls_opt = this.Request.QueryString["opt"].ToString();
        }
        //如果opt等于clr,则表示处理人的域,如果opt等于cyr,则表示传阅人的域
        if (ls_opt == "clr")
        {
            //后序环节处理人员
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            DataTable dt4 = Hyoa_flowtacheuser.Getcuruserinfobyflowidtacheiddeptid(ls_flowid, ls_nexttacheid, ls_deptid);
            if (dt4.Rows.Count > 0)
            {
                for (int i = 0; i < dt4.Rows.Count; i++)
                {
                    if (ls_username == "")
                    {
                        ls_username = dt4.Rows[i]["hy_username"].ToString();
                        ls_userid = dt4.Rows[i]["hy_userid"].ToString();

                    }
                    else
                    {
                        ls_username = ls_username + "+" + dt4.Rows[i]["hy_username"].ToString();
                        ls_userid = ls_userid + "+" + dt4.Rows[i]["hy_userid"].ToString();
                    }
                }
            }

            dt4.Clear();
            this.Response.Write(ls_username + "*" + ls_userid);
            return ;
        }

        if (ls_opt == "cyr")
        {

            //后序环节传阅人员
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            DataTable dt3 = Hyoa_user.Getusersbydeptid(ls_deptid);
            if (dt3.Rows.Count > 0)
            {
                for (int i = 0; i < dt3.Rows.Count; i++)
                {
                    if (ls_username == "")
                    {
                        ls_username = dt3.Rows[i]["hy_username"].ToString();
                        ls_userid = dt3.Rows[i]["hy_userid"].ToString();
                    }
                    else
                    {
                        ls_username = ls_username + "+" + dt3.Rows[i]["hy_username"].ToString();
                        ls_userid = ls_userid + "+" + dt3.Rows[i]["hy_userid"].ToString();
                    }
                }
            }
            dt3.Clear();
            this.Response.Write(ls_username + "*" + ls_userid);
            return;
        }

        ////if (Request.QueryString["productid"] != null)
        ////{

        //    DataTable dt;
        //    TPortalClass.JpSupply JpSupply = new TPortalClass.JpSupply();
        //    if (HttpContext.Current.Request.Url.ToString().IndexOf("productname") > 0)
        //    {
        //        JpSupply.productname = Request.QueryString["productname"].ToString();
        //        dt = JpSupply.Getproductname();
        //    }
        //    else
        //    {
        //        dt = JpSupply.GetAllproductname();

        //    }
        //    string ls_name = "";
        //    //this.Response.Write("<div id=sampleLayer style=\"position:absolute; top:80px; left:285px; width:200px; height:100px; background:#EEEEEE; border: 1px solid #919191; font-family:Verdana; font-size:8pt\">");
        //    this.Response.Write("<div align=left id=sampleLayer style=\"position:absolute; top:80px; left:285px; width:300px; height:100px; background:#EEEEEE; overflow:scroll; border: 1px solid #919191; font-family:Verdana; font-size:8pt\">");
        //    //this.Response.Write("<div id=sampleLayer style=\"font: 0px/0px sans-serif;clear: both;display: block\">");
        //    for (int i = 0; i < dt.Rows.Count; i++)
        //    {
        //        ls_name = ls_name + dt.Rows[i]["productname"].ToString();
        //        this.Response.Write("<li><a href=\"#\" onclick=document.forms[0].textfield.value='" + dt.Rows[i]["productname"].ToString() + "';>" + dt.Rows[i]["productname"].ToString() + "</a></li>");
        //    }
        //    //this.Response.Write(ls_name);
        //    this.Response.Write("</div>");
        //    //this.Response.Write("<div id=sampleLayer style=\"position:absolute; top:80px; left:285px; width:200px; height:100px; background:#EEEEEE; border: 1px solid #919191; font-family:Verdana; font-size:8pt\"><li><a href=\"#\" onclick=selectlist()>这是个简单</a></li><li>aaaa</li></divpt>");
        //    return;
        ////}
    }
Exemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ls_flowid;
        string ls_nexttacheid;
        string ls_deptid;
        string ls_username;
        string ls_userid;
        string ls_opt;
        ls_flowid = "";
        ls_nexttacheid = "";
        ls_deptid = "";
        ls_username = "";
        ls_userid = "";
        ls_opt = "";

        if (this.Request.QueryString["flowid"] != null)
        {
            ls_flowid = this.Request.QueryString["flowid"].ToString();
        }
        if (this.Request.QueryString["nexttacheid"] != null)
        {
            ls_nexttacheid = this.Request.QueryString["nexttacheid"].ToString();
        }
        if (this.Request.QueryString["deptid"] != null)
        {
            ls_deptid = this.Request.QueryString["deptid"].ToString();
        }
        if (this.Request.QueryString["opt"] != null)
        {
            ls_opt = this.Request.QueryString["opt"].ToString();
        }
        //如果opt等于clr,则表示处理人的域,如果opt等于cyr,则表示传阅人的域
        if (ls_opt == "clr")
        {
            HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
            //后序环节处理人员
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
            //先得到后续环节处理人集合
            DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(ls_flowid, ls_nexttacheid);
            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 (ls_deptid == "--请选择--")
                {
                    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='" + ls_deptid + "' 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='" + ls_deptid + "' order by a.hy_deptsort,b.hy_sort";
                    }
                }
                DataTable dt = Hyoa_global.GetDataTable_USER(sql);
                if (dt.Rows.Count > 0)
                {
                    ls_temp1 = "";
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ","))
                        {
                        }
                        else
                        {
                            //开始输出
                            if (ls_username == "")
                            {
                                ls_username = dt.Rows[i]["hy_username"].ToString();
                                ls_userid = dt.Rows[i]["hy_userid"].ToString();
                            }
                            else
                            {
                                ls_username += "+" + dt.Rows[i]["hy_username"].ToString();
                                ls_userid += "+" + dt.Rows[i]["hy_userid"].ToString();
                            }
                            ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString();
                        }
                    }
                }
            }
            this.Response.Write(ls_username + "*" + ls_userid);
            return ;
        }

        if (ls_opt == "cyr")
        {
            //后序环节传阅人员
            HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
            DataTable dt3 = Hyoa_user.Getusersbydeptid(ls_deptid);
            if (dt3.Rows.Count > 0)
            {
                for (int i = 0; i < dt3.Rows.Count; i++)
                {
                    if (ls_username == "")
                    {
                        ls_username = dt3.Rows[i]["hy_username"].ToString();
                        ls_userid = dt3.Rows[i]["hy_userid"].ToString();
                    }
                    else
                    {
                        ls_username = ls_username + "+" + dt3.Rows[i]["hy_username"].ToString();
                        ls_userid = ls_userid + "+" + dt3.Rows[i]["hy_userid"].ToString();
                    }
                }
            }
            dt3.Clear();
            this.Response.Write(ls_username + "*" + ls_userid);
            return;
        }
    }
Exemplo n.º 14
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.º 15
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-------
    }
Exemplo n.º 16
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_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
        HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
        HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();

        //先判断流程是否已经存在
        DataTable dt = Hyoa_flowinfor.Getflowinfor(this.txtFlowID.Value);
        if (dt.Rows.Count > 0)
        {
            Response.Write("<script>alert('该流程已存在,请重新填写!');history.back();</script>");
            return;
        }
        else
        {
            //添加流程信息
            Hyoa_flowinfor.hy_flowid = this.txtFlowID.Value;
            Hyoa_flowinfor.hy_flowname = this.txtFlowCh.Value;
            Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtFlowSort.Value);
            Hyoa_flowinfor.hy_mudelid = this.ddlmudelid.SelectedValue;
            Hyoa_flowinfor.Insert();
            //添加环节信息
            DataTable dtflowtache = Hyoa_flowtache.Getflowtachebyflowid(this.txtSrcFlowID.Value);
            if (dtflowtache.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowtache.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowtache.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtache.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowtache.hy_tacheid = dtflowtache.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtache.hy_tachename = dtflowtache.Rows[i]["hy_tachename"].ToString();
                    Hyoa_flowtache.hy_sort = System.Int32.Parse(dtflowtache.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowtache.hy_ifshowcurdept = dtflowtache.Rows[i]["hy_ifshowcurdept"].ToString();
                    Hyoa_flowtache.hy_XValue = dtflowtache.Rows[i]["hy_XValue"].ToString();
                    Hyoa_flowtache.hy_YValue = dtflowtache.Rows[i]["hy_YValue"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendSms = dtflowtache.Rows[i]["hy_rdDoIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdDoIsSendMessage = dtflowtache.Rows[i]["hy_rdDoIsSendMessage"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendSms = dtflowtache.Rows[i]["hy_rdPassIsSendSms"].ToString();
                    Hyoa_flowtache.hy_rdPassIsSendMessage = dtflowtache.Rows[i]["hy_rdPassIsSendMessage"].ToString();
                    Hyoa_flowtache.Insert();
                }
            }
            //添加流转信息
            DataTable dtflowwork = Hyoa_flowwork.Getflowworksbyflowid(this.txtSrcFlowID.Value);
            if (dtflowwork.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowwork.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowwork.ID = Hyoa_global.GetRandom();
                    Hyoa_flowwork.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowwork.hy_curtacheid = dtflowwork.Rows[i]["hy_curtacheid"].ToString();
                    Hyoa_flowwork.hy_curtachename = dtflowwork.Rows[i]["hy_curtachename"].ToString();
                    Hyoa_flowwork.hy_nexttacheid = dtflowwork.Rows[i]["hy_nexttacheid"].ToString();
                    Hyoa_flowwork.hy_nexttachename = dtflowwork.Rows[i]["hy_nexttachename"].ToString();
                    Hyoa_flowwork.hy_sort = System.Int32.Parse(dtflowwork.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowwork.hy_actiontype = dtflowwork.Rows[i]["hy_actiontype"].ToString();
                    Hyoa_flowwork.Insert();
                }
            }
            //添加流程对应的域
            DataTable dtflowfield = Hyoa_flowfield.Getflowfieldsbyflowid(this.txtSrcFlowID.Value);
            if (dtflowfield.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowfield.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowfield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowfield.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowfield.hy_fieldid = dtflowfield.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowfield.hy_fieldname = dtflowfield.Rows[i]["hy_fieldname"].ToString();
                    Hyoa_flowfield.hy_fieldtype = dtflowfield.Rows[i]["hy_fieldtype"].ToString();
                    Hyoa_flowfield.hy_config = dtflowfield.Rows[i]["hy_config"].ToString();
                    Hyoa_flowfield.hy_sort = System.Int32.Parse(dtflowfield.Rows[i]["hy_sort"].ToString());
                    Hyoa_flowfield.Insert();
                }
            }
            //添加流程环节对应的域
            DataTable dtflowtachefield = Hyoa_flowtachefield.Getflowtachefieldbyflowid(this.txtSrcFlowID.Value);
            if (dtflowtachefield.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowtachefield.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowtachefield.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtachefield.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowtachefield.hy_tacheid = dtflowtachefield.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtachefield.hy_fieldid = dtflowtachefield.Rows[i]["hy_fieldid"].ToString();
                    Hyoa_flowtachefield.Insert();
                }
            }
            //添加流程环节对应的人员
            DataTable dtflowtacheuser = Hyoa_flowtacheuser.Getflowtacheuserbyflowid(this.txtSrcFlowID.Value);
            if (dtflowtacheuser.Rows.Count > 0)
            {
                for (var i = 0; i < dtflowtacheuser.Rows.Count; i++)
                {
                    //复制到新流程中
                    Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                    Hyoa_flowtacheuser.hy_flowid = this.txtFlowID.Value;
                    Hyoa_flowtacheuser.hy_tacheid = dtflowtacheuser.Rows[i]["hy_tacheid"].ToString();
                    Hyoa_flowtacheuser.hy_userid = dtflowtacheuser.Rows[i]["hy_userid"].ToString();
                    Hyoa_flowtacheuser.Insert();
                }
            }
        }

        //处理完成后的提示及跳转
        Response.Write("<script>alert('" + ls_tip + "');window.opener.location.reload();self.close();</script>");
    }