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------------ }
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------- }
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------- }
private void DataPlay() { ////////得到当前模块对应的role //////HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel(); //////DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value); //////string ls_role = "Role9999"; //////if (dt_mudel.Rows.Count > 0) ////// ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString(); ////////判断当前用户是否有统计权限 //////HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //////if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString())) //////{ ////// this.isrole.Value = "1"; ////// this.Button_Return.Visible = true; //统计 //////} //////else //////{ ////// this.isrole.Value = "0"; ////// this.Button_Return.Visible = false; //统计 //////} HyoaClass.DAO db = new HyoaClass.DAO(); DataTable tempTable = new DataTable(); DataColumn coldeptname = new DataColumn("deptname", typeof(String)); tempTable.Columns.Add(coldeptname); DataColumn colusername = new DataColumn("username", typeof(String)); tempTable.Columns.Add(colusername); DataColumn col1 = new DataColumn("tatalvalue1", typeof(String)); tempTable.Columns.Add(col1); DataColumn col2 = new DataColumn("tatalvalue2", typeof(String)); tempTable.Columns.Add(col2); DataColumn col3 = new DataColumn("tatalvalue3", typeof(String)); tempTable.Columns.Add(col3); string sql = ""; Double li_depttotal = 0; Double li_deptusernum = 0; Double li_dept_fts = 0; float li_usertotal = 0; //先得到部门,然后按部门进行统计 HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept(); DataTable dt = Hyoa_dept.Getdepts(); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); double lisum = 0; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { li_depttotal = 0; li_deptusernum = 0; li_dept_fts = 0; //得到部门在选择时间段内的公摊总值 //sql = "select sum(a.hy_field36*a.hy_field37+a.hy_field38*a.hy_field40+a.hy_field39*a.hy_field71+a.hy_field76*a.hy_field81+a.hy_field77*a.hy_field82+a.hy_field78*a.hy_field83+a.hy_field79*a.hy_field84) as depttotal from hyp_flowmain a,hyp_flowmain b where a.hy_mudelid='" + this.txtmudelid.Value + "' and a.hy_tableid='" + this.txttableid.Value + "' and a.hy_curtacheid='**' and a.hy_djrbmid='" + dt.Rows[i]["hy_deptid"].ToString() + "' and a.hy_field1=b.hy_field3 and a.hy_field4=b.hy_field1 and b.hy_field2='否'"; sql = "select sum(a.hy_field36*a.hy_field37+a.hy_field38*a.hy_field40+a.hy_field39*a.hy_field71+a.hy_field76*a.hy_field81+a.hy_field77*a.hy_field82+a.hy_field78*a.hy_field83+a.hy_field79*a.hy_field84) as depttotal from hyp_flowmain a where a.hy_mudelid='" + this.txtmudelid.Value + "' and a.hy_tableid='" + this.txttableid.Value + "' and a.hy_curtacheid='**' and a.hy_djrbmid='" + dt.Rows[i]["hy_deptid"].ToString() + "' and a.hy_field7='否'"; if (this.hy_djsj_start_1.Value != "") sql += " and a.hy_djsj >= '" + this.hy_djsj_start_1.Value + "' "; if (this.hy_djsj_end_1.Value != "") sql += " and a.hy_djsj <= '" + this.hy_djsj_end_1.Value + "' "; DataTable dt_depttatle = db.GetDataTable(sql); if (dt_depttatle.Rows.Count > 0 && dt_depttatle.Rows[0]["depttotal"].ToString() != null && dt_depttatle.Rows[0]["depttotal"].ToString()!="") li_depttotal = System.Double.Parse(dt_depttatle.Rows[0]["depttotal"].ToString()); //得到当前部门有几个人员 sql = "select count(*) as deptusernum from hyt_user where hy_deptid='" + dt.Rows[i]["hy_deptid"].ToString() + "'"; DataTable dt_deptusernum = db.GetDataTable(sql); li_deptusernum = System.Int32.Parse(dt_deptusernum.Rows[0]["deptusernum"].ToString()); //部门分摊数 if (li_deptusernum == 0) { } else { li_dept_fts = li_depttotal / li_deptusernum; } //得到该部门下边的人员 DataTable dt_user = Hyoa_user.Getusersbydeptid(dt.Rows[i]["hy_deptid"].ToString()); if (dt_user.Rows.Count > 0) { for (int j = 0; j < dt_user.Rows.Count; j++) { li_usertotal = 0; //根据人员进行统计 sql = "select sum(a.hy_field36*a.hy_field37+a.hy_field38*a.hy_field40+a.hy_field39*a.hy_field71+a.hy_field76*a.hy_field81+a.hy_field77*a.hy_field82+a.hy_field78*a.hy_field83+a.hy_field79*a.hy_field84) as depttotal from hyp_flowmain a where a.hy_mudelid='" + this.txtmudelid.Value + "' and a.hy_tableid='" + this.txttableid.Value + "' and a.hy_curtacheid='**' and a.hy_bt='" + dt_user.Rows[j]["hy_username"].ToString() + "' and a.hy_field7='是'"; if (this.hy_djsj_start_1.Value != "") sql += " and a.hy_djsj >= '" + this.hy_djsj_start_1.Value + "' "; if (this.hy_djsj_end_1.Value != "") sql += " and a.hy_djsj <= '" + this.hy_djsj_end_1.Value + "' "; DataTable dt_usertatle = db.GetDataTable(sql); if (dt_usertatle.Rows.Count > 0 && dt_usertatle.Rows[0]["depttotal"].ToString() != null && dt_usertatle.Rows[0]["depttotal"].ToString() != "") { li_usertotal = float.Parse(dt_usertatle.Rows[0]["depttotal"].ToString()); } DataRow dr = tempTable.NewRow(); dr["deptname"] = dt.Rows[i]["hy_deptname"].ToString(); dr["username"] = dt_user.Rows[j]["hy_username"].ToString(); dr["tatalvalue1"] = li_usertotal.ToString("F2"); dr["tatalvalue2"] = li_dept_fts.ToString("F2"); dr["tatalvalue3"] = (li_usertotal + li_dept_fts).ToString("F2"); lisum += li_usertotal + li_dept_fts; tempTable.Rows.Add(dr); } } } } this.lblsum.Text = "合计总额:" + lisum.ToString("F2"); this.rptlist.DataSource = tempTable; this.rptlist.DataBind(); dt.Clear(); }
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------- }