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)); }
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------------ }
//输出一个字段 //li_tdnums_onerow:当前行已输出了几列 //li_colnums_show:每行显示几列(标准情况下) //pi_isnewdoc 0:新文档 1:旧文档 //ifhavarole:表单上是否有权限 0:lable输出 1:input输出 //ifflowdoc:是否流程表单 0:非流程 1:流程 //curtacheid:当前环节ID,用于判断字段是否在当前环节有权限 public int GetFieldHtml(TableRow tRow, int li_tdnums_onerow, int li_colnums_show, string hy_fieldid, string pi_isnewdoc, string ifhavarole, string ifflowdoc, string curtacheid) { int li_return = li_tdnums_onerow; string ls_laborinput = "0"; //输出LABLE还是INPUT 0:LABLE 1:INPUT HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.hy_mudelid.Text, hy_fieldid, this.hy_tableid.Text); int li_left = 30; int li_right = 70; if (dtfield.Rows.Count > 0) { string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString(); //字段类型 if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "5") //如果设置了不显示左侧说明文字,则不加载左侧列 { li_return += 1; //插入单元格(左侧) TableCell tCell = new TableCell(); tRow.Cells.Add(tCell); tCell.Width = Unit.Percentage((li_left / li_colnums_show)); tCell.Height = Unit.Pixel(30); tCell.CssClass = "Tdcellleft"; tCell.HorizontalAlign = HorizontalAlign.Center; tCell.Controls.Add(new LiteralControl(dtfield.Rows[0]["hy_fieldname"].ToString())); } else { li_left = 50; li_right = 50; } //插入单元格(右侧) TableCell tCell2 = new TableCell(); tRow.Cells.Add(tCell2); tCell2.Width = Unit.Percentage((li_right / li_colnums_show)); tCell2.Height = Unit.Pixel(30); tCell2.CssClass = "Tdcellright"; if (dtfield.Rows[0]["hy_align"].ToString() == "left") { tCell2.HorizontalAlign = HorizontalAlign.Left; } if (dtfield.Rows[0]["hy_align"].ToString() == "center") { tCell2.HorizontalAlign = HorizontalAlign.Center; } if (dtfield.Rows[0]["hy_align"].ToString() == "right") { tCell2.HorizontalAlign = HorizontalAlign.Right; } tCell2.ColumnSpan = int.Parse(dtfield.Rows[0]["hy_tdnums"].ToString()); li_return += int.Parse(dtfield.Rows[0]["hy_tdnums"].ToString()); //赋值(新文档取配置的默认值,旧文档取数据库表中的值) string field_docvalue = ""; if (pi_isnewdoc == "0") //新文档 { if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "-1") { if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "0") { field_docvalue = dtfield.Rows[0]["hy_defaultvalue"].ToString(); //手工配置 } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "1") { DataTable dt_getfieldvalue = Hyoa_global.GetDataTable(dtfield.Rows[0]["hy_defaultvalue"].ToString()); field_docvalue = dt_getfieldvalue.Rows[0][0].ToString(); //SQL语句 } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "2") { field_docvalue = Session[dtfield.Rows[0]["hy_defaultvalue"].ToString()].ToString(); //SESSION } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "3") { if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") field_docvalue = System.DateTime.Now.ToString("yyyy-MM-dd"); //当前时间 else field_docvalue = System.DateTime.Now.ToString("yyyy-MM-dd HH:MM:ss"); //当前时间 } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "4") { //自动生成 if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值") { //得到目前最大的数值,然后+1,未找到则赋值为1 DataTable dt_autovalue = Hyoa_global.GetDataTable("select max(hyc_" + hy_fieldid + ") maxint from hyc_" + this.hy_tableid.Text); if (dt_autovalue.Rows[0]["maxint"].ToString() == null || dt_autovalue.Rows[0]["maxint"].ToString() == "") field_docvalue += "1"; else field_docvalue += (System.Int32.Parse(dt_autovalue.Rows[0]["maxint"].ToString()) + 1).ToString(); } else { field_docvalue += System.Guid.NewGuid().ToString(); } } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "5") { field_docvalue += dtfield.Rows[0]["hy_defaultvalue"].ToString(); } } } else { if (field_type == "文本" || field_type == "多行文本" || field_type == "多行文本_TEXT" || field_type == "文本加按钮" || field_type == "多行文本加按钮" || field_type == "日期" || field_type == "数值" || field_type == "对话框列表" || field_type == "复选框" || field_type == "单选框" || field_type == "口令" || field_type == "编辑器") { string ls_sql = "select hyc_" + hy_fieldid + " from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'"; DataTable dt_getdocvalue = Hyoa_global.GetDataTable(ls_sql); if (dt_getdocvalue.Rows.Count > 0) { field_docvalue = dt_getdocvalue.Rows[0][0].ToString(); if (field_type == "日期") { if (field_docvalue.Length > 8) { if (field_docvalue.Substring(0, 8) == "1900-1-1") { field_docvalue = " "; } else { if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") { field_docvalue = System.DateTime.Parse(field_docvalue).ToString("yyyy-MM-dd"); } } } } } } if (field_type == "说明文字") { field_docvalue += dtfield.Rows[0]["hy_defaultvalue"].ToString(); } } //判断是输出LABL还是INPUT if (pi_isnewdoc == "0") //新文档 { if (ifflowdoc == "0") //非流程 { if (ifhavarole == "1") //有权限 { ls_laborinput = "1"; } } else { if (ifhavarole == "1") //有权限 { //有流程(判断当前环节这个字段是否有权限) HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield(); ls_laborinput = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(hy_flowid.Text, curtacheid, hy_fieldid); if (ls_laborinput == "0") { field_docvalue = ""; } } else { field_docvalue = ""; } } } else //旧文档 { if (ifflowdoc == "0") //非流程 { if (ifhavarole == "1") //有权限 { ls_laborinput = "1"; //如果文档已经确认,则输出lable string ls_sql = "select hy_ifconfirm from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'"; DataTable dt_getifconfirm = Hyoa_global.GetDataTable(ls_sql); if (dt_getifconfirm.Rows.Count > 0) { if (dt_getifconfirm.Rows[0]["hy_ifconfirm"].ToString() == "1") ls_laborinput = "0"; } } } else { if (ifhavarole == "1") //有权限 { //有流程(判断当前环节这个字段是否有权限) HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield(); ls_laborinput = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(hy_flowid.Text, curtacheid, hy_fieldid); //如果流程结束了,则输出lable if (hy_curtacheid.Text == "**") { ls_laborinput = "0"; } } } } //如果是输出LABLE,值为空则赋为 不为空时需要转换回车和空格 if (ls_laborinput == "0") { if (field_docvalue == "") { field_docvalue = " "; } else { if (field_type != "编辑器") { field_docvalue = RtfToText(field_docvalue); } } } //单行文本 if (field_type == "文本") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { TextBox txtTextBox = new TextBox(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); } if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "") { txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString()); } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString()); } if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "") { txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString()); } if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "") { txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //多行文本 if (field_type == "多行文本") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { TextBox txtTextBox = new TextBox(); txtTextBox.TextMode = TextBoxMode.MultiLine; txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); } if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "") { txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString()); } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString()); } if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "") { txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString()); } if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "") { txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //多行文本_TEXT if (field_type == "多行文本_TEXT") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { TextBox txtTextBox = new TextBox(); txtTextBox.TextMode = TextBoxMode.MultiLine; txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); } if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "") { txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString()); } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString()); } if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "") { txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString()); } if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "") { txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //按钮 if (field_type == "按钮") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = " "; tCell2.Controls.Add(txtTextBox); } else { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value='" + dtfield.Rows[0]["hy_fieldname"].ToString() + "' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />"; txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //一直显示的按钮 if (field_type == "一直显示的按钮") { //-----开始输出字段------ Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value='" + dtfield.Rows[0]["hy_fieldname"].ToString() + "' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />"; txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } //日期 if (field_type == "日期") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { TextBox txtTextBox = new TextBox(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); } if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "") { txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString()); } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString()); } if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "") { txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString()); } if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "") { txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //文本加按钮 if (field_type == "文本加按钮") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { TextBox txtTextBox = new TextBox(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } txtTextBox.Width = Unit.Parse("60%"); if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); Label txtTextBox2 = new Label(); txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString(); field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />"; txtTextBox2.Text = field_docvalue; tCell2.Controls.Add(txtTextBox2); } } //多行文本加按钮 if (field_type == "多行文本加按钮") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { TextBox txtTextBox = new TextBox(); txtTextBox.TextMode = TextBoxMode.MultiLine; txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); Label txtTextBox2 = new Label(); txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString(); field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />"; txtTextBox2.Text = field_docvalue; tCell2.Controls.Add(txtTextBox2); } } //意见加按钮 if (field_type == "意见加按钮") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { TextBox txtTextBox = new TextBox(); txtTextBox.TextMode = TextBoxMode.MultiLine; txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } //txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); Label txtTextBox2 = new Label(); txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString(); field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" /><input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "_cz' value=' 重 置 ' class=btn3 onclick=\"document.getElementById('" + dtfield.Rows[0]["hy_fieldid"].ToString() + "').value='';\" />"; txtTextBox2.Text = field_docvalue; tCell2.Controls.Add(txtTextBox2); } } //数值 if (field_type == "数值") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { TextBox txtTextBox = new TextBox(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); } if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "") { txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString()); } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString()); } if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "") { txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString()); } if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "") { txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //对话框列表(下拉框 if (field_type == "对话框列表") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { DropDownList ddlDropDownList = new DropDownList(); ddlDropDownList.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_class"].ToString() != "") { ddlDropDownList.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { ddlDropDownList.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { ddlDropDownList.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString()); } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { //手工配置 if (dtfield.Rows[0]["hy_options"].ToString() != "") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (int i = 0; i < lv_options.Length; i++) { ddlDropDownList.Items.Add(lv_options[i].ToString()); } } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { //SQL语句 if (dtfield.Rows[0]["hy_options"].ToString() != "") { //如果SQL语句中含有特殊标示,则需要替换 string ls_sql = dtfield.Rows[0]["hy_options"].ToString(); if (ls_sql.Contains("用户ID")) { ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'"); } if (ls_sql.Contains("用户名")) { ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'"); } if (ls_sql.Contains("部门ID")) { ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'"); } if (ls_sql.Contains("部门名")) { ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'"); } DataTable dt_options = Hyoa_global.GetDataTable(ls_sql); ddlDropDownList.DataSource = dt_options; ddlDropDownList.DataTextField = dt_options.Columns[0].ColumnName; ddlDropDownList.DataValueField = dt_options.Columns[0].ColumnName; ddlDropDownList.DataBind(); } } ddlDropDownList.Items.Insert(0, new ListItem("--请选择--", "")); ddlDropDownList.SelectedValue = field_docvalue; tCell2.Controls.Add(ddlDropDownList); } } //复选框(查询时直接显示文本框) if (field_type == "复选框") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { CheckBoxList txtTextBox = new CheckBoxList(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { //手工配置 if (dtfield.Rows[0]["hy_options"].ToString() != "") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (int i = 0; i < lv_options.Length; i++) { txtTextBox.Items.Add(lv_options[i].ToString()); } } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { //SQL语句 //如果SQL语句中含有特殊标示,则需要替换 string ls_sql = dtfield.Rows[0]["hy_options"].ToString(); if (ls_sql.Contains("用户ID")) { ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'"); } if (ls_sql.Contains("用户名")) { ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'"); } if (ls_sql.Contains("部门ID")) { ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'"); } if (ls_sql.Contains("部门名")) { ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'"); } if (dtfield.Rows[0]["hy_options"].ToString() != "") { DataTable dt_options = Hyoa_global.GetDataTable(ls_sql); txtTextBox.DataSource = dt_options; txtTextBox.DataTextField = dt_options.Columns[0].ColumnName; txtTextBox.DataValueField = dt_options.Columns[0].ColumnName; txtTextBox.DataBind(); } } if (field_docvalue != "") { field_docvalue = "," + field_docvalue + ","; foreach (ListItem li in txtTextBox.Items) { if (field_docvalue.Contains(li.Value)) li.Selected = true; } } tCell2.Controls.Add(txtTextBox); } } //单选框(查询时直接显示文本框) if (field_type == "单选框") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { RadioButtonList txtTextBox = new RadioButtonList(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { //手工配置 if (dtfield.Rows[0]["hy_options"].ToString() != "") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (int i = 0; i < lv_options.Length; i++) { txtTextBox.Items.Add(lv_options[i].ToString()); } } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { //SQL语句 //如果SQL语句中含有特殊标示,则需要替换 string ls_sql = dtfield.Rows[0]["hy_options"].ToString(); if (ls_sql.Contains("用户ID")) { ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'"); } if (ls_sql.Contains("用户名")) { ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'"); } if (ls_sql.Contains("部门ID")) { ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'"); } if (ls_sql.Contains("部门名")) { ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'"); } if (dtfield.Rows[0]["hy_options"].ToString() != "") { DataTable dt_options = Hyoa_global.GetDataTable(ls_sql); txtTextBox.DataSource = dt_options; txtTextBox.DataTextField = dt_options.Columns[0].ColumnName; txtTextBox.DataValueField = dt_options.Columns[0].ColumnName; txtTextBox.DataBind(); } } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //口令 if (field_type == "口令") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = " "; tCell2.Controls.Add(txtTextBox); } else { TextBox txtTextBox = new TextBox(); txtTextBox.TextMode = TextBoxMode.Password; txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } if (dtfield.Rows[0]["hy_width"].ToString() != "") { txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString()); } if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); } if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "") { txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString()); } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString()); } if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "") { txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString()); } if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "") { txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //附件组件 if (field_type == "附件组件") { //读取附件内容 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatheridandFatherfield(this.txtdocid.Value, hy_fieldid); field_docvalue = ""; if (dt_fileatt.Rows.Count > 0) { for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++) { field_docvalue += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "</a><br />"; } } //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); if (field_docvalue == "") { field_docvalue = " "; } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); field_docvalue += "<input type=button id='uploadfile1' value='附件管理' class=btn3 onclick=\"window.open('ggdy/main_fileatt.aspx?fatherid=" + this.txtdocid.Value + "&fatherfield=" + hy_fieldid + "','filewindow','height=350,width=600,top=100,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');\" />"; txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //说明文字 if (field_type == "说明文字") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //编辑器 if (field_type == "编辑器") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { //隐藏文本框 TextBox txtTextBox = new TextBox(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; txtTextBox.Style.Value = "display:none"; tCell2.Controls.Add(txtTextBox); //编辑器 Label txtTextBox2 = new Label(); txtTextBox2.ID = "eWebEditor" + dtfield.Rows[0]["hy_fieldid"].ToString(); field_docvalue = "<iframe ID=\"eWebEditor" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"system/eWebEditor/ewebeditor.htm?id=" + dtfield.Rows[0]["hy_fieldid"].ToString() + "&style=Portal\" frameborder=0 scrolling=no width=" + dtfield.Rows[0]["hy_width"].ToString() + " height=" + dtfield.Rows[0]["hy_height"].ToString() + "></iframe>"; txtTextBox2.Text = field_docvalue; tCell2.Controls.Add(txtTextBox2); } } //痕迹保留 if (field_type == "痕迹保留") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正 文' class=btn3 onclick=\"window.open('ntko/readoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=1&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> "; Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> "; //如果是流程模块,则根据环节判断一下 if (ifflowdoc == "1") { //判断是否为第一环节 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, "*"); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == this.hy_curtacheid.Text) { field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> "; } else { //判断是否为最后一个环节 dtflowwork.Clear(); dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**") { field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=0&jsxd=1&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> "; } else { field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=0&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> "; } } } } } Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //IFRAME列表 if (field_type == "IFRAME列表") { //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { field_docvalue = "<iframe id=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" name=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"" + dtfield.Rows[0]["hy_defaultvalue"].ToString() + "&motherid=" + this.txtdocid.Value + "&ishaverole=0\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>"; Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { field_docvalue = "<iframe id=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" name=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"" + dtfield.Rows[0]["hy_defaultvalue"].ToString() + "&motherid=" + this.txtdocid.Value + "&ishaverole=1\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>"; Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } } //子表信息带链接 //子表信息不带链接 } return li_return; }
//加载主表单 Written by xf 20110515 private void DataPlay() { txtsavefields.Text = ""; txtsavefields_sx.Text = ""; if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); #region 新文档 if (this.Request.QueryString["op"] == "add") { this.td_ydry.Visible = false; //新文档时,“已读人员”按钮隐藏 this.txtiffirsttache.Value = "1"; //新文档时,“是否第一环节”置为1 //文档ID(保存POST到当前页面时,DOCID不重新加载) if (!this.IsPostBack) { this.txtdocid.Value = Hyoa_global.GetRandom(); this.hy_djsj.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } this.hy_djrid.Text = this.Session["hyuid"].ToString(); this.hy_djrname.Text = this.Session["hyuname"].ToString(); this.hy_djrbmid.Text = this.Session["hydeptid"].ToString(); this.hy_djrbmname.Text = this.Session["hydeptname"].ToString(); HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); if (dt_tableconfig.Rows.Count > 0) { if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是") { //根据模块ID得到流程信息 HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text); if (dt.Rows.Count > 0) { //判断当前用户是否有登记权限 //得到第一环节ID string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString()); if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString())) { this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString(); this.hy_curclrid.Text = this.Session["hyuid"].ToString(); this.hy_curclrname.Text = this.Session["hyuname"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_nexttachename"].ToString(); this.txtSystemClRight.Value = "1"; //-------条件流程start------- HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid); if (dt_firsttache.Rows.Count > 0) { if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是") ConditionFlow(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid); } //-------条件流程end------- } else { if (this.txtifpop.Value == "") { this.td_submit.Visible = false; this.td_nextstep.Visible = false; Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>"); return; } else { this.td_submit.Visible = false; this.td_nextstep.Visible = false; Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>"); return; } } } dt.Clear(); this.td_nextstep.Visible = true; //提交 } } //加载页面 if (this.hy_tableid.Text == "Tablefpbd") { this.td_dc.Visible = true; } GetMainTableHtml("0", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text); this.td_submit.Visible = true; //保存 hywebopen_newdoc(); //新文档OPEN时的特殊处理 } #endregion #region 旧文档 if (this.Request.QueryString["op"] == "modify") { this.td_browseflow.Visible = true; //查看流程 if (this.Request.QueryString["docid"] != null) { this.txtdocid.Value = this.Request.QueryString["docid"].ToString(); string sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "' "; DataTable dt = Hyoa_global.GetDataTable(sql); if (dt.Rows.Count > 0) { this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString(); this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString(); this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString(); this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString(); this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString(); this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString(); this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString(); this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString(); this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString(); if (!this.IsPostBack) { this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString(); } this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString(); this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString(); this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString(); this.hy_readdatelist.Text = dt.Rows[0]["hy_readdatelist"].ToString(); this.hy_clrylist.Text = dt.Rows[0]["hy_clrylist"].ToString(); this.hy_cyrylist.Text = dt.Rows[0]["hy_cyrylist"].ToString(); this.hy_motherid.Text = dt.Rows[0]["hy_motherid"].ToString(); this.hy_ifconfirm.Text = dt.Rows[0]["hy_ifconfirm"].ToString(); UpdateReadFlag(); //打开时添加阅读情况 } dt.Clear(); //流程已结束 if (this.hy_curtacheid.Text == "**") { this.lblcurtachenameshow.Text = "流程已结束"; //20111216 add start if (this.hy_mudelid.Text == "Mudelfwgl" || this.hy_mudelid.Text == "Mudelswgl") { //有发布权限 if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") { this.td_fabu.Visible = true; //收发文模块流程结束后显示发布按钮 //收发文流程结束后分发轮阅 20140809 hjadd start this.td_ffly.Visible = true; //收发文模块流程结束后显示分发按钮 //收发文流程结束后分发轮阅 20140809 hjadd start } } //20111216 add end //判断是否为传阅人 HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); if (dt.Rows.Count > 0) { this.txtSystemClRight.Value = "0"; this.txtSystemYdRight.Value = "1"; } //判断是否历史处理人 //判断是否是历史处理人员 if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtifhistoryclr.Value = "1"; this.txtSystemClRight.Value = "0"; this.txtSystemYdRight.Value = "1"; } } else { //////////////流程未结束/////////////////////// //判断是否为当前处理人 if (("," + this.hy_curclrid.Text + ",").IndexOf(("," + this.Session["hyuid"].ToString() + ",")) >= 0) { this.txtSystemClRight.Value = "1"; this.td_submit.Visible = true; //保存 this.td_nextstep.Visible = true; //提交 if (this.hy_curtacheid.Text != "tache0001") { this.td_returnsumbit.Visible = true; //退回 } //-------条件流程start------- HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dt_firsttache.Rows.Count > 0) { if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是") ConditionFlow(this.hy_flowid.Text, this.hy_curtacheid.Text); } //-------条件流程end------- } else { //判断是否为传阅人 HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); if (dt.Rows.Count > 0) { this.txtSystemYdRight.Value = "1"; } //判断是否是上一环节处理人 if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtiflastclr.Value = "1"; this.txtSystemYdRight.Value = "1"; this.td_withdraw.Visible = true; //收回 this.td_press.Visible = true; //催办 } else { //判断是否是历史处理人员 if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtifhistoryclr.Value = "1"; this.txtSystemYdRight.Value = "1"; this.td_press.Visible = true; //催办 } } } //判断是否为第一个环节 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); DataTable dt_flowhistoryinfo_cl = Hyoa_flowhistoryinfo_cl.Getflowhistoryinfo_clsbydocid(this.txtdocid.Value); if (dt_flowhistoryinfo_cl.Rows.Count == 1) { this.txtiffirsttache.Value = "1"; //旧文档时,如果历史处理环节中只有一条记录,“是否第一环节”置为1 } dt_flowhistoryinfo_cl.Clear(); //判断是否为最后一个环节 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**") this.txtiflasttache.Value = "1"; } dtflowwork.Clear(); //////////////流程未结束/////////////////////// } //如果表单是流程后公开显示,则置为阅读权限 if (this.hy_curtacheid.Text == "**") { HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(this.hy_tableid.Text); if (dt_tableconfig.Rows.Count > 0) { if (dt_tableconfig.Rows[0]["hy_ispuballByflowYB"].ToString() == "是") { this.txtSystemYdRight.Value = "1"; } } } //没有操作权限的用户,如果是全权用户,则置为阅读权限 ADD BY XF 2011-11-17 if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0") { //得到当前模块对应的全权用户组 HyoaClass.Hyoa_mudel Hyoa_mudel_forqqyh = new HyoaClass.Hyoa_mudel(); DataTable dt_mudel_forqqyh = Hyoa_mudel_forqqyh.Getmudel(this.hy_mudelid.Text); if (dt_mudel_forqqyh.Rows.Count > 0) { if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != null) { if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != "") { string ls_role_forqqyh = dt_mudel_forqqyh.Rows[0]["hy_qqroleid"].ToString(); HyoaClass.Hyoa_global Hyoa_global_forqqyh = new HyoaClass.Hyoa_global(); if (Hyoa_global_forqqyh.isHaveRole(ls_role_forqqyh, this.Session["hyuid"].ToString())) { this.txtSystemYdRight.Value = "1"; //阅读权限 } } } } } //指定的特殊模块,流转过程中,所有人员可以浏览该文档 hySetYdRight_TS(); //如果是“可修改所有文档的权限人员”,则可以修改所有的,可以把已办文件转在办 if (Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString())) { this.txtSystemYdRight.Value = "1"; this.td_submit.Visible = true; //保存 if (this.hy_curtacheid.Text == "**") this.td_ybtozb.Visible = true; //已办转在办 } //既没有处理权限,又没有阅读权限的情况下 if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0") { if (this.txtifpop.Value == "") { this.td_submit.Visible = false; this.td_nextstep.Visible = false; Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>"); return; } else { this.td_submit.Visible = false; this.td_nextstep.Visible = false; Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>"); return; } } //加载页面 if (this.hy_tableid.Text == "Tablefpbd") { this.td_dc.Visible = true; } GetMainTableHtml("1", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text); //----加载补充意见页面 s add by xf 2013-6-24----- HyoaClass.Hyoa_tableconfig Hyoa_tableconfig_forbcyj = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig_forbcyj = Hyoa_tableconfig_forbcyj.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); if (dt_tableconfig_forbcyj.Rows.Count > 0) { if (dt_tableconfig_forbcyj.Rows[0]["hy_ifcomment"] != null) { if (dt_tableconfig_forbcyj.Rows[0]["hy_ifcomment"].ToString() == "是") { this.tb_nbsp.Visible = true; this.tb_bctitle.Visible = true; this.tb_bcbody.Visible = true; if (this.txtSystemClRight.Value == "0") { this.td_bcyj.Visible = true; this.tr_bcyj.Visible = true; } //得到已经补充意见内容 HyoaClass.Hyoa_bcyj Hyoa_bcyj = new HyoaClass.Hyoa_bcyj(); DataTable dt_bcyj = Hyoa_bcyj.GetdocsByfatherid(this.txtdocid.Value); if (dt_bcyj.Rows.Count > 0) { //输出补充意见记录 this.lblbody_bcyj.Text = ""; for (var i = 0; i < dt_bcyj.Rows.Count; i++) { this.lblbody_bcyj.Text += dt_bcyj.Rows[i]["hy_bcbody"].ToString() + "<br> "; this.lblbody_bcyj.Text += "(补充意见人:" + dt_bcyj.Rows[i]["hy_bcusername"].ToString() + " 所在部门:" + dt_bcyj.Rows[i]["hy_bcdeptname"].ToString(); this.lblbody_bcyj.Text += " 补充时间:" + dt_bcyj.Rows[i]["hy_bctime"].ToString() + " IP:" + dt_bcyj.Rows[i]["hy_bcip"].ToString(); this.lblbody_bcyj.Text += ")<br><hr height=1 color=#DEEEFE></hr>"; } } } } } //----加载补充意见页面 e----- } hywebopen_olddoc(); //旧文档OPEN的特殊处理 } #endregion } }
//得到某一个字段的HTML Written by xf 20110515 //pi_flag 0:不赋值 1:需赋值 //ifsearch:是否查询时使用 0:非查询时使用 1:查询时使用 //docid:旧文档使用时,文档ID,新文档则为空就可以 //ifhavarole:是否有权限 0:lable输出 1:input输出 public string GetFieldHtml(string hy_mudelid, string hy_fieldid, string pi_flag, string hy_tableid, string ifsearch, string docid, string ifhavarole) { HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(hy_mudelid, hy_fieldid, hy_tableid); HyoaClass.DAO db = new HyoaClass.DAO(); string lsField = ""; string field_css = ""; string field_value = ""; string field_functionhy_onclick = ""; string field_functionhy_ondblclick = ""; string field_functionhy_onchange = ""; string field_functionhy_onkeydown = ""; string field_functionhy_onkeyup = ""; string field_wordlimit = ""; if (dtfield.Rows.Count > 0) { //得到该字段的样式start if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { if (ifsearch == "0") field_css += " readonly "; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { field_css += " class='" + dtfield.Rows[0]["hy_class"].ToString() + "' "; } if (dtfield.Rows[0]["hy_width"].ToString() != "") { field_css += " style='width:" + dtfield.Rows[0]["hy_width"].ToString() + ";"; } else { field_css += " style='"; } if (dtfield.Rows[0]["hy_height"].ToString() != "") { field_css += " height:" + dtfield.Rows[0]["hy_height"].ToString() + "'"; } else { field_css += "'"; } //得到字数限制 if (dtfield.Rows[0]["hy_wordlimit"].ToString() != "") { field_wordlimit += " maxlength='" + dtfield.Rows[0]["hy_wordlimit"].ToString() + "' "; } //默认值 //默认值取值的方式,查询时不使用默认值 if (ifsearch == "0") { if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "") { if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "0") field_value += dtfield.Rows[0]["hy_defaultvalue"].ToString(); if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "1") { DataTable dtdefault = db.GetDataTable(dtfield.Rows[0]["hy_defaultvalue"].ToString()); if (dtdefault.Rows.Count > 0) field_value += dtdefault.Rows[0][0].ToString(); } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "2") { field_value += Session[dtfield.Rows[0]["hy_defaultvalue"].ToString()].ToString(); } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "3") { if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") field_value += System.DateTime.Now.ToShortDateString(); else field_value += System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } //自动生成值的情况 Added by xf 20110719 if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "4") { if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值") { //得到目前最大的数值,然后+1,未找到则赋值为1 HyoaClass.DAO db_autovalue = new HyoaClass.DAO(); DataTable dt_autovalue = db_autovalue.GetDataTable("select max(hy_field36) as maxint from hyp_flowmain where hy_tableid='" + dtfield.Rows[0]["hy_tableid"].ToString() + "'"); if (dt_autovalue.Rows[0]["maxint"].ToString() == null || dt_autovalue.Rows[0]["maxint"].ToString() == "") field_value += "1"; else field_value += (System.Int32.Parse(dt_autovalue.Rows[0]["maxint"].ToString()) + 1).ToString(); } else { field_value += System.Guid.NewGuid().ToString(); } } } } //事件 if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { field_functionhy_onclick += " onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "") { field_functionhy_ondblclick += " ondblclick=\"" + dtfield.Rows[0]["hy_ondblclick"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { field_functionhy_onchange += " onchange=\"" + dtfield.Rows[0]["hy_onchange"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "") { field_functionhy_onkeydown += " onkeydown=\"" + dtfield.Rows[0]["hy_onkeydown"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "") { field_functionhy_onkeyup += " onkeyup=\"" + dtfield.Rows[0]["hy_onkeyup"].ToString() + "\" "; } //得到该字段的样式end string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString(); //是否需要赋值,如果需要赋值,得到当前字段对应的值(日期型需要根据格式进行转换) string field_docvalue = ""; //this.Response.Write("<script>alert('" + pi_flag + "');</script>"); if (pi_flag == "1") { HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain(); DataTable dt_flowmain = Hyoa_flowmain.Getflowmain(docid); if (dt_flowmain.Rows.Count > 0) { if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") { field_docvalue = System.DateTime.Parse(dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString()).ToShortDateString(); } else { //如果SQL为数值的字段部分,则需要截取小数点后边两位 if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值") { if (dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString().Contains(".") == true) field_docvalue = float.Parse(dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString()).ToString("F2"); else field_docvalue = dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString(); } else { field_docvalue = dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString(); } } } } //如果没有权限,直接输出lable //this.Response.Write("<script>alert('" + ifhavarole + "');</script>"); if (ifhavarole == "0") { //痕迹保留 if (field_type == "痕迹保留") { lsField += "<input type=button id=\"btn_zwxg\" value='正 文' class=btn3 onclick=\"window.open('ntko/readoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=1&jsxd=1','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" "; } else { //附件组件 if (field_type == "附件组件") { //根据docid得到目前已上传的附件信息 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(docid); if (dt_fileatt.Rows.Count > 0) { for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++) { string ls_name = ""; DataTable dt_user = Hyoa_user.Getuser(dt_fileatt.Rows[ii]["hy_userid"].ToString()); if (dt_user.Rows.Count > 0) { ls_name = dt_user.Rows[0]["hy_username"].ToString(); } lsField += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + " " + ls_name + " [" + dt_fileatt.Rows[ii]["hy_djsj"].ToString() + "]" + "</a><br />"; } } else { lsField += " "; } } else { //ztmztmztm2start if (field_docvalue.Length > 8) { if (field_docvalue.Substring(0, 8) == "1900-1-1") { field_docvalue = " "; } } //ztmztmztm2end lsField = field_docvalue + " "; } } } else { //单行文本 if (field_type == "文本") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">"; else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">"; } //多行文本 if (field_type == "多行文本") { //格式化内容,将<br>转为/n if (field_docvalue.Contains("<br>")) field_docvalue = field_docvalue.Replace("<br>", "\n"); if (pi_flag == "0") lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_css + field_wordlimit + " >" + field_value + "</textarea>"; else lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_css + field_wordlimit + " >" + field_docvalue + "</textarea>"; } //日期 if (field_type == "日期") { //this.Response.Write("<script>alert('aaaaaa');</script>"); //this.Response.Write("<script>alert('" + pi_flag + "');</script>"); if (ifsearch == "0") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">"; else { //add ztm3 start if (field_docvalue.Length > 7) { if (field_docvalue.Substring(0, 8) == "1900-1-1") { field_docvalue = ""; } } //add ztm3 end lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">"; } } else { //this.Response.Write("<script>alert('aaaa');</script>"); lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">至"; lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">"; } } //文本加按钮 if (field_type == "文本加按钮") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\"> <input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >"; else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_docvalue + "\"> <input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >"; } //多行文本加按钮 if (field_type == "多行文本加按钮") { //格式化内容,将<br>转为/n if (field_docvalue.Contains("<br>")) field_docvalue = field_docvalue.Replace("<br>", "\n"); if (pi_flag == "0") lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_wordlimit + " " + field_css + " >" + field_value + "</textarea> <input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >"; else lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_wordlimit + " " + field_css + " >" + field_docvalue + "</textarea> <input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >"; } //数值 if (field_type == "数值") { if (ifsearch == "0") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">"; else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">"; } else { lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">到"; lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">"; } } //对话框列表(下拉框 if (field_type == "对话框列表") { lsField = "<select name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onchange + field_css + "> "; //第一项:请选择 lsField += "<option value=''>--请选择--</option>"; //有哪些选项 if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (var ii = 0; ii < lv_options.Length; ii++) { if (pi_flag == "0") { lsField += "<option value='" + lv_options[ii].ToString() + "'>" + lv_options[ii].ToString() + "</option>"; } else { if (field_docvalue == lv_options[ii].ToString()) lsField += "<option value='" + lv_options[ii].ToString() + "' selected>" + lv_options[ii].ToString() + "</option>"; else lsField += "<option value='" + lv_options[ii].ToString() + "'>" + lv_options[ii].ToString() + "</option>"; } } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); if (dtoptions.Rows.Count > 0) { for (var ii = 0; ii < dtoptions.Rows.Count; ii++) { if (pi_flag == "0") { lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "'>" + dtoptions.Rows[ii][0].ToString() + "</option>"; } else { if (field_docvalue == dtoptions.Rows[ii][0].ToString()) lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "' selected>" + dtoptions.Rows[ii][0].ToString() + "</option>"; else lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "'>" + dtoptions.Rows[ii][0].ToString() + "</option>"; } } } } lsField += "</select>"; } //复选框 if (field_type == "复选框") { //有哪些选项 if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (var ii = 0; ii < lv_options.Length; ii++) { if (pi_flag == "0") { if (field_value == lv_options[ii].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } else { if (field_docvalue.Contains(lv_options[ii].ToString())) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); if (dtoptions.Rows.Count > 0) { for (var ii = 0; ii < dtoptions.Rows.Count; ii++) { if (pi_flag == "0") { if (field_value == dtoptions.Rows[ii][0].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } else { if (field_docvalue.Contains(dtoptions.Rows[ii][0].ToString())) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } } } } } //单选框 if (field_type == "单选框") { //有哪些选项 if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (var ii = 0; ii < lv_options.Length; ii++) { if (pi_flag == "0") { if (field_value == lv_options[ii].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } else { if (field_docvalue == lv_options[ii].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); if (dtoptions.Rows.Count > 0) { for (var ii = 0; ii < dtoptions.Rows.Count; ii++) { if (pi_flag == "0") { if (field_value == dtoptions.Rows[ii][0].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } else { if (field_docvalue == dtoptions.Rows[ii][0].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } } } } } //口令 if (field_type == "口令") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=password id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">"; else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=password id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">"; } //附件组件 if (field_type == "附件组件") { lsField = ""; //根据docid得到目前已上传的附件信息 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(docid); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); if (dt_fileatt.Rows.Count > 0) { for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++) { string ls_name = ""; DataTable dt_user = Hyoa_user.Getuser(dt_fileatt.Rows[ii]["hy_userid"].ToString()); if (dt_user.Rows.Count > 0) { ls_name = dt_user.Rows[0]["hy_username"].ToString(); } lsField += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "</a> " + ls_name + " [" + dt_fileatt.Rows[ii]["hy_djsj"].ToString() + "]" + "<br />"; } } lsField += "<input type=button id=\"uploadfile1\" value='附件管理' class=btn3 onclick=\"window.open('/ggdy/main_fileatt.aspx?fatherid=" + docid + "','newwindow','height=350,width=600,top=100,left=200,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no');\" "; } //说明文字 if (field_type == "说明文字") { lsField = "<span id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\">" + field_value + "</span>"; } //编辑器 if (field_type == "编辑器") { //lsField = "<textarea name=\"hy_content1_1\" id=\"hy_content1_1\" style=\"display:none\" runat="server">" + field_docvalue + "</textarea>"; lsField += "<iframe ID=\"eWebEditor1\" src=\"system/eWebEditor/ewebeditor.htm?id=" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "&style=Portal\" frameborder=\"0\" scrolling=\"no\" width=\"100%\" height=\"350\"></iframe>"; } //痕迹保留 //this.Response.Write("<script>alert('" + field_type + "');</script>"); if (field_type == "痕迹保留") { //判断是否为第一环节 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, "*"); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == this.hy_curtacheid.Text) { lsField += "<input type=button id=\"btn_zwxg\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=1&jsxd=0','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" "; } else { //判断是否为最后一个环节 dtflowwork.Clear(); dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**") { lsField += "<input type=button id=\"btn_zwxg\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=0&jsxd=1','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" "; } else { lsField += "<input type=button id=\"btn_zwxg\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=0&jsxd=0','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" "; } } } } } } db.Close(); } return lsField; }
//条件流程 //根据流程ID和环节ID,得到后续环节,进行身份过滤,JS条件暂不过滤 private void ConditionFlow(string pi_flowid, string pi_tacheid) { this.txtenablecondition.Text = "是"; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable dt = Hyoa_flowwork.Getflowworkbyflowidtacheid(pi_flowid, pi_tacheid); Boolean b_flag = false; //是否加载这个环节的标志位 if (dt.Rows.Count > 0) { for (var i = 0; i < dt.Rows.Count; i++) { b_flag = false; if (dt.Rows[i]["hy_identity_type"] == null || dt.Rows[i]["hy_identity_type"].ToString() == "") { //加载没有设置条件的环节 b_flag = true; } else { //设置了条件,开始判断 if (dt.Rows[i]["hy_identity_type"].ToString() != "" && dt.Rows[i]["hy_identity_id"].ToString() != "") { if (dt.Rows[i]["hy_identity_type"].ToString() == "属于") { if (Hyoa_global.isHaveRole(dt.Rows[i]["hy_identity_id"].ToString(), Session["hyuid"].ToString()) == true) { b_flag = true; } } else { if (Hyoa_global.isHaveRole(dt.Rows[i]["hy_identity_id"].ToString(), Session["hyuid"].ToString()) == false) { b_flag = true; } } } } //开始加载 if (b_flag == true) { ddlnexttache.Items.Add(new ListItem(dt.Rows[i]["hy_nexttachename"].ToString(), dt.Rows[i]["hy_nexttacheid"].ToString())); ddljscondition.Items.Add(new ListItem(dt.Rows[i]["hy_jscondition"].ToString(), dt.Rows[i]["hy_jscondition"].ToString())); } } } }
//保存 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>"); } }
//加载主表单 Written by xf 20110515 private void DataPlay() { if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 //新文档 if (this.Request.QueryString["op"] == "add") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //文档ID this.txtdocid.Value = Hyoa_global.GetRandom(); this.hy_djrid.Text = this.Session["hyuid"].ToString(); this.hy_djrname.Text = this.Session["hyuname"].ToString(); this.hy_djrbmid.Text = this.Session["hydeptid"].ToString(); this.hy_djrbmname.Text = this.Session["hydeptname"].ToString(); this.hy_djsj.Text = System.DateTime.Now.ToString(); if (this.txtifhaveflow.Value == "是") { HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); if (dt_tableconfig.Rows.Count > 0) { if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是") { //根据模块ID得到流程信息 HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text); //Response.Write("<script>alert('"+dt.Rows.Count.ToString()+"')</script>"); if (dt.Rows.Count > 0) { //判断当前用户是否有登记权限 //得到第一环节ID string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString()); if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString())) { this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString(); this.hy_curclrid.Text = this.Session["hyuid"].ToString(); this.hy_curclrname.Text = this.Session["hyuname"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_nexttachename"].ToString(); this.txtSystemClRight.Value = "1"; } else { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');history.back();</script>"); } } dt.Clear(); this.td_nextstep.Visible = true; //提交 } } //加载页面 this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "0", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text); this.rptlist.DataBind(); this.td_submit.Visible = true; //保存 } else { this.lblcurtachenameshow.Text = this.lbltablename.Text; //如果非流程(授权用户统一管理) if (this.txttablerole.Value == "0") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息) if (this.txttablerole.Value == "1") { this.txtSystemClRight.Value = "1"; } //如果非流程(每个人操作自己的信息、授权用户可管理所有信息) if (this.txttablerole.Value == "2") { this.txtSystemClRight.Value = "1"; } if (this.txtSystemClRight.Value == "1") this.td_submit.Visible = true; //保存 else this.td_submit.Visible = false; //保存 //加载页面 this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "0", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "0", ""); this.rptlist.DataBind(); } hywebopen_newdoc(); //新文档OPEN时的特殊处理 } //旧文档 if (this.Request.QueryString["op"] == "modify") { this.td_browseflow.Visible = true; //查看流程 if (this.Request.QueryString["docid"] != null) { this.txtdocid.Value = this.Request.QueryString["docid"].ToString(); HyoaClass.Hyoa_flowmain flowmain = new HyoaClass.Hyoa_flowmain(); DataTable dt = flowmain.Getflowmain(this.txtdocid.Value); if (dt.Rows.Count > 0) { this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString(); this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString(); this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString(); this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString(); this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString(); this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString(); this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString(); this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString(); this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString(); this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString(); this.hy_content1.Text = dt.Rows[0]["hy_content1"].ToString(); this.hy_content2.Text = dt.Rows[0]["hy_content2"].ToString(); this.hy_content3.Text = dt.Rows[0]["hy_content3"].ToString(); this.hy_content4.Text = dt.Rows[0]["hy_content4"].ToString(); this.hy_content5.Text = dt.Rows[0]["hy_content5"].ToString(); this.hy_content6.Text = dt.Rows[0]["hy_content6"].ToString(); this.hy_content7.Text = dt.Rows[0]["hy_content7"].ToString(); this.hy_content8.Text = dt.Rows[0]["hy_content8"].ToString(); this.hy_content9.Text = dt.Rows[0]["hy_content9"].ToString(); this.hy_content10.Text = dt.Rows[0]["hy_content10"].ToString(); this.hy_content11.Text = dt.Rows[0]["hy_content11"].ToString(); this.hy_content12.Text = dt.Rows[0]["hy_content12"].ToString(); this.hy_content13.Text = dt.Rows[0]["hy_content13"].ToString(); this.hy_content14.Text = dt.Rows[0]["hy_content14"].ToString(); this.hy_content15.Text = dt.Rows[0]["hy_content15"].ToString(); this.hy_field1.Text = dt.Rows[0]["hy_field1"].ToString(); this.hy_field2.Text = dt.Rows[0]["hy_field2"].ToString(); this.hy_field3.Text = dt.Rows[0]["hy_field3"].ToString(); this.hy_field4.Text = dt.Rows[0]["hy_field4"].ToString(); this.hy_field5.Text = dt.Rows[0]["hy_field5"].ToString(); this.hy_field6.Text = dt.Rows[0]["hy_field6"].ToString(); this.hy_field7.Text = dt.Rows[0]["hy_field7"].ToString(); this.hy_field8.Text = dt.Rows[0]["hy_field8"].ToString(); this.hy_field9.Text = dt.Rows[0]["hy_field9"].ToString(); this.hy_field10.Text = dt.Rows[0]["hy_field10"].ToString(); this.hy_field11.Text = dt.Rows[0]["hy_field11"].ToString(); this.hy_field12.Text = dt.Rows[0]["hy_field12"].ToString(); this.hy_field13.Text = dt.Rows[0]["hy_field13"].ToString(); this.hy_field14.Text = dt.Rows[0]["hy_field14"].ToString(); this.hy_field15.Text = dt.Rows[0]["hy_field15"].ToString(); this.hy_field16.Text = dt.Rows[0]["hy_field16"].ToString(); this.hy_field17.Text = dt.Rows[0]["hy_field17"].ToString(); this.hy_field18.Text = dt.Rows[0]["hy_field18"].ToString(); this.hy_field19.Text = dt.Rows[0]["hy_field19"].ToString(); this.hy_field20.Text = dt.Rows[0]["hy_field20"].ToString(); this.hy_field21.Text = dt.Rows[0]["hy_field21"].ToString(); this.hy_field22.Text = dt.Rows[0]["hy_field22"].ToString(); this.hy_field23.Text = dt.Rows[0]["hy_field23"].ToString(); this.hy_field24.Text = dt.Rows[0]["hy_field24"].ToString(); this.hy_field25.Text = dt.Rows[0]["hy_field25"].ToString(); this.hy_field26.Text = dt.Rows[0]["hy_field26"].ToString(); this.hy_field27.Text = dt.Rows[0]["hy_field27"].ToString(); this.hy_field28.Text = dt.Rows[0]["hy_field28"].ToString(); this.hy_field29.Text = dt.Rows[0]["hy_field29"].ToString(); this.hy_field30.Text = dt.Rows[0]["hy_field30"].ToString(); this.hy_field31.Text = dt.Rows[0]["hy_field31"].ToString(); this.hy_field32.Text = dt.Rows[0]["hy_field32"].ToString(); this.hy_field33.Text = dt.Rows[0]["hy_field33"].ToString(); this.hy_field34.Text = dt.Rows[0]["hy_field34"].ToString(); this.hy_field35.Text = dt.Rows[0]["hy_field35"].ToString(); this.hy_field36.Text = dt.Rows[0]["hy_field36"].ToString(); this.hy_field37.Text = dt.Rows[0]["hy_field37"].ToString(); this.hy_field38.Text = dt.Rows[0]["hy_field38"].ToString(); this.hy_field39.Text = dt.Rows[0]["hy_field39"].ToString(); this.hy_field40.Text = dt.Rows[0]["hy_field40"].ToString(); this.hy_field41.Text = dt.Rows[0]["hy_field41"].ToString(); this.hy_field42.Text = dt.Rows[0]["hy_field42"].ToString(); this.hy_field43.Text = dt.Rows[0]["hy_field43"].ToString(); this.hy_field44.Text = dt.Rows[0]["hy_field44"].ToString(); this.hy_field45.Text = dt.Rows[0]["hy_field45"].ToString(); this.hy_field46.Text = dt.Rows[0]["hy_field46"].ToString(); this.hy_field47.Text = dt.Rows[0]["hy_field47"].ToString(); this.hy_field48.Text = dt.Rows[0]["hy_field48"].ToString(); this.hy_field49.Text = dt.Rows[0]["hy_field49"].ToString(); this.hy_field50.Text = dt.Rows[0]["hy_field50"].ToString(); this.hy_field51.Text = dt.Rows[0]["hy_field51"].ToString(); this.hy_field52.Text = dt.Rows[0]["hy_field52"].ToString(); this.hy_field53.Text = dt.Rows[0]["hy_field53"].ToString(); this.hy_field54.Text = dt.Rows[0]["hy_field54"].ToString(); this.hy_field55.Text = dt.Rows[0]["hy_field55"].ToString(); this.hy_field56.Text = dt.Rows[0]["hy_field56"].ToString(); this.hy_field57.Text = dt.Rows[0]["hy_field57"].ToString(); this.hy_field58.Text = dt.Rows[0]["hy_field58"].ToString(); this.hy_field59.Text = dt.Rows[0]["hy_field59"].ToString(); this.hy_field60.Text = dt.Rows[0]["hy_field60"].ToString(); this.hy_field61.Text = dt.Rows[0]["hy_field61"].ToString(); this.hy_field62.Text = dt.Rows[0]["hy_field62"].ToString(); this.hy_field63.Text = dt.Rows[0]["hy_field63"].ToString(); this.hy_field64.Text = dt.Rows[0]["hy_field64"].ToString(); this.hy_field65.Text = dt.Rows[0]["hy_field65"].ToString(); this.hy_field66.Text = dt.Rows[0]["hy_field66"].ToString(); this.hy_field67.Text = dt.Rows[0]["hy_field67"].ToString(); this.hy_field68.Text = dt.Rows[0]["hy_field68"].ToString(); this.hy_field69.Text = dt.Rows[0]["hy_field69"].ToString(); this.hy_field70.Text = dt.Rows[0]["hy_field70"].ToString(); this.hy_field71.Text = dt.Rows[0]["hy_field71"].ToString(); this.hy_field72.Text = dt.Rows[0]["hy_field72"].ToString(); this.hy_field73.Text = dt.Rows[0]["hy_field73"].ToString(); this.hy_field74.Text = dt.Rows[0]["hy_field74"].ToString(); this.hy_field75.Text = dt.Rows[0]["hy_field75"].ToString(); this.hy_field76.Text = dt.Rows[0]["hy_field76"].ToString(); this.hy_field77.Text = dt.Rows[0]["hy_field77"].ToString(); this.hy_field78.Text = dt.Rows[0]["hy_field78"].ToString(); this.hy_field79.Text = dt.Rows[0]["hy_field79"].ToString(); this.hy_field80.Text = dt.Rows[0]["hy_field80"].ToString(); this.hy_field81.Text = dt.Rows[0]["hy_field81"].ToString(); this.hy_field82.Text = dt.Rows[0]["hy_field82"].ToString(); this.hy_field83.Text = dt.Rows[0]["hy_field83"].ToString(); this.hy_field84.Text = dt.Rows[0]["hy_field84"].ToString(); this.hy_field85.Text = dt.Rows[0]["hy_field85"].ToString(); this.hy_field86.Text = dt.Rows[0]["hy_field86"].ToString(); this.hy_field87.Text = dt.Rows[0]["hy_field87"].ToString(); this.hy_field88.Text = dt.Rows[0]["hy_field88"].ToString(); this.hy_field89.Text = dt.Rows[0]["hy_field89"].ToString(); this.hy_field90.Text = dt.Rows[0]["hy_field90"].ToString(); this.hy_field91.Text = dt.Rows[0]["hy_field91"].ToString(); this.hy_field92.Text = dt.Rows[0]["hy_field92"].ToString(); this.hy_field93.Text = dt.Rows[0]["hy_field93"].ToString(); this.hy_field94.Text = dt.Rows[0]["hy_field94"].ToString(); this.hy_field95.Text = dt.Rows[0]["hy_field95"].ToString(); this.hy_field96.Text = dt.Rows[0]["hy_field96"].ToString(); this.hy_field97.Text = dt.Rows[0]["hy_field97"].ToString(); this.hy_field98.Text = dt.Rows[0]["hy_field98"].ToString(); this.hy_field99.Text = dt.Rows[0]["hy_field99"].ToString(); this.hy_field100.Text = dt.Rows[0]["hy_field100"].ToString(); this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString(); this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString(); this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString(); //信息管理市局录用记录 特殊显示取消按钮用于删除复制的这条数据 if (this.hy_mudelid.Text == "xxgl" && this.hy_tableid.Text == "f1265875-5494-465f-ac33-6fa43d208c8f" && this.hy_field100.Text == "1") { //this.td_qx.Visible = true; this.td_return.Visible = false; } HyoaClass.DAO DAO = new HyoaClass.DAO(); string sql_SelectCount = "select count(*) as num from hyp_flowhistoryinfo_cl where docid='" + this.txtdocid.Value + "'"; DataTable dt_Count = DAO.GetDataTable(sql_SelectCount); if (dt_Count.Rows.Count > 0) { this.txtclts.Value = dt_Count.Rows[0]["num"].ToString(); } } dt.Clear(); //流程文档 if (this.txtifhaveflow.Value == "是") { //流程已结束 if (this.hy_curtacheid.Text == "**") { //////////////流程已结束/////////////////////// this.lblcurtachenameshow.Text = "流程已结束"; UpdateReadFlag(); //打开时置为已读 //////////////流程已结束/////////////////////// } else { //////////////流程未结束/////////////////////// //判断是否为当前处理人 if (this.hy_curclrid.Text.IndexOf(this.Session["hyuid"].ToString()) >= 0) { this.txtSystemClRight.Value = "1"; this.td_submit.Visible = true; //保存 this.td_nextstep.Visible = true; //提交 this.td_returnsumbit.Visible = true; //退回 } else { //判断是否为传阅人 HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); if (dt.Rows.Count > 0) { this.txtSystemYdRight.Value = "1"; } //判断是否是上一环节处理人 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtiflastclr.Value = "1"; this.txtSystemYdRight.Value = "1"; this.td_withdraw.Visible = true; //收回 this.td_press.Visible = true; //催办 } else { //判断是否是历史处理人员 if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtifhistoryclr.Value = "1"; this.txtSystemYdRight.Value = "1"; this.td_press.Visible = true; //催办 } } } //判断是否为最后一个环节 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**") this.txtiflasttache.Value = "1"; } dtflowwork.Clear(); //既没有处理权限,又没有阅读权限的情况下 if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0") { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');history.back();</script>"); } //////////////流程未结束/////////////////////// } //加载页面 this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "1", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text); this.rptlist.DataBind(); ////////补充意见s 只要是旧文档,且有流程的模块就能填写轮阅意见 this.tb_bctitle.Visible = true; this.tb_bcbody.Visible = true; //流程已结束 if (this.hy_curtacheid.Text == "**") { this.tr_bcyj.Visible = false; } else { this.tr_bcyj.Visible = true; } //得到已经补充意见内容 HyoaClass.Hyoa_bcyj Hyoa_bcyj = new HyoaClass.Hyoa_bcyj(); DataTable dt_bcyj = Hyoa_bcyj.GetdocsByfatherid(this.txtdocid.Value); if (dt_bcyj.Rows.Count > 0) { //输出补充意见记录 this.lblbody_bcyj.Text = ""; for (var i = 0; i < dt_bcyj.Rows.Count; i++) { this.lblbody_bcyj.Text += dt_bcyj.Rows[i]["hy_bcbody"].ToString() + "<br> "; this.lblbody_bcyj.Text += "(轮阅人:" + dt_bcyj.Rows[i]["hy_bcusername"].ToString() + " 所在部门:" + dt_bcyj.Rows[i]["hy_bcdeptname"].ToString(); this.lblbody_bcyj.Text += " 填写时间:" + dt_bcyj.Rows[i]["hy_bctime"].ToString(); //+ " IP:" + dt_bcyj.Rows[i]["hy_bcip"].ToString(); this.lblbody_bcyj.Text += ")<br><hr height=1 color=#DEEEFE></hr>"; } } ////////补充意见e } else { this.lblcurtachenameshow.Text = this.lbltablename.Text; //非流程表单 this.td_nextstep.Visible = false; this.td_withdraw.Visible = false; this.td_returnsumbit.Visible = false; this.td_press.Visible = false; this.td_browseflow.Visible = false; ////////////判断当前表单是否为只显示个人 //////////HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); //////////DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); //////////if (dt_tableconfig.Rows.Count > 0) //////////{ ////////// //不是流程文档,不显示所有记录 ////////// if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "否" && dt_tableconfig.Rows[0]["hy_ifdisplayall"].ToString() == "否") ////////// { ////////// //判断是否为当前文档登记人 ////////// if(this.hy_djrid.Text==Session["hyuid"].ToString()) ////////// this.txtSystemClRight.Value = "1"; ////////// } ////////// else ////////// { ////////// if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") ////////// this.txtSystemClRight.Value = "1"; ////////// } //////////} //如果非流程(授权用户统一管理) if (this.txttablerole.Value == "0") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息) if (this.txttablerole.Value == "1") { //判断是否为当前文档登记人 if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } //如果非流程(每个人操作自己的信息、授权用户可管理所有信息) if (this.txttablerole.Value == "2") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") { this.txtSystemClRight.Value = "1"; } else { if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } } if (this.txtSystemClRight.Value == "1") { //只有登记人和管理员可以修改,有保存按钮 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (this.hy_djrid.Text == Session["hyuid"].ToString() || Hyoa_global.isHaveRole("Role9999", Session["hyuid"].ToString())) { this.td_submit.Visible = true; //保存 //信息管理市局录用记录 if (this.hy_mudelid.Text == "xxgl" && this.hy_tableid.Text == "f1265875-5494-465f-ac33-6fa43d208c8f") { this.td_sc.Visible = false; //删除 } } else { this.td_submit.Visible = false; //保存 } } else { this.td_submit.Visible = false; //保存 } //加载页面 this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "1", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "0", ""); this.rptlist.DataBind(); UpdateReadFlag(); //打开时置为已读 } } hywebopen_olddoc(); //旧文档OPEN的特殊处理 } } }
//保存 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>"); } }
//加载主表单 Written by xf 20110515 private void DataPlay() { if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 //新文档 if (this.Request.QueryString["op"] == "add") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //文档ID this.txtdocid.Value = Hyoa_global.GetRandom(); this.hy_djrid.Text = this.Session["hyuid"].ToString(); this.hy_djrname.Text = this.Session["hyuname"].ToString(); this.hy_djrbmid.Text = this.Session["hydeptid"].ToString(); this.hy_djrbmname.Text = this.Session["hydeptname"].ToString(); this.hy_djsj.Text = System.DateTime.Now.ToString(); if (this.txtifhaveflow.Value == "是") { HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); if (dt_tableconfig.Rows.Count > 0) { if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是") { //根据模块ID得到流程信息 HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text); //Response.Write("<script>alert('"+dt.Rows.Count.ToString()+"')</script>"); if (dt.Rows.Count > 0) { //判断当前用户是否有登记权限 //得到第一环节ID string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString()); if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString())) { this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString(); this.hy_curclrid.Text = this.Session["hyuid"].ToString(); this.hy_curclrname.Text = this.Session["hyuname"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_nexttachename"].ToString(); this.txtSystemClRight.Value = "1"; } else { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');history.back();</script>"); } } dt.Clear(); this.td_nextstep.Visible = true; //提交 } } //加载页面 this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "0", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text); this.rptlist.DataBind(); this.td_submit.Visible = true; //保存 } else { this.lblcurtachenameshow.Text = this.lbltablename.Text; //如果非流程(授权用户统一管理) if (this.txttablerole.Value == "0") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息) if (this.txttablerole.Value == "1") { this.txtSystemClRight.Value = "1"; } //如果非流程(每个人操作自己的信息、授权用户可管理所有信息) if (this.txttablerole.Value == "2") { this.txtSystemClRight.Value = "1"; } if(this.txtSystemClRight.Value == "1") this.td_submit.Visible = true; //保存 else this.td_submit.Visible = false; //保存 //加载页面 this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "0", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "0", ""); this.rptlist.DataBind(); } hywebopen_newdoc(); //新文档OPEN时的特殊处理 } //旧文档 if (this.Request.QueryString["op"] == "modify") { this.td_browseflow.Visible = true; //查看流程 if (this.Request.QueryString["docid"] != null) { this.txtdocid.Value = this.Request.QueryString["docid"].ToString(); HyoaClass.Hyoa_flowmain flowmain = new HyoaClass.Hyoa_flowmain(); DataTable dt = flowmain.Getflowmain(this.txtdocid.Value); if (dt.Rows.Count > 0) { this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString(); this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString(); this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString(); this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString(); this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString(); this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString(); this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString(); this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString(); this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString(); this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString(); this.hy_content1.Text = dt.Rows[0]["hy_content1"].ToString(); this.hy_content2.Text = dt.Rows[0]["hy_content2"].ToString(); this.hy_content3.Text = dt.Rows[0]["hy_content3"].ToString(); this.hy_content4.Text = dt.Rows[0]["hy_content4"].ToString(); this.hy_content5.Text = dt.Rows[0]["hy_content5"].ToString(); this.hy_content6.Text = dt.Rows[0]["hy_content6"].ToString(); this.hy_content7.Text = dt.Rows[0]["hy_content7"].ToString(); this.hy_content8.Text = dt.Rows[0]["hy_content8"].ToString(); this.hy_content9.Text = dt.Rows[0]["hy_content9"].ToString(); this.hy_content10.Text = dt.Rows[0]["hy_content10"].ToString(); this.hy_content11.Text = dt.Rows[0]["hy_content11"].ToString(); this.hy_content12.Text = dt.Rows[0]["hy_content12"].ToString(); this.hy_content13.Text = dt.Rows[0]["hy_content13"].ToString(); this.hy_content14.Text = dt.Rows[0]["hy_content14"].ToString(); this.hy_content15.Text = dt.Rows[0]["hy_content15"].ToString(); this.hy_field1.Text = dt.Rows[0]["hy_field1"].ToString(); this.hy_field2.Text = dt.Rows[0]["hy_field2"].ToString(); this.hy_field3.Text = dt.Rows[0]["hy_field3"].ToString(); this.hy_field4.Text = dt.Rows[0]["hy_field4"].ToString(); this.hy_field5.Text = dt.Rows[0]["hy_field5"].ToString(); this.hy_field6.Text = dt.Rows[0]["hy_field6"].ToString(); this.hy_field7.Text = dt.Rows[0]["hy_field7"].ToString(); this.hy_field8.Text = dt.Rows[0]["hy_field8"].ToString(); this.hy_field9.Text = dt.Rows[0]["hy_field9"].ToString(); this.hy_field10.Text = dt.Rows[0]["hy_field10"].ToString(); this.hy_field11.Text = dt.Rows[0]["hy_field11"].ToString(); this.hy_field12.Text = dt.Rows[0]["hy_field12"].ToString(); this.hy_field13.Text = dt.Rows[0]["hy_field13"].ToString(); this.hy_field14.Text = dt.Rows[0]["hy_field14"].ToString(); this.hy_field15.Text = dt.Rows[0]["hy_field15"].ToString(); this.hy_field16.Text = dt.Rows[0]["hy_field16"].ToString(); this.hy_field17.Text = dt.Rows[0]["hy_field17"].ToString(); this.hy_field18.Text = dt.Rows[0]["hy_field18"].ToString(); this.hy_field19.Text = dt.Rows[0]["hy_field19"].ToString(); this.hy_field20.Text = dt.Rows[0]["hy_field20"].ToString(); this.hy_field21.Text = dt.Rows[0]["hy_field21"].ToString(); this.hy_field22.Text = dt.Rows[0]["hy_field22"].ToString(); this.hy_field23.Text = dt.Rows[0]["hy_field23"].ToString(); this.hy_field24.Text = dt.Rows[0]["hy_field24"].ToString(); this.hy_field25.Text = dt.Rows[0]["hy_field25"].ToString(); this.hy_field26.Text = dt.Rows[0]["hy_field26"].ToString(); this.hy_field27.Text = dt.Rows[0]["hy_field27"].ToString(); this.hy_field28.Text = dt.Rows[0]["hy_field28"].ToString(); this.hy_field29.Text = dt.Rows[0]["hy_field29"].ToString(); this.hy_field30.Text = dt.Rows[0]["hy_field30"].ToString(); this.hy_field31.Text = dt.Rows[0]["hy_field31"].ToString(); this.hy_field32.Text = dt.Rows[0]["hy_field32"].ToString(); this.hy_field33.Text = dt.Rows[0]["hy_field33"].ToString(); this.hy_field34.Text = dt.Rows[0]["hy_field34"].ToString(); this.hy_field35.Text = dt.Rows[0]["hy_field35"].ToString(); this.hy_field36.Text = dt.Rows[0]["hy_field36"].ToString(); this.hy_field37.Text = dt.Rows[0]["hy_field37"].ToString(); this.hy_field38.Text = dt.Rows[0]["hy_field38"].ToString(); this.hy_field39.Text = dt.Rows[0]["hy_field39"].ToString(); this.hy_field40.Text = dt.Rows[0]["hy_field40"].ToString(); this.hy_field41.Text = dt.Rows[0]["hy_field41"].ToString(); this.hy_field42.Text = dt.Rows[0]["hy_field42"].ToString(); this.hy_field43.Text = dt.Rows[0]["hy_field43"].ToString(); this.hy_field44.Text = dt.Rows[0]["hy_field44"].ToString(); this.hy_field45.Text = dt.Rows[0]["hy_field45"].ToString(); this.hy_field46.Text = dt.Rows[0]["hy_field46"].ToString(); this.hy_field47.Text = dt.Rows[0]["hy_field47"].ToString(); this.hy_field48.Text = dt.Rows[0]["hy_field48"].ToString(); this.hy_field49.Text = dt.Rows[0]["hy_field49"].ToString(); this.hy_field50.Text = dt.Rows[0]["hy_field50"].ToString(); this.hy_field51.Text = dt.Rows[0]["hy_field51"].ToString(); this.hy_field52.Text = dt.Rows[0]["hy_field52"].ToString(); this.hy_field53.Text = dt.Rows[0]["hy_field53"].ToString(); this.hy_field54.Text = dt.Rows[0]["hy_field54"].ToString(); this.hy_field55.Text = dt.Rows[0]["hy_field55"].ToString(); this.hy_field56.Text = dt.Rows[0]["hy_field56"].ToString(); this.hy_field57.Text = dt.Rows[0]["hy_field57"].ToString(); this.hy_field58.Text = dt.Rows[0]["hy_field58"].ToString(); this.hy_field59.Text = dt.Rows[0]["hy_field59"].ToString(); this.hy_field60.Text = dt.Rows[0]["hy_field60"].ToString(); this.hy_field61.Text = dt.Rows[0]["hy_field61"].ToString(); this.hy_field62.Text = dt.Rows[0]["hy_field62"].ToString(); this.hy_field63.Text = dt.Rows[0]["hy_field63"].ToString(); this.hy_field64.Text = dt.Rows[0]["hy_field64"].ToString(); this.hy_field65.Text = dt.Rows[0]["hy_field65"].ToString(); this.hy_field66.Text = dt.Rows[0]["hy_field66"].ToString(); this.hy_field67.Text = dt.Rows[0]["hy_field67"].ToString(); this.hy_field68.Text = dt.Rows[0]["hy_field68"].ToString(); this.hy_field69.Text = dt.Rows[0]["hy_field69"].ToString(); this.hy_field70.Text = dt.Rows[0]["hy_field70"].ToString(); this.hy_field71.Text = dt.Rows[0]["hy_field71"].ToString(); this.hy_field72.Text = dt.Rows[0]["hy_field72"].ToString(); this.hy_field73.Text = dt.Rows[0]["hy_field73"].ToString(); this.hy_field74.Text = dt.Rows[0]["hy_field74"].ToString(); this.hy_field75.Text = dt.Rows[0]["hy_field75"].ToString(); this.hy_field76.Text = dt.Rows[0]["hy_field76"].ToString(); this.hy_field77.Text = dt.Rows[0]["hy_field77"].ToString(); this.hy_field78.Text = dt.Rows[0]["hy_field78"].ToString(); this.hy_field79.Text = dt.Rows[0]["hy_field79"].ToString(); this.hy_field80.Text = dt.Rows[0]["hy_field80"].ToString(); this.hy_field81.Text = dt.Rows[0]["hy_field81"].ToString(); this.hy_field82.Text = dt.Rows[0]["hy_field82"].ToString(); this.hy_field83.Text = dt.Rows[0]["hy_field83"].ToString(); this.hy_field84.Text = dt.Rows[0]["hy_field84"].ToString(); this.hy_field85.Text = dt.Rows[0]["hy_field85"].ToString(); this.hy_field86.Text = dt.Rows[0]["hy_field86"].ToString(); this.hy_field87.Text = dt.Rows[0]["hy_field87"].ToString(); this.hy_field88.Text = dt.Rows[0]["hy_field88"].ToString(); this.hy_field89.Text = dt.Rows[0]["hy_field89"].ToString(); this.hy_field90.Text = dt.Rows[0]["hy_field90"].ToString(); this.hy_field91.Text = dt.Rows[0]["hy_field91"].ToString(); this.hy_field92.Text = dt.Rows[0]["hy_field92"].ToString(); this.hy_field93.Text = dt.Rows[0]["hy_field93"].ToString(); this.hy_field94.Text = dt.Rows[0]["hy_field94"].ToString(); this.hy_field95.Text = dt.Rows[0]["hy_field95"].ToString(); this.hy_field96.Text = dt.Rows[0]["hy_field96"].ToString(); this.hy_field97.Text = dt.Rows[0]["hy_field97"].ToString(); this.hy_field98.Text = dt.Rows[0]["hy_field98"].ToString(); this.hy_field99.Text = dt.Rows[0]["hy_field99"].ToString(); this.hy_field100.Text = dt.Rows[0]["hy_field100"].ToString(); this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString(); this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString(); this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString(); } dt.Clear(); //流程文档 if (this.txtifhaveflow.Value == "是") { //流程已结束 if (this.hy_curtacheid.Text == "**") { //////////////流程已结束/////////////////////// this.lblcurtachenameshow.Text = "流程已结束"; UpdateReadFlag(); //打开时置为已读 //////////////流程已结束/////////////////////// } else { //////////////流程未结束/////////////////////// //判断是否为当前处理人 if (this.hy_curclrid.Text.IndexOf(this.Session["hyuid"].ToString()) >= 0) { this.txtSystemClRight.Value = "1"; this.td_submit.Visible = true; //保存 this.td_nextstep.Visible = true; //提交 this.td_returnsumbit.Visible = true; //退回 } else { //判断是否为传阅人 HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); if (dt.Rows.Count > 0) { this.txtSystemYdRight.Value = "1"; } //判断是否是上一环节处理人 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtiflastclr.Value = "1"; this.txtSystemYdRight.Value = "1"; this.td_withdraw.Visible = true; //收回 this.td_press.Visible = true; //催办 } else { //判断是否是历史处理人员 if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtifhistoryclr.Value = "1"; this.txtSystemYdRight.Value = "1"; this.td_press.Visible = true; //催办 } } } //判断是否为最后一个环节 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**") this.txtiflasttache.Value = "1"; } dtflowwork.Clear(); //既没有处理权限,又没有阅读权限的情况下 if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0") { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');history.back();</script>"); } //////////////流程未结束/////////////////////// } //加载页面 this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "1", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text); this.rptlist.DataBind(); } else { this.lblcurtachenameshow.Text = this.lbltablename.Text; //非流程表单 this.td_nextstep.Visible = false; this.td_withdraw.Visible = false; this.td_returnsumbit.Visible = false; this.td_press.Visible = false; this.td_browseflow.Visible = false; ////////////判断当前表单是否为只显示个人 //////////HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); //////////DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); //////////if (dt_tableconfig.Rows.Count > 0) //////////{ ////////// //不是流程文档,不显示所有记录 ////////// if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "否" && dt_tableconfig.Rows[0]["hy_ifdisplayall"].ToString() == "否") ////////// { ////////// //判断是否为当前文档登记人 ////////// if(this.hy_djrid.Text==Session["hyuid"].ToString()) ////////// this.txtSystemClRight.Value = "1"; ////////// } ////////// else ////////// { ////////// if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") ////////// this.txtSystemClRight.Value = "1"; ////////// } //////////} //如果非流程(授权用户统一管理) if (this.txttablerole.Value == "0") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息) if (this.txttablerole.Value == "1") { //判断是否为当前文档登记人 if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } //如果非流程(每个人操作自己的信息、授权用户可管理所有信息) if (this.txttablerole.Value == "2") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") { this.txtSystemClRight.Value = "1"; } else { if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } } if (this.txtSystemClRight.Value == "1") this.td_submit.Visible = true; //保存 else this.td_submit.Visible = false; //保存 //加载页面 this.rptlist.DataSource = GetDataTableFieldHtml(this.hy_mudelid.Text, this.hy_tableid.Text, "1", "0", this.txtdocid.Value, this.txtSystemClRight.Value, "0",""); this.rptlist.DataBind(); UpdateReadFlag(); //打开时置为已读 } } hywebopen_olddoc(); //旧文档OPEN的特殊处理 } } }
//保存 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>"); } }
//加载主表单 Written by xf 20110515 private void DataPlay() { if (this.Request.QueryString["op"] != null) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 //新文档 if (this.Request.QueryString["op"] == "add") { //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //文档ID this.txtdocid.Value = Hyoa_global.GetRandom(); this.hy_djrid.Text = this.Session["hyuid"].ToString(); this.hy_djrname.Text = this.Session["hyuname"].ToString(); this.hy_djrbmid.Text = this.Session["hydeptid"].ToString(); this.hy_djrbmname.Text = this.Session["hydeptname"].ToString(); this.hy_djsj.Text = System.DateTime.Now.ToString(); this.txthyc_nf.Text = System.DateTime.Now.ToString("yyyy"); this.txthyc_djsj.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); this.txthyc_lxks.Text = this.Session["hydeptname"].ToString(); this.txthyc_lxr.Text = this.Session["hyuname"].ToString(); HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); if (dt_tableconfig.Rows.Count > 0) { if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是") { //根据模块ID得到流程信息 HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text); //Response.Write("<script>alert('"+dt.Rows.Count.ToString()+"')</script>"); if (dt.Rows.Count > 0) { //判断当前用户是否有登记权限 //得到第一环节ID string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString()); if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString())) { this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString(); this.hy_curclrid.Text = this.Session["hyuid"].ToString(); this.hy_curclrname.Text = this.Session["hyuname"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_nexttachename"].ToString(); this.txtSystemClRight.Value = "1"; this.txtSystemYdRight.Value = "0"; } else { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');</script>"); } } dt.Clear(); this.td_nextstep.Visible = true; //提交 this.td_submit.Visible = true; //保存 } } //加载页面 WebOpen(this.hy_mudelid.Text, this.hy_tableid.Text, this.hy_flowid.Text, this.hy_curtacheid.Text, this.txtSystemClRight.Value, this.txtSystemYdRight.Value, "0"); } //旧文档 if (this.Request.QueryString["op"] == "modify") { this.td_browseflow.Visible = true; //查看流程 if (this.Request.QueryString["docid"] != null) { this.txtdocid.Value = this.Request.QueryString["docid"].ToString(); //HyoaClass.Hyoa_flowmain flowmain = new HyoaClass.Hyoa_flowmain(); //DataTable dt = flowmain.Getflowmain(this.txtdocid.Value); //HyoaClass.Hyoa_global Hyoa_global=new HyoaClass.Hyoa_global (); string lssql = "select * from hyc_Tabledcxt where DOCID='" + this.txtdocid.Value + "'"; DataTable dt = Hyoa_global.GetDataTable(lssql); if (dt.Rows.Count > 0) { this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString(); this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString(); this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString(); this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString(); this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString(); this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString(); this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString(); this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString(); this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString(); this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString(); string lssqlfield = "SELECT * FROM hyt_flowfield WHERE (hy_tableid = 'Tabledcxt') AND (hy_mudelid = 'Mudeldcxt')"; DataTable dtfield = Hyoa_global.GetDataTable_BASE(lssqlfield); //得到所有配置域 for (int ii = 0; ii < dtfield.Rows.Count; ii++) { if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "文本") { TextBox txt1 = (TextBox)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()); txt1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString(); Label lbl1 = (Label)this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()); lbl1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString(); } if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "多行文本") { TextBox txt1 = (TextBox)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()); txt1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString(); Label lbl1 = (Label)this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()); lbl1.Text = RtfToText2(dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString()); } if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "日期") { TextBox txt1 = (TextBox)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()); Label lbl1 = (Label)this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()); if (dtfield.Rows[ii]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") { txt1.Text = System.DateTime.Parse(dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString()).ToShortDateString(); lbl1.Text = System.DateTime.Parse(dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString()).ToShortDateString(); } else { txt1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString(); lbl1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString(); } } if (dtfield.Rows[ii]["hy_fieldtype"].ToString() == "对话框列表") { DropDownList ddl1 = (DropDownList)this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()); ddl1.SelectedValue = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString(); Label lbl1 = (Label)this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()); lbl1.Text = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString(); } //this.FindControl("11111"). = "1"; //this.FindControl("txthyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()).value = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString(); //this.FindControl("lblhyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()).value = dt.Rows[0]["hyc_" + dtfield.Rows[ii]["hy_fieldid"].ToString()].ToString(); } //this.txthyc_nf.Text = dt.Rows[0]["hyc_nf"].ToString(); //this.txthyc_bh.Text = dt.Rows[0]["hyc_bh"].ToString(); //this.txthyc_lb.SelectedValue = dt.Rows[0]["hyc_lb"].ToString(); //this.txthyc_hj.SelectedValue = dt.Rows[0]["hyc_hj"].ToString(); //this.txthyc_djsj.Text = dt.Rows[0]["hyc_djsj"].ToString(); //this.txthyc_cbdw.Text = dt.Rows[0]["hyc_cbdw"].ToString(); //this.txthyc_dcsx.Text = dt.Rows[0]["hyc_dcsx"].ToString(); //this.txthyc_blyq.Text = dt.Rows[0]["hyc_blyq"].ToString(); //this.txthyc_lxks.Text = dt.Rows[0]["hyc_lxks"].ToString(); //this.txthyc_lxr.Text = dt.Rows[0]["hyc_lxr"].ToString(); //this.txthyc_lxdh.Text = dt.Rows[0]["hyc_lxdh"].ToString(); //this.txthyc_cbqx.Text = dt.Rows[0]["hyc_cbqx"].ToString(); //this.lblhyc_nf.Text = dt.Rows[0]["hyc_nf"].ToString(); //this.lblhyc_bh.Text = dt.Rows[0]["hyc_bh"].ToString(); //this.lblhyc_lb.SelectedValue = dt.Rows[0]["hyc_lb"].ToString(); //this.lblhyc_hj.SelectedValue = dt.Rows[0]["hyc_hj"].ToString(); //this.lblhyc_djsj.Text = dt.Rows[0]["hyc_djsj"].ToString(); //this.lblhyc_cbdw.Text = dt.Rows[0]["hyc_cbdw"].ToString(); //this.lblhyc_dcsx.Text = dt.Rows[0]["hyc_dcsx"].ToString(); //this.lblhyc_blyq.Text = dt.Rows[0]["hyc_blyq"].ToString(); //this.lblhyc_lxks.Text = dt.Rows[0]["hyc_lxks"].ToString(); //this.lblhyc_lxr.Text = dt.Rows[0]["hyc_lxr"].ToString(); //this.lblhyc_lxdh.Text = dt.Rows[0]["hyc_lxdh"].ToString(); //this.lblhyc_cbqx.Text = dt.Rows[0]["hyc_cbqx"].ToString(); this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString(); this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString(); this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString(); } dt.Clear(); //流程文档 if (this.txtifhaveflow.Value == "是") { //流程已结束 if (this.hy_curtacheid.Text == "**") { //////////////流程已结束/////////////////////// this.lblcurtachenameshow.Text = "流程已结束"; //UpdateReadFlag(); //打开时置为已读 //////////////流程已结束/////////////////////// //判断是否为传阅人 HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); if (dt.Rows.Count > 0) { this.txtSystemClRight.Value = "0"; this.txtSystemYdRight.Value = "1"; } //判断是否历史处理人 //判断是否是历史处理人员 //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtifhistoryclr.Value = "1"; this.txtSystemClRight.Value = "0"; this.txtSystemYdRight.Value = "1"; } } else { //////////////流程未结束/////////////////////// //判断是否为当前处理人 if (this.hy_curclrid.Text.IndexOf(this.Session["hyuid"].ToString()) >= 0) { this.txtSystemClRight.Value = "1"; this.txtSystemYdRight.Value = "0"; this.td_submit.Visible = true; //保存 this.td_nextstep.Visible = true; //提交 //this.td_returnsumbit.Visible = true; //退回 } else { //判断是否为传阅人 HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); if (dt.Rows.Count > 0) { this.txtSystemClRight.Value = "0"; this.txtSystemYdRight.Value = "1"; } //判断是否是上一环节处理人 //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtiflastclr.Value = "1"; this.txtSystemClRight.Value = "0"; this.txtSystemYdRight.Value = "1"; //this.td_withdraw.Visible = true; //收回 //this.td_press.Visible = true; //催办 } else { //判断是否是历史处理人员 if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtifhistoryclr.Value = "1"; this.txtSystemClRight.Value = "0"; this.txtSystemYdRight.Value = "1"; //this.td_press.Visible = true; //催办 } } } //判断是否为最后一个环节 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**") this.txtiflasttache.Value = "1"; } dtflowwork.Clear(); //////////////流程未结束/////////////////////// } //既没有处理权限,又没有阅读权限的情况下 if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0") { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');</script>"); } //加载页面 WebOpen(this.hy_mudelid.Text, this.hy_tableid.Text, this.hy_flowid.Text, this.hy_curtacheid.Text, this.txtSystemClRight.Value, this.txtSystemYdRight.Value, "1"); } } } //隐藏、显示控制 string lssqlfield5 = "SELECT * FROM hyt_flowfield WHERE (hy_tableid = 'Tabledcxt') AND (hy_mudelid = 'Mudeldcxt')"; DataTable dtfield5 = Hyoa_global.GetDataTable_BASE(lssqlfield5); //得到所有配置域 string lssqlflowtachefield = "";//流程环节对应的域 DataTable dtflowtachefield; for (int ii = 0; ii < dtfield5.Rows.Count; ii++) { lssqlflowtachefield = "select * from hyt_flowtachefield where hy_flowid = '" + this.hy_flowid.Text + "' and hy_tacheid = '" + this.hy_curtacheid.Text + "' and hy_fieldid='" + dtfield5.Rows[ii]["hy_fieldid"].ToString() + "'"; dtflowtachefield = Hyoa_global.GetDataTable_BASE(lssqlflowtachefield); if (dtflowtachefield.Rows.Count > 0) { this.FindControl("txthyc_" + dtfield5.Rows[ii]["hy_fieldid"].ToString()).Visible = true; this.FindControl("lblhyc_" + dtfield5.Rows[ii]["hy_fieldid"].ToString()).Visible = false; } else { this.FindControl("txthyc_" + dtfield5.Rows[ii]["hy_fieldid"].ToString()).Visible = false; this.FindControl("lblhyc_" + dtfield5.Rows[ii]["hy_fieldid"].ToString()).Visible = true; } } } }
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------- }
//保存 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>"); }
//加载主表单 Written by xf 20110515 private void DataPlay() { txtsavefields.Text = ""; txtsavefields_sx.Text = ""; if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //新文档 if (this.Request.QueryString["op"] == "add") { //文档ID(保存POST到当前页面时,DOCID不重新加载) if (!this.IsPostBack) { this.txtdocid.Value = Hyoa_global.GetRandom(); } this.hy_djrid.Text = this.Session["hyuid"].ToString(); this.hy_djrname.Text = this.Session["hyuname"].ToString(); this.hy_djrbmid.Text = this.Session["hydeptid"].ToString(); this.hy_djrbmname.Text = this.Session["hydeptname"].ToString(); this.hy_djsj.Text = System.DateTime.Now.ToString(); if (this.txtifhaveflow.Value == "是") { HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); if (dt_tableconfig.Rows.Count > 0) { if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "是") { //根据模块ID得到流程信息 HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); DataTable dt = Hyoa_flowinfor.Getfirsttacheinfobymudelid(this.hy_mudelid.Text); if (dt.Rows.Count > 0) { //判断当前用户是否有登记权限 //得到第一环节ID string ls_firsttacheid = Hyoa_global.GetFirstTacheid(dt.Rows[0]["hy_flowid"].ToString()); if (Hyoa_global.IfHaveRegiRight_Lc(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid, this.Session["hyuid"].ToString())) { this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_nexttacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_nexttachename"].ToString(); this.hy_curclrid.Text = this.Session["hyuid"].ToString(); this.hy_curclrname.Text = this.Session["hyuname"].ToString(); this.lblcurtachenameshow.Text = "当前环节:" + dt.Rows[0]["hy_nexttachename"].ToString(); this.txtSystemClRight.Value = "1"; //-------条件流程start------- HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid); if (dt_firsttache.Rows.Count > 0) { if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是") ConditionFlow(dt.Rows[0]["hy_flowid"].ToString(), ls_firsttacheid); } //-------条件流程end------- } else { if (this.txtifpop.Value == "") { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>"); this.td_submit.Visible = false; this.td_nextstep.Visible = false; return; } else { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>"); return; } } } dt.Clear(); this.td_nextstep.Visible = true; //提交 } } //加载页面 GetMainTableHtml("0", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text); this.td_submit.Visible = true; //保存 } else { //this.lblcurtachenameshow.Text = this.lbltablename.Text; //如果非流程(授权用户可新建信息、可删除所有信息) if (this.txttablerole.Value == "0") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息) if (this.txttablerole.Value == "1") { this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息、授权用户可管理所有信息) if (this.txttablerole.Value == "2") { this.txtSystemClRight.Value = "1"; } //如果非流程(授权用户可新建、只能删自己新建的信息) if (this.txttablerole.Value == "3") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } if (this.txtSystemClRight.Value == "1") { this.td_submit.Visible = true; //保存 } else { this.td_submit.Visible = false; //保存 } //加载页面 GetMainTableHtml("0", this.txtSystemClRight.Value, "0", ""); } hywebopen_newdoc(); //新文档OPEN时的特殊处理 } //旧文档 if (this.Request.QueryString["op"] == "modify") { this.td_browseflow.Visible = true; //查看流程 if (this.Request.QueryString["docid"] != null) { this.txtdocid.Value = this.Request.QueryString["docid"].ToString(); string sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "' "; DataTable dt = Hyoa_global.GetDataTable(sql); if (dt.Rows.Count > 0) { this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString(); this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString(); this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString(); this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString(); this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString(); this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString(); this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString(); this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString(); this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString(); this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString(); this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString(); this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString(); this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString(); this.hy_readdatelist.Text = dt.Rows[0]["hy_readdatelist"].ToString(); this.hy_motherid.Text = dt.Rows[0]["hy_motherid"].ToString(); this.hy_ifconfirm.Text = dt.Rows[0]["hy_ifconfirm"].ToString(); UpdateReadFlag(); //打开时添加阅读情况 } //dt.Clear(); //流程文档 if (this.txtifhaveflow.Value == "是") { this.lblcurtachenameshow.Text = "当前环节:" + dt.Rows[0]["hy_curtachename"].ToString(); //流程已结束 if (this.hy_curtacheid.Text == "**") { this.lblcurtachenameshow.Text = "当前环节:" + "流程已结束"; //20111216 add start if (this.hy_mudelid.Text == "Mudelfwgl" || this.hy_mudelid.Text == "Mudelswgl") { //有发布权限 if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.td_fabu.Visible = true; //收发文模块流程结束后显示发布按钮 } //20111216 add end //判断是否为传阅人 HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); if (dt.Rows.Count > 0) { this.txtSystemClRight.Value = "0"; this.txtSystemYdRight.Value = "1"; } //判断是否历史处理人 //判断是否是历史处理人员 if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtifhistoryclr.Value = "1"; this.txtSystemClRight.Value = "0"; this.txtSystemYdRight.Value = "1"; } } else { //////////////流程未结束/////////////////////// //判断是否为当前处理人 if (this.hy_curclrid.Text.IndexOf(this.Session["hyuid"].ToString()) >= 0) { this.txtSystemClRight.Value = "1"; this.td_submit.Visible = true; //保存 this.td_nextstep.Visible = true; //提交 this.td_returnsumbit.Visible = true; //退回 //-------条件流程start------- HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); DataTable dt_firsttache = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dt_firsttache.Rows.Count > 0) { if (dt_firsttache.Rows[0]["hy_enablecondition"].ToString() == "是") ConditionFlow(this.hy_flowid.Text, this.hy_curtacheid.Text); } //-------条件流程end------- } else { //判断是否为传阅人 HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); dt = Hyoa_flowhistoryinfo_cy.Getifcyrybydociduserid(this.txtdocid.Value, this.Session["hyuid"].ToString()); if (dt.Rows.Count > 0) { this.txtSystemYdRight.Value = "1"; } //判断是否是上一环节处理人 if (Hyoa_global.iflastclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtiflastclr.Value = "1"; this.txtSystemYdRight.Value = "1"; this.td_withdraw.Visible = true; //收回 this.td_press.Visible = true; //催办 } else { //判断是否是历史处理人员 if (Hyoa_global.ifhistoryclr(this.txtdocid.Value, this.Session["hyuid"].ToString())) { this.txtifhistoryclr.Value = "1"; this.txtSystemYdRight.Value = "1"; this.td_press.Visible = true; //催办 } } } //判断是否为最后一个环节 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**") this.txtiflasttache.Value = "1"; } dtflowwork.Clear(); //////////////流程未结束/////////////////////// } //如果表单是流程后公开显示,则置为阅读权限 if (this.hy_curtacheid.Text == "**") { HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(this.hy_tableid.Text); if (dt_tableconfig.Rows.Count > 0) { if (dt_tableconfig.Rows[0]["hy_ispuballByflowYB"].ToString() == "是") { this.txtSystemYdRight.Value = "1"; } } } //没有操作权限的用户,如果是全权用户,则置为阅读权限 ADD BY XF 2011-11-17 if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0") { //得到当前模块对应的全权用户组 HyoaClass.Hyoa_mudel Hyoa_mudel_forqqyh = new HyoaClass.Hyoa_mudel(); DataTable dt_mudel_forqqyh = Hyoa_mudel_forqqyh.Getmudel(this.hy_mudelid.Text); if (dt_mudel_forqqyh.Rows.Count > 0) { if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != null) { if (dt_mudel_forqqyh.Rows[0]["hy_qqroleid"] != "") { string ls_role_forqqyh = dt_mudel_forqqyh.Rows[0]["hy_qqroleid"].ToString(); HyoaClass.Hyoa_global Hyoa_global_forqqyh = new HyoaClass.Hyoa_global(); if (Hyoa_global_forqqyh.isHaveRole(ls_role_forqqyh, this.Session["hyuid"].ToString())) { this.txtSystemYdRight.Value = "1"; //阅读权限 } } } } } //指定的特殊模块,流转过程中,所有人员可以浏览该文档 hySetYdRight_TS(); //既没有处理权限,又没有阅读权限的情况下 if (this.txtSystemClRight.Value == "0" && this.txtSystemYdRight.Value == "0") { if (this.txtifpop.Value == "") { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');window.location='" + this.txturl.Value + "';</script>"); this.td_submit.Visible = false; this.td_nextstep.Visible = false; return; } else { Response.Write("<script>alert('您无权进行此项操作,请联系管理员!');self.close();</script>"); return; } } //加载页面 GetMainTableHtml("1", this.txtSystemClRight.Value, "1", this.hy_curtacheid.Text); } else { //this.lblcurtachenameshow.Text = this.lbltablename.Text; //非流程表单 this.td_nextstep.Visible = false; this.td_withdraw.Visible = false; this.td_returnsumbit.Visible = false; this.td_press.Visible = false; this.td_browseflow.Visible = false; ////////////判断当前表单是否为只显示个人 //////////HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); //////////DataTable dt_tableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); //////////if (dt_tableconfig.Rows.Count > 0) //////////{ ////////// //不是流程文档,不显示所有记录 ////////// if (dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString() == "否" && dt_tableconfig.Rows[0]["hy_ifdisplayall"].ToString() == "否") ////////// { ////////// //判断是否为当前文档登记人 ////////// if(this.hy_djrid.Text==Session["hyuid"].ToString()) ////////// this.txtSystemClRight.Value = "1"; ////////// } ////////// else ////////// { ////////// if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") ////////// this.txtSystemClRight.Value = "1"; ////////// } //////////} //如果非流程(授权用户统一管理) if (this.txttablerole.Value == "0") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息) if (this.txttablerole.Value == "1") { //判断是否为当前文档登记人 if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } //如果非流程(每个人操作自己的信息、授权用户可管理所有信息) if (this.txttablerole.Value == "2") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") { this.txtSystemClRight.Value = "1"; } else { if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } } //如果非流程(授权用户可新建、只能删自己新建的信息) if (this.txttablerole.Value == "3") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") { if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } } if (this.txtSystemClRight.Value == "1") { this.td_submit.Visible = true; //保存 } else { this.td_submit.Visible = false; //保存 } //加载主表单页面 GetMainTableHtml("1", this.txtSystemClRight.Value, "0", ""); } } hywebopen_olddoc(); //旧文档OPEN的特殊处理 } } }