protected void Page_Load(object sender, EventArgs e) { string ls_value = ""; //后续处理人 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(Request.QueryString["flowid"].ToString(), Request.QueryString["tacheid"].ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql_tj = ""; if (Session["conntype"].ToString() == "SQL") { sql_tj = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql_tj = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } DataTable dt2 = Hyoa_global.GetDataTable_USER(sql_tj); if (dt2.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt2.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt2.Rows[i]["hy_userid"].ToString() + ",")) { } else { if (ls_value == "") { ls_value = dt2.Rows[i]["hy_userid"].ToString() + "+" + dt2.Rows[i]["hy_username"].ToString(); } else { ls_value += "," + dt2.Rows[i]["hy_userid"].ToString() + "+" + dt2.Rows[i]["hy_username"].ToString(); } t += 1; ls_temp1 += "," + dt2.Rows[i]["hy_userid"].ToString(); } } } } Response.Write(ls_value); }
//查询 protected void Button_Save_Click(object sender, EventArgs e) { string ls_return = ""; if (txtsql.Value == "") { ls_return = "请填写查询语句"; } if (ddldbconn.SelectedValue == "") { ls_return = "请选择连接"; } HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dt = new DataTable(); if (ddldbconn.SelectedValue == "base") { dt = Hyoa_global.GetDataTable_BASE(txtsql.Value); } if (ddldbconn.SelectedValue == "pro") { dt = Hyoa_global.GetDataTable(txtsql.Value); } if (ddldbconn.SelectedValue == "user") { dt = Hyoa_global.GetDataTable_USER(txtsql.Value); } if (dt.Rows.Count > 0) { ls_return += "<table border=1 width='100%'>"; ls_return += "<tr>"; for (int j = 0; j < dt.Columns.Count; j++) { ls_return += "<td>" + dt.Columns[j].ToString() + "</td>"; } ls_return += "</tr>"; for (int i = 0; i < dt.Rows.Count; i++) { ls_return += "<tr>"; for (int j = 0; j < dt.Columns.Count; j++) { ls_return += "<td>"+dt.Rows[i][dt.Columns[j].ToString()].ToString()+"</td>"; } ls_return += "</tr>"; } ls_return += "</table>"; } lbljg.Text = ls_return; }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("login.aspx"); if (!IsPostBack) { //给下拉框赋值 客户经理 string sqlSelect = " SELECT hy_username FROM hyt_user WHERE (hy_deptid LIKE '005%') OR (hy_deptid LIKE '006%') "; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dt = Hyoa_global.GetDataTable_USER(sqlSelect); ddl_khjl.DataSource = dt; ddl_khjl.DataTextField = "hy_username"; ddl_khjl.DataValueField = "hy_username"; ddl_khjl.DataBind(); ddl_khjl.Items.Insert(0, new ListItem("--请选择--", "")); this.ddl_khjl.SelectedIndex = 0; } }
protected void Page_Load(object sender, EventArgs e) { string lsid = ""; if (this.Request.QueryString["id"] != null) { lsid = this.Request.QueryString["id"].ToString(); } HyoaClass.Hyoa_global db = new HyoaClass.Hyoa_global(); string lssql1 = "SELECT hy_userid,hy_username FROM hyt_user WHERE hy_deptid = '" + lsid + "' ORDER BY hy_sort "; DataTable dt1 = db.GetDataTable_USER(lssql1); string lsstr1 = "", lsstr2 = ""; if (dt1.Rows.Count > 0) { for (int i = 0; i < dt1.Rows.Count; i++) { if (lsstr1 == "") { lsstr1 = dt1.Rows[i]["hy_userid"].ToString(); } else { lsstr1 = lsstr1 + "," + dt1.Rows[i]["hy_userid"].ToString(); } if (lsstr2 == "") { lsstr2 = dt1.Rows[i]["hy_username"].ToString(); } else { lsstr2 = lsstr2 + "," + dt1.Rows[i]["hy_username"].ToString(); } } } this.Response.Write(lsstr2 + "|" + lsstr1); //return ; }
private void DataPlay() { //label清空 int count = 1; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sqlSelect = " select hyc_gzzq from hyc_Tablezbgl where 1=1 "; if (this.txt_tjz_s.Value != "") { sqlSelect += " and hy_djsj >= '" + this.txt_tjz_s.Value + "' "; } if (this.txt_tjz_e.Value != "") { sqlSelect += " and hy_djsj <='" + this.txt_tjz_e.Value + "' "; } sqlSelect += " GROUP BY hyc_gzzq "; DataTable dt = Hyoa_global.GetDataTable(sqlSelect); DataTable dt3; if(dt.Rows.Count>0) { sqlSelect = " select hy_userid,hy_username from hyt_user "; DataTable dt2 = Hyoa_global.GetDataTable_USER(sqlSelect); for(int j=0;j<dt.Rows.Count;j++) { if(dt2.Rows.Count>0) { for (int i = 0; i < dt2.Rows.Count;i++ ) { sqlSelect = " select * from hyc_Tablezbgl where 1=1 and hyc_gzzq='" + dt.Rows[j]["hyc_gzzq"].ToString() + "' and hy_djrid='" + dt2.Rows[i]["hy_userid"].ToString() + "' "; dt3 = Hyoa_global.GetDataTable(sqlSelect); if(dt3.Rows.Count==0) { Total++; lb_show.Text += " <tr height=\"35px\"><td width=\"5%\" class=\"TdcellHead\"><p align=\"center\">" + Total + "</p></td>"; lb_show.Text += "<td width=\"25%\" class=\"TdcellHead\"><p align=\"center\">第" + dt.Rows[j]["hyc_gzzq"].ToString() + "周</p></td>"; lb_show.Text += " <td width=\"30%\" class=\"TdcellHead\"><p align=\"center\"> " + dt2.Rows[i]["hy_username"].ToString() + "</p> </td>"; } } } } } }
protected void Page_Load(object sender, EventArgs e) { if(Request.QueryString["key"]!=null) { string ls_key = ""; ls_key = Request.QueryString["key"].ToString(); DataTable dt; string sql = "select * from hyt_user where hy_userid like '%" + ls_key + "%'"; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); dt = Hyoa_global.GetDataTable_USER(sql); string ls_name = ""; this.Response.Write("<div align=left id=sampleLayer style=\"position:absolute; top:130px; left:240px; width:250px; height:100px; background:#EEEEEE; overflow:scroll; border: 1px solid #919191; font-family:Verdana; font-size:8pt\">"); for (int i = 0; i < dt.Rows.Count; i++) { ls_name = ls_name + dt.Rows[i]["hy_userid"].ToString(); this.Response.Write("<li><a href=\"#\" onclick=\"if(document.forms[0].txthy_jsrname.value==''){document.forms[0].txthy_jsrname.value='" + dt.Rows[i]["hy_username"].ToString() + "';document.forms[0].txthy_jsrid.value='" + dt.Rows[i]["hy_userid"].ToString() + "';}else{document.forms[0].txthy_jsrname.value=document.forms[0].txthy_jsrname.value+'+" + dt.Rows[i]["hy_username"].ToString() + "';document.forms[0].txthy_jsrid.value=document.forms[0].txthy_jsrid.value+'+" + dt.Rows[i]["hy_userid"].ToString() + "';} document.all('sampleLayer').style.visibility='hidden'; \">" + dt.Rows[i]["hy_username"].ToString() + "</a></li>"); } this.Response.Write("</div>"); return; } }
protected void Page_Load(object sender, EventArgs e) { if(Request.QueryString["key"]!=null) { string ls_key = Request.QueryString["key"].ToString(); string ls_ret1 = "", ls_ret2 = ""; if (Request.QueryString["ret1"] != null) { ls_ret1 = Request.QueryString["ret1"].ToString(); } if (Request.QueryString["ret2"] != null) { ls_ret2 = Request.QueryString["ret2"].ToString(); } string sql = "select * from hyt_user where hy_userid like '%" + ls_key + "%'"; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dt = Hyoa_global.GetDataTable_USER(sql); this.Response.Write("<div align=left id=sampleLayer style=\" z-index: 999;position:absolute; width:260px; height:180px; overflow-y:scroll; font-family:Verdana; font-size:10pt; line-height:22px;\">"); for (int i = 0; i < dt.Rows.Count; i++) { string ls_id = dt.Rows[i]["hy_userid"].ToString(); string ls_name = dt.Rows[i]["hy_username"].ToString(); this.Response.Write("<li><a href=\"#\" onclick=\"if(window.parent.document.getElementById('" + ls_ret2 + "').value==''){ "); this.Response.Write("window.parent.document.getElementById('" + ls_ret2 + "').value='" + ls_name + "'; "); this.Response.Write("window.parent.document.getElementById('" + ls_ret1 + "').value='" + ls_id + "';}else{ "); this.Response.Write("window.parent.document.getElementById('" + ls_ret2 + "').value=window.parent.document.getElementById('" + ls_ret2 + "').value+'+" + ls_name + "'; "); this.Response.Write("window.parent.document.getElementById('" + ls_ret1 + "').value=window.parent.document.getElementById('" + ls_ret1 + "').value+'+" + ls_id + "';}"); this.Response.Write("window.parent.document.getElementById('divProvince').style.display='none';"); this.Response.Write("\"> " + ls_name + "</a></li>"); } this.Response.Write("</div>"); return; } }
protected void Page_Load(object sender, EventArgs e) { //根据用于id得到中文名 string lsuserid = "", lsoutput = "", sqlSelect = ""; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (this.Request.QueryString["userid"] != null) lsuserid = this.Request.QueryString["userid"].ToString(); if (lsuserid != "") { sqlSelect = " select hy_username from hyt_user where hy_userid = '" + lsuserid + "' "; DataTable dt = Hyoa_global.GetDataTable_USER(sqlSelect); if (dt.Rows.Count > 0) { lsoutput = dt.Rows[0]["hy_username"].ToString(); } else { lsoutput = ""; } } Response.Write(lsoutput); }
protected void Page_Load(object sender, EventArgs e) { string strJS = ""; if (this.Request.QueryString["state"] != null) { if (this.Request.QueryString["state"].ToString() == "1") { if (this.Request.QueryString["onclick"] != null) { strJS = Request.QueryString["onclick"].ToString(); } } } string lsfilevalue = ""; if (this.Request.QueryString["lsfilevalue"] != null) { lsfilevalue = this.Request.QueryString["lsfilevalue"].ToString(); } this.Response.Write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"); this.Response.Write("<html>"); this.Response.Write("<head>"); this.Response.Write("<style type=\"text/css\">"); this.Response.Write("body { font-size:12px; line-height:22px; } a {color: #385ea2; text-decoration: none;} a:hover { text-decoration: underline; }"); this.Response.Write("</style>"); this.Response.Write("<script src=\"../hyhtml/js/hy_autoselect.js\"></script>"); this.Response.Write("<script src=\"../hyhtml/js/mainajax.js\"></script>"); this.Response.Write("<script type=\"text/javascript\">"); this.Response.Write("function js_hy_checked()"); this.Response.Write("{"); this.Response.Write("var tempstr=\"\";"); this.Response.Write("var lisum=0;"); this.Response.Write("for (var x=0; x<document.getElementsByName('hy_checkbox').length;x++)"); this.Response.Write("{"); this.Response.Write("if (document.getElementsByName('hy_checkbox')[x].checked)"); this.Response.Write("{"); this.Response.Write("if (tempstr==\"\"){tempstr=document.getElementsByName('hy_checkbox')[x].value;}"); this.Response.Write("else{"); this.Response.Write("tempstr+=\",\"+document.getElementsByName('hy_checkbox')[x].value;"); this.Response.Write("}"); this.Response.Write("lisum++;"); this.Response.Write("}"); this.Response.Write("}"); this.Response.Write("if(lisum>parseInt(document.getElementById('hy_checklen').value))"); this.Response.Write("{"); this.Response.Write("alert('你的选项不能超过'+document.getElementById('hy_checklen').value+'项');return false;"); this.Response.Write("}"); this.Response.Write("var lsfilename=document.getElementById('hy_field').value;"); this.Response.Write("window.parent.document.getElementById(lsfilename).value=tempstr;"); this.Response.Write(strJS + ";"); this.Response.Write("window.parent.document.getElementById('" + lsfilevalue + "').value=document.getElementById('hy_data').value;"); //加载js this.Response.Write("}"); this.Response.Write("function js_hy_redio()"); this.Response.Write("{"); this.Response.Write("var tempstr=\"\";"); this.Response.Write("for (var x=0; x<document.getElementsByName('hy_redio').length;x++)"); this.Response.Write("{"); this.Response.Write("if (document.getElementsByName('hy_redio')[x].checked)"); this.Response.Write("if (tempstr==\"\"){tempstr=document.getElementsByName('hy_redio')[x].value;}"); this.Response.Write("else{"); this.Response.Write("tempstr+=\",\"+document.getElementsByName('hy_redio')[x].value;"); this.Response.Write("}"); this.Response.Write("}"); this.Response.Write("var lsfilename=document.getElementById('hy_field').value;"); this.Response.Write("window.parent.document.getElementById(lsfilename).value=tempstr;"); //加载js this.Response.Write(strJS + ";"); this.Response.Write("window.parent.document.getElementById('" + lsfilevalue + "').value=document.getElementById('hy_data').value;"); this.Response.Write("}"); this.Response.Write("</script>"); this.Response.Write("</head>"); this.Response.Write("<body text=\"#000000\" bgcolor=\"#FFFFFF\" topmargin=\"0\" leftmargin=\"0\">"); this.Response.Write("<form id=\"fm13\">"); string ls_op = ""; string ls_key = ""; string ls_type = ""; string ls_field = ""; string ls_checklen = "0"; string ls_field_bz = ""; if (this.Request.QueryString["op"] != null) { ls_op = this.Request.QueryString["op"].ToString(); //传入选项方式:sgpz(手工配置)、sql(语句sql) } if (this.Request.QueryString["key"] != null) { ls_key = this.Request.QueryString["key"].ToString(); //选项内容 } if (this.Request.QueryString["type"] != null) { ls_type = this.Request.QueryString["type"].ToString(); //类型:单选、多选、关键字检索时为sql } if (this.Request.QueryString["field"] != null) { ls_field = this.Request.QueryString["field"].ToString(); //传回数据的域 } if (this.Request.QueryString["checklen"] != null) { ls_checklen = this.Request.QueryString["checklen"].ToString(); //选中个数 } if (this.Request.QueryString["field_bz"] != null) { ls_field_bz = this.Request.QueryString["field_bz"].ToString(); //备注 } if (ls_op == "sql") { //读取sql HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dt = new DataTable(); dt = Hyoa_global.GetDataTable_USER(ls_key); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string ls_v = dt.Rows[i][0].ToString(); if (ls_type == "rediotype") { this.Response.Write(" <input onclick=\"js_hy_redio()\" type=\"radio\" id=\"hy_redio_" + i + "\" name=\"hy_redio\" value=\"" + ls_v + "\" /><label for=\"hy_redio_" + i + "\">" + ls_v + " </label><br/>"); } else if (ls_type == "checkedtype") { this.Response.Write(" <input onclick=\"js_hy_checked()\" type=\"checkbox\" id=\"hy_checkbox_" + i + "\" name=\"hy_checkbox\" value=\"" + ls_v + "\" /><label for=\"hy_checkbox_" + i + "\">" + ls_v + " </label><br/>"); } } } } else if (ls_op == "sgpz") { //读取自定义字符串,如:张三|李四|王五|刘六 string[] lv_key = ls_key.Split('|'); for (int i = 0; i < lv_key.Length; i++) { string ls_v = lv_key[i]; if (ls_type == "rediotype") { this.Response.Write(" <input onclick=\"js_hy_redio()\" type=\"radio\" id=\"hy_redio_" + i + "\" name=\"hy_redio\" value=\"" + ls_v + "\" /><label for=\"hy_redio_" + i + "\">" + ls_v + " </label><br/>"); } else if (ls_type == "checkedtype") { this.Response.Write(" <input onclick=\"js_hy_checked()\" type=\"checkbox\" id=\"hy_checkbox_" + i + "\" name=\"hy_checkbox\" value=\"" + ls_v + "\" /><label for=\"hy_checkbox_" + i + "\">" + ls_v + " </label><br/>"); } } } else if (ls_op == "search") { //根据输入的关键字检索 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string ls_sql = ls_field_bz + " '%" + ls_key + "%'"; //this.Response.Write(ls_sql); DataTable dt = Hyoa_global.GetDataTable(ls_sql); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string ls_v = dt.Rows[i][0].ToString(); if (ls_type == "rediotype") { this.Response.Write(" <input onclick=\"js_hy_redio()\" type=\"radio\" id=\"hy_redio_" + i + "\" name=\"hy_redio\" value=\"" + ls_v + "\" /><label for=\"hy_redio_" + i + "\">" + ls_v + " </label><br/>"); } else if (ls_type == "checkedtype") { this.Response.Write(" <input onclick=\"js_hy_checked()\" type=\"checkbox\" id=\"hy_checkbox_" + i + "\" name=\"hy_checkbox\" value=\"" + ls_v + "\" /><label for=\"hy_checkbox_" + i + "\">" + ls_v + " </label><br/>"); } } } } this.Response.Write("<div style=\"display:none\">"); this.Response.Write("<input type=\"text\" id=\"hy_data\" name=\"hy_data\" value=\"" + lsfilevalue + "\" />"); this.Response.Write("<input type=\"text\" id=\"hy_data\" name=\"hy_data\" value=\"\" />"); this.Response.Write("<input type=\"text\" id=\"hy_field\" name=\"hy_field\" value=\"" + ls_field + "\" />"); this.Response.Write("<input type=\"text\" id=\"hy_field_bz\" name=\"hy_field_bz\" value=\"" + ls_field_bz + "\" />"); this.Response.Write("<input type=\"text\" id=\"hy_checklen\" name=\"hy_checklen\" value=\"" + ls_checklen + "\" />"); this.Response.Write("</div>"); this.Response.Write("</form>"); this.Response.Write("</body>"); this.Response.Write("</html>"); }
//fy20130801 导入功能 protected void btnDRToSQL_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); //链接SQL数据库 if (FileUpload1.HasFile == false) //HasFile用来检查FileUpload是否有指定文件 { Response.Write("<script>alert('请您选择Excel文件')</script> "); return; //当无文件时,返回 } string IsXls = System.IO.Path.GetExtension(FileUpload1.FileName).ToString().ToLower(); //System.IO.Path.GetExtension获得文件的扩展名 if (IsXls != ".xls" && IsXls != ".xlsx") { Response.Write("<script>alert('只可以选择Excel文件')</script>"); return; //当选择的不是Excel文件时,返回 } //根据年份判断在该路径下是否存在以当年年份文件夹 否则将建立以该年份的文件夹 string ls_ny = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString(); //HttpContext.Current.Server.MapPath(相对路径):把相对路径转为服务器上的绝对路径。File.Exists(绝对路径):检查是否存在绝对路径指向的文件或目录。 if (!Directory.Exists(HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny)) { //System.IO.Directory.CreateDirectory(文件夹绝对路径):建立绝对路径文件夹。 System.IO.Directory.CreateDirectory(@HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny); } string filename = DateTime.Now.ToString("hhMMss") + FileUpload1.FileName; //重新为文件命名,获取Execle文件名 DateTime日期函数 // 保存文件到路径,用Server.MapPath()取当前文件的绝对目录.在asp.net里""必须用"\"代替 string savePath = Server.MapPath(("~\\upload/" + ls_ny + "\\") + filename);//Server.MapPath 获得虚拟服务器相对路径 FileUpload1.SaveAs(savePath); //SaveAs 将上传的文件内容保存在服务器上 DataSet ds = ExecleDs(savePath, filename); //调用自定义方法 DataRow[] dr = ds.Tables[0].Select(); //定义一个DataRow数组 int rowsnum = ds.Tables[0].Rows.Count; int i_into = 0; string sqlInsert = ""; string strDocid = ""; string sqlSelect = ""; string strUserid = ""; string strUserDeptid = ""; string strUserDeptName = ""; string strYwxf = ""; string strZcl = ""; if (rowsnum == 0) { Response.Write("<script>alert('Excel表为空表,无数据!')</script>"); //当Excel表为空时,对用户进行提示 } else { for (int i = 0; i < dr.Length; i++) { /* 导入整体思路:数据来自一个excel表,导入的时候先导主表,后导字表。主表按照常规来导,指定哪些字段导入到数据库中,字表依据主表的docid作为父id, * 进行导入,导入之前先判断是excel表中有没有数据,如果有数据,而且不是一些特定的不需要导入的数据,就导入 */ sqlSelect = " select u.hy_userid,d.hy_deptid,d.hy_deptname from hyt_user u join hyt_dept d on u.hy_deptid=d.hy_deptid where u.hy_username='******' "; DataTable dt = Hyoa_global.GetDataTable_USER(sqlSelect); if (dt.Rows.Count > 0) { strUserid = dt.Rows[0]["hy_userid"].ToString(); strUserDeptid = dt.Rows[0]["hy_deptid"].ToString(); strUserDeptName = dt.Rows[0]["hy_deptname"].ToString(); } else { Response.Write("<script>alert('这条数据导错了" + i_into + dr[i][0].ToString() + "');</script>"); Response.Write(sqlSelect); return; } strDocid = System.Guid.NewGuid().ToString(); //导入主表 sqlInsert = " insert into hyc_Tablefpbd( DOCID,hy_bt,hy_clrylist,hy_curclrid,hy_curclrname,hy_curtacheid"; sqlInsert += " ,hy_curtachename,hy_cyrylist,hy_djrbmid,hy_djrbmname,hy_djrid,hy_djrname,hy_djsj"; sqlInsert += " ,hy_flowid,hy_flowname,hy_ifconfirm,hy_iftx,hy_motherid,hy_mudelid,hy_readdatelist"; sqlInsert += " ,hy_readuserlist,hy_tableid,hy_zhtxsj,hyc_bxje,hyc_bxjedx,hyc_djr,hyc_djsj"; sqlInsert += " ,hyc_djz,hyc_fatherid,hyc_fplx,hyc_fplxx,hyc_cpmc1,hyc_fptt,hyc_htkp,hyc_kpsj"; sqlInsert += " ,hyc_muild,hyc_sfbf,hyc_skrq,hyc_tableid,hyc_yf) values ( '" + strDocid + "','',''"; sqlInsert += " ,'" + strUserid + "','" + dr[i][0].ToString() + "','**','流程已结束','," + strUserid + ",'"; sqlInsert += " ,'" + strUserDeptid + "','" + strUserDeptName + "','" + strUserid + "','" + dr[i][0].ToString() + "',getdate(),'Flowfp','发票管理'"; sqlInsert += " ,'','','','Mudelfp','',''"; sqlInsert += " ,'Tablefpbd','','" + dr[i][53].ToString() + "','','" + dr[i][0].ToString() + "',getdate(),'" + strUserDeptName + "'"; sqlInsert += " ,'','" + dr[i][2].ToString() + "','普通增值税发票','" + dr[i][3].ToString() + "','" + dr[i][1].ToString() + "','否','" + dr[i][54].ToString() + "'"; sqlInsert += " ,'','','" + dr[i][55].ToString() + "','','') "; Hyoa_global.ExcuteSQL(sqlInsert); //开始导字表 for (int j = 4; j < 57; j++) { if (dr[i][j].ToString() != "" && (j != 5 || j != 7 || j != 9) && dr[i][j].ToString() != "0") { strYwxf = getChildTable(j); if (strYwxf != "") { //先将“增量”这两个字去掉 if (strYwxf.Contains("增量")) { //将“增量”特定的给一个字符串 strZcl = "增量"; strYwxf = strYwxf.Replace("增量", ""); } else if (strYwxf.Contains("存量")) { strZcl = "存量"; strYwxf = strYwxf.Replace("存量", ""); } else { strZcl = "增量"; } sqlInsert = " insert into hyc_Tablejemx( DOCID,hy_bt,hy_clrylist,hy_curclrid,hy_curclrname,hy_curtacheid"; sqlInsert += " ,hy_curtachename,hy_cyrylist,hy_djrbmid,hy_djrbmname,hy_djrid,hy_djrname,hy_djsj"; sqlInsert += " ,hy_flowid,hy_flowname,hy_ifconfirm,hy_iftx,hy_motherid,hy_mudelid,hy_readdatelist"; sqlInsert += " ,hy_readuserlist,hy_tableid,hy_zhtxsj,hyc_bxje,hyc_bxjedx,hyc_bz,hyc_sl"; sqlInsert += " ,hyc_ywxf,hyc_zcl) values ( '" + System.Guid.NewGuid().ToString() + "','','','',''"; sqlInsert += " ,'','','','" + strUserDeptid + "','" + strUserDeptName + "','" + strUserid + "'"; sqlInsert += " ,'" + dr[i][0].ToString() + "',getdate(),'','','','','" + strDocid + "'"; sqlInsert += " ,'Mudelfp','','','Tablejemx',''"; if (strYwxf == "基本型" || strYwxf == "交互型") { sqlInsert += " ,'" + dr[i][j + 1].ToString() + "','','" + dr[i][56].ToString() + "','" + dr[i][j].ToString() + "','" + strYwxf + "','" + strZcl + "') "; } else { sqlInsert += " ,'" + dr[i][j].ToString() + "','','" + dr[i][56].ToString() + "','','" + strYwxf + "','" + strZcl + "') "; } Hyoa_global.ExcuteSQL(sqlInsert); } } } i_into = i_into + 1; } } Response.Write("<script>alert('导入成功!共导入" + i_into + "条数据');</script>"); }
//客户生日待办事宜 add by zxx 20150327 private void remindDBSY(string lsTableid, string lsCondition, string lsRemind, string lsRemindField) { DateTime time_Now = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sqlSelect = " select * from hyc_" + lsTableid + " "; string sqlSelectDBSY = ""; DataTable dt = Hyoa_global.GetDataTable(sqlSelect); string sqlSelect_RY = ""; DataTable dt_ryid = new DataTable(); string str_btxrid = ""; try{ if (dt.Rows.Count > 0) { //存在 for (int i = 0; i < dt.Rows.Count; i++) { sqlSelect_RY = " select * from hyt_user where hy_username='******'"; dt_ryid = Hyoa_global.GetDataTable_USER(sqlSelect_RY); if (dt_ryid.Rows.Count > 0) { str_btxrid = dt_ryid.Rows[0]["hy_userid"].ToString(); } else { str_btxrid = dt.Rows[i]["hy_djrid"].ToString(); } if (dt.Rows[i]["hyc_" + lsCondition + ""].ToString() != "") { sqlSelectDBSY = " select id from hyt_dbsy where docid ='" + dt.Rows[i]["docid"].ToString() + "'"; DataTable dt2 = Hyoa_global.GetDataTable(sqlSelectDBSY); DateTime txsj = Convert.ToDateTime(dt.Rows[i]["hyc_" + lsCondition + ""].ToString()); if (time_Now < txsj) { //当前时间小于提醒时间 } else if (time_Now == txsj) { //当前时间等于提醒时间 if (dt2.Rows.Count > 0) { //待办事宜中有数据 update string sqlUpdate = " update hyt_dbsy set hy_property='待办',hy_foldername='待办箱',hy_ifyb='0' where ID='" + dt2.Rows[0]["ID"].ToString() + "'"; Hyoa_global.ExcuteSQL(sqlUpdate); } else { //待办事宜中无数据 insert sqlSelect = "insert into hyt_dbsy(ID,DOCID,hy_dbrid,hy_dbrname,hy_fsrid,hy_fsrname,hy_createtime,hy_url,"; sqlSelect += "hy_property,hy_mudelid,hy_foldername,hy_hj,hy_bt,hy_subbt,hy_ifyb,hy_flowid,hy_tacheid,hy_tableid) values "; sqlSelect += "('" + System.Guid.NewGuid().ToString() + "','" + dt.Rows[i]["docid"].ToString() + "','" + dt.Rows[i]["hy_djrid"].ToString() + "',"; sqlSelect += " '" + dt.Rows[i]["hy_djrname"].ToString() + "','" + str_btxrid + "','" + dt.Rows[i]["hyc_" + lsRemindField + ""].ToString() + "',"; sqlSelect += " '" + DateTime.Now.ToString("yyyy-MM-dd") + "','main_flc.aspx?op=modify&mid=" + dt.Rows[i]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[i]["hy_tableid"].ToString() + "&docid=" + dt.Rows[i]["DOCID"].ToString() + "&pop=1',"; sqlSelect += " '待办','" + dt.Rows[i]["hy_mudelid"].ToString() + "','待办箱','一般','" + lsRemind + "','请办理','0','','','" + dt.Rows[i]["hy_tableid"].ToString() + "') "; Hyoa_global.ExcuteSQL(sqlSelect); } } else { //当前时间大于提醒时间 if (dt2.Rows.Count > 0) { //待办事宜中有数据 update string sqlUpdate = " update hyt_dbsy set hy_property='已办',hy_foldername='待办箱',hy_ifyb='1' where ID='" + dt2.Rows[0]["ID"].ToString() + "'"; Hyoa_global.ExcuteSQL(sqlUpdate); } } } } } }catch(Exception ex){ } }
//添加姓名 private void GetNames() { string sql_Name = "select * from hyt_user"; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dt = Hyoa_global.GetDataTable_USER(sql_Name); DataView dv = new DataView(dt); list_xm.DataSource = dv; list_xm.DataValueField = "hy_username"; list_xm.DataTextField = "hy_username"; list_xm.DataBind(); list_xm.Items.Insert(0, new ListItem("--请选择--")); }
//fy20130801 导入功能 protected void btnDRToSQL_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); //链接SQL数据库 if (FileUpload1.HasFile == false) //HasFile用来检查FileUpload是否有指定文件 { Response.Write("<script>alert('请您选择Excel文件')</script> "); return; //当无文件时,返回 } string IsXls = System.IO.Path.GetExtension(FileUpload1.FileName).ToString().ToLower(); //System.IO.Path.GetExtension获得文件的扩展名 if (IsXls != ".xls" && IsXls != ".xlsx") { Response.Write("<script>alert('只可以选择Excel文件')</script>"); return; //当选择的不是Excel文件时,返回 } //根据年份判断在该路径下是否存在以当年年份文件夹 否则将建立以该年份的文件夹 string ls_ny = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString(); //HttpContext.Current.Server.MapPath(相对路径):把相对路径转为服务器上的绝对路径。File.Exists(绝对路径):检查是否存在绝对路径指向的文件或目录。 if (!Directory.Exists(HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny)) { //System.IO.Directory.CreateDirectory(文件夹绝对路径):建立绝对路径文件夹。 System.IO.Directory.CreateDirectory(@HttpContext.Current.Server.MapPath("~\\upload\\") + "/" + ls_ny); } string filename = DateTime.Now.ToString("hhMMss") + FileUpload1.FileName; //重新为文件命名,获取Execle文件名 DateTime日期函数 // 保存文件到路径,用Server.MapPath()取当前文件的绝对目录.在asp.net里""必须用"\"代替 string savePath = Server.MapPath(("~\\upload/" + ls_ny + "\\") + filename);//Server.MapPath 获得虚拟服务器相对路径 FileUpload1.SaveAs(savePath); //SaveAs 将上传的文件内容保存在服务器上 DataSet ds = ExecleDs(savePath, filename); //调用自定义方法 DataRow[] dr = ds.Tables[0].Select(); //定义一个DataRow数组 int rowsnum = ds.Tables[0].Rows.Count; int i_into = 0; string sqlSelect = ""; string strUserid = ""; string strUdeptid = ""; string strUdeptname = ""; string sqlInsert = ""; if (rowsnum == 0) { Response.Write("<script>alert('Excel表为空表,无数据!')</script>"); //当Excel表为空时,对用户进行提示 } else { for (int i = 0; i < dr.Length; i++) { sqlSelect=" select u.hy_userid,u.hy_deptid,d.hy_deptname from hyt_user u join hyt_dept d on u.hy_deptid=d.hy_deptid where u.hy_username='******' "; DataTable dt = Hyoa_global.GetDataTable_USER(sqlSelect); if (dt.Rows.Count > 0) { strUserid = dt.Rows[0]["hy_userid"].ToString(); strUdeptid = dt.Rows[0]["hy_deptid"].ToString(); strUdeptname = dt.Rows[0]["hy_deptname"].ToString(); } sqlInsert = " insert into hyc_Tablekhda( DOCID,hy_djrbmid,hy_djrbmname,hy_djrid,hy_djrname,hy_djsj"; sqlInsert += " ,hy_mudelid,hy_tableid,hyc_bgsdh,hyc_bz,hyc_dwdz,hyc_dwmc"; sqlInsert += " ,hyc_dzyx,hyc_hyfl,hyc_jtzz,hyc_khjl,hyc_lsm,hyc_lxr,hyc_qq,hyc_qt,hyc_sj,hyc_sqjs"; sqlInsert += " ,hyc_sr,hyc_ssqy,hyc_szbm,hyc_whjb,hyc_whjb2,hyc_wx,hyc_xb,hyc_xzbm"; sqlInsert += " ,hyc_zrr,hyc_zw,hyc_zzdh) values ( '"+System.Guid.NewGuid().ToString()+"','"+strUdeptid+"',"; sqlInsert+=" '"+strUdeptname+"','"+strUserid+"','"+dr[i]["责任人"].ToString()+"',getdate(),'Mudelkhda'"; sqlInsert += " ,'Tablekhda','"+dr[i]["办公室电话"].ToString()+"','"+dr[i]["备注"].ToString()+"','"+dr[i]["单位地址"].ToString()+"','"+dr[i]["单位名称"].ToString()+"','"+dr[i]["电子邮箱"].ToString()+"'"; sqlInsert += " ,'"+dr[i]["行业分类"].ToString()+"','"+dr[i]["家庭住址"].ToString()+"','"+dr[i]["业务类型"].ToString()+"','"+dr[i]["连锁名/门店名/曾用名"].ToString()+"','"+dr[i]["第一联系人姓名"].ToString()+"','"+dr[i]["QQ"].ToString()+"','"+dr[i]["其他"].ToString()+"','"+dr[i]["其他"].ToString()+"'"; sqlInsert += " ,'"+dr[i]["售前技术工程师"].ToString()+"','"+dr[i]["生日"].ToString()+"','"+dr[i]["所属区域"].ToString()+"','"+dr[i]["所在部门"].ToString()+"','"+dr[i]["客户类型"].ToString()+"','"+dr[i]["维护级别"].ToString()+"','"+dr[i]["微信"].ToString()+"'"; sqlInsert += " ,'"+dr[i]["性别"].ToString()+"','"+dr[i]["协助部门/协助人"].ToString()+"','"+dr[i]["责任人"].ToString()+"','"+dr[i]["职位"].ToString()+"','"+dr[i]["住宅电话"].ToString()+"') "; if (!Hyoa_global.ExcuteSQL(sqlInsert)) { Response.Write(sqlInsert); return; } } Response.Write("<script>alert('导入成功!');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { string ls_flowid; string ls_nexttacheid; string ls_deptid; string ls_username; string ls_userid; string ls_opt; ls_flowid = ""; ls_nexttacheid = ""; ls_deptid = ""; ls_username = ""; ls_userid = ""; ls_opt = ""; if (this.Request.QueryString["flowid"] != null) { ls_flowid = this.Request.QueryString["flowid"].ToString(); } if (this.Request.QueryString["nexttacheid"] != null) { ls_nexttacheid = this.Request.QueryString["nexttacheid"].ToString(); } if (this.Request.QueryString["deptid"] != null) { ls_deptid = this.Request.QueryString["deptid"].ToString(); } if (this.Request.QueryString["opt"] != null) { ls_opt = this.Request.QueryString["opt"].ToString(); } //如果opt等于clr,则表示处理人的域,如果opt等于cyr,则表示传阅人的域 if (ls_opt == "clr") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //后序环节处理人员 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); //先得到后续环节处理人集合 DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(ls_flowid, ls_nexttacheid); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (ls_deptid == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + ls_deptid + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + ls_deptid + "' order by a.hy_deptsort,b.hy_sort"; } } DataTable dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { //开始输出 if (ls_username == "") { ls_username = dt.Rows[i]["hy_username"].ToString(); ls_userid = dt.Rows[i]["hy_userid"].ToString(); } else { ls_username += "+" + dt.Rows[i]["hy_username"].ToString(); ls_userid += "+" + dt.Rows[i]["hy_userid"].ToString(); } ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } } this.Response.Write(ls_username + "*" + ls_userid); return ; } if (ls_opt == "cyr") { //后序环节传阅人员 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); DataTable dt3 = Hyoa_user.Getusersbydeptid(ls_deptid); if (dt3.Rows.Count > 0) { for (int i = 0; i < dt3.Rows.Count; i++) { if (ls_username == "") { ls_username = dt3.Rows[i]["hy_username"].ToString(); ls_userid = dt3.Rows[i]["hy_userid"].ToString(); } else { ls_username = ls_username + "+" + dt3.Rows[i]["hy_username"].ToString(); ls_userid = ls_userid + "+" + dt3.Rows[i]["hy_userid"].ToString(); } } } dt3.Clear(); this.Response.Write(ls_username + "*" + ls_userid); return; } }
protected void Hy_nexttachename_SelectedIndexChanged(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //后序环节处理人部门 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); DataTable dt = new DataTable(); //先清空 this.Hy_deptlist_clr.DataSource = dt; this.Hy_deptlist_clr.DataTextField = "hy_deptname"; this.Hy_deptlist_clr.DataValueField = "hy_deptid"; this.Hy_deptlist_clr.DataBind(); //先得到后续环节处理人集合 DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { this.Hy_deptlist_clr.Items.Insert(0, "--请选择--"); ls_temp1 = ""; int t = 1; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_deptid"].ToString() + ",")) { } else { //解决多级部门后续提交时部门显示的问题 added by xf 20131226 string ls_deptname = ""; if (dt.Rows[i]["hy_deptid"].ToString().Length == 3) { ls_deptname = dt.Rows[i]["hy_deptname"].ToString(); } else { ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString()); } this.Hy_deptlist_clr.Items.Insert(t, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_deptid"].ToString(); } } this.Hy_deptlist_clr.SelectedIndex = 0; } } dt.Clear(); //后序环节传阅人员部门 //先清空 this.Hy_deptlist.DataSource = dt; this.Hy_deptlist.DataTextField = "hy_deptname"; this.Hy_deptlist.DataValueField = "hy_deptid"; this.Hy_deptlist.DataBind(); HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept(); dt = Hyoa_dept.Getdepts(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //解决多级部门后续提交时部门显示的问题 added by xf 20131226 string ls_deptname = ""; if (dt.Rows[i]["hy_deptid"].ToString().Length == 3) { ls_deptname = dt.Rows[i]["hy_deptname"].ToString(); } else { ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString()); } this.Hy_deptlist.Items.Insert(i, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString())); } this.Hy_deptlist.SelectedIndex = 0; } dt.Clear(); //后序环节处理人员 //先得到后续环节处理人集合 //先清空 this.Hy_hjclr.DataSource = dt; this.Hy_hjclr.DataTextField = "hy_username"; this.Hy_hjclr.DataValueField = "hy_userid"; this.Hy_hjclr.DataBind(); dt_nextflowuser.Clear(); dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } } dt.Clear(); //后序环节传阅人员 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); dt = Hyoa_user.Getusersbydeptid(this.Hy_deptlist.SelectedValue.ToString()); if (dt.Rows.Count > 0) { this.Hy_rylist.DataSource = dt; this.Hy_rylist.DataTextField = "hy_username"; this.Hy_rylist.DataValueField = "hy_userid"; this.Hy_rylist.DataBind(); } dt.Clear(); //得到 后续环节的默认环节 对应的 提醒默认值,然后进行赋值 string ls_temp_tacheid = this.Hy_nexttachename.SelectedValue.ToString(); HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); DataTable dt_getrddoissendsmsandmsg = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.txtflowid.Text, ls_temp_tacheid); if (dt_getrddoissendsmsandmsg.Rows.Count > 0) { if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendSms"].ToString() == "是") this.f_isSendsms_clr.Checked = true; else this.f_isSendsms_clr.Checked = false; if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendMessage"].ToString() == "是") this.f_isSendjstx_clr.Checked = true; else this.f_isSendjstx_clr.Checked = false; if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendSms"].ToString() == "是") this.f_isSendsms_cyr.Checked = true; else this.f_isSendsms_cyr.Checked = false; if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendMessage"].ToString() == "是") this.f_isSendjstx_cyr.Checked = true; else this.f_isSendjstx_cyr.Checked = false; this.txthy_ifshowcurcomp.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurcomp"].ToString(); this.txthy_ifshowcurdept.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurdept"].ToString(); } //----考虑只显示本单位的情况start----- if (this.txthy_ifshowcurcomp.Text == "是") { DataTable tempTable = new DataTable(); DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列 tempTable.Columns.Add(col); //追加一列 add DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列 tempTable.Columns.Add(col2); //追加一列 add //更新部门 for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++) { string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value; ls_dept1 = ls_dept1.Substring(0, 3); string ls_curdept = Session["hydeptid"].ToString(); ls_curdept = ls_curdept.Substring(0, 3); if (ls_dept1 == ls_curdept) { DataRow dr = tempTable.NewRow(); dr["value1"] = Hy_deptlist_clr.Items[j].Text; dr["value2"] = Hy_deptlist_clr.Items[j].Value; tempTable.Rows.Add(dr); } } //先清空 this.Hy_deptlist_clr.Items.Clear(); this.Hy_deptlist_clr.DataSource = tempTable; this.Hy_deptlist_clr.DataTextField = "value1"; this.Hy_deptlist_clr.DataValueField = "value2"; this.Hy_deptlist_clr.DataBind(); this.Hy_hjclr.Items.Clear(); //在调用这个部门对应的人员 //先得到后续环节处理人集合 dt_nextflowuser.Clear(); dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } } dt.Clear(); } //----考虑只显示本单位的情况end------- //----考虑只显示和登记人同单位的情况start----- if (this.txthy_ifshowcurcomp.Text == "和登记人同单位") { if (Request.QueryString["docid"] != null) { //得到登记人的部门ID string ls_djrbmid = ""; string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'"; DataTable dt_flowmain = Hyoa_global.GetDataTable(sql); if (dt_flowmain.Rows.Count > 0) { ls_djrbmid = dt_flowmain.Rows[0]["hy_djrbmid"].ToString(); DataTable tempTable = new DataTable(); DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列 tempTable.Columns.Add(col); //追加一列 add DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列 tempTable.Columns.Add(col2); //追加一列 add //更新部门 for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++) { string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value; if (ls_dept1.Substring(0, 3) == ls_djrbmid.Substring(0, 3)) { DataRow dr = tempTable.NewRow(); dr["value1"] = Hy_deptlist_clr.Items[j].Text; dr["value2"] = Hy_deptlist_clr.Items[j].Value; tempTable.Rows.Add(dr); } } //先清空 this.Hy_deptlist_clr.Items.Clear(); this.Hy_deptlist_clr.DataSource = tempTable; this.Hy_deptlist_clr.DataTextField = "value1"; this.Hy_deptlist_clr.DataValueField = "value2"; this.Hy_deptlist_clr.DataBind(); this.Hy_hjclr.Items.Clear(); //在调用这个部门对应的人员 dt_nextflowuser.Clear(); dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } } dt.Clear(); } } } //----考虑只显示和登记人同单位的情况end------- //----考虑只显示登记人的分管领导的情况start----- if (this.txthy_ifshowcurcomp.Text == "登记人的分管领导") { if (Request.QueryString["docid"] != null) { //得到登记人的部门ID string ls_djrbmid = ""; string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'"; DataTable dt_flowmain = Hyoa_global.GetDataTable(sql); if (dt_flowmain.Rows.Count > 0) { ls_djrbmid = dt_flowmain.Rows[0]["hy_djrbmid"].ToString(); DataTable tempTable = new DataTable(); DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列 tempTable.Columns.Add(col); //追加一列 add DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列 tempTable.Columns.Add(col2); //追加一列 add //更新部门 for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++) { string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value; if (ls_dept1.Substring(3) == ls_djrbmid.Substring(3)) { DataRow dr = tempTable.NewRow(); dr["value1"] = Hy_deptlist_clr.Items[j].Text; dr["value2"] = Hy_deptlist_clr.Items[j].Value; tempTable.Rows.Add(dr); } } //先清空 this.Hy_deptlist_clr.Items.Clear(); this.Hy_deptlist_clr.DataSource = tempTable; this.Hy_deptlist_clr.DataTextField = "value1"; this.Hy_deptlist_clr.DataValueField = "value2"; this.Hy_deptlist_clr.DataBind(); this.Hy_hjclr.Items.Clear(); //在调用这个部门对应的人员 dt_nextflowuser.Clear(); dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } } dt.Clear(); } } } //----考虑只显示登记人的分管领导的情况end------- //----只显示登记人start----- if (this.txthy_ifshowcurdept.Text == "只显示登记人") { if (Request.QueryString["docid"] != null) { string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'"; DataTable dt_flowmain = Hyoa_global.GetDataTable(sql); if (dt_flowmain.Rows.Count > 0) { //先清空 this.Hy_deptlist_clr.Items.Clear(); Hy_deptlist_clr.Items.Insert(0, new ListItem(dt_flowmain.Rows[0]["hy_djrbmname"].ToString(), dt_flowmain.Rows[0]["hy_djrbmid"].ToString())); //先清空 this.Hy_hjclr.Items.Clear(); Hy_hjclr.Items.Insert(0, new ListItem(dt_flowmain.Rows[0]["hy_djrname"].ToString(), dt_flowmain.Rows[0]["hy_djrid"].ToString())); } } } //----只显示登记人end------- //----只显示当前用户本部门人员start----- if (this.txthy_ifshowcurdept.Text == "是") { if (Request.QueryString["docid"] != null) { DataTable tempTable = new DataTable(); DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列 tempTable.Columns.Add(col); //追加一列 add DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列 tempTable.Columns.Add(col2); //追加一列 add //更新部门 for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++) { string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value; if (ls_dept1 == Session["hydeptid"].ToString()) { DataRow dr = tempTable.NewRow(); dr["value1"] = Hy_deptlist_clr.Items[j].Text; dr["value2"] = Hy_deptlist_clr.Items[j].Value; tempTable.Rows.Add(dr); } } //先清空 this.Hy_deptlist_clr.Items.Clear(); this.Hy_deptlist_clr.DataSource = tempTable; this.Hy_deptlist_clr.DataTextField = "value1"; this.Hy_deptlist_clr.DataValueField = "value2"; this.Hy_deptlist_clr.DataBind(); this.Hy_hjclr.Items.Clear(); //在调用这个部门对应的人员 dt_nextflowuser.Clear(); dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } } dt.Clear(); } } //----只显示当前用户本部门人员end------- }
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(); } if (field_type == "意见加按钮") { HyoaClass.Hyoa_yj Hyoa_yj = new HyoaClass.Hyoa_yj(); DataTable dt_yj = Hyoa_yj.Getyjsbydocidandfieldid_sx(this.txtdocid.Value, hy_fieldid); if (dt_yj.Rows.Count > 0) { field_docvalue = ""; for (int ii = 0; ii < dt_yj.Rows.Count; ii++) { field_docvalue += dt_yj.Rows[ii]["hy_yjbody"].ToString() + "(" + dt_yj.Rows[ii]["hy_yjusername"].ToString() + " " + System.DateTime.Parse(dt_yj.Rows[ii]["hy_yjtime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss") + ")<br/>"; } } } } //判断是输出LABL还是INPUT if (pi_isnewdoc == "0") //新文档 { if (ifhavarole == "1") //有权限 { ls_laborinput = "1"; } } else //旧文档 { 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"; } } //如果是“可修改所有文档的权限人员”,则可以修改所有的字段 if (Hyoa_global.isHaveRole("Role9995", Session["hyuid"].ToString())) { ls_laborinput = "1"; } } //如果是输出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()); } if (dtfield.Rows[0]["hy_onfocus"].ToString() != "") { txtTextBox.Attributes.Add("onfocus", dtfield.Rows[0]["hy_onfocus"].ToString()); } if (dtfield.Rows[0]["hy_onblur"].ToString() != "") { txtTextBox.Attributes.Add("onblur", dtfield.Rows[0]["hy_onblur"].ToString()); } if (dtfield.Rows[0]["hy_wordlimit"].ToString() != "") { txtTextBox.MaxLength = System.Int32.Parse((System.Int32.Parse(dtfield.Rows[0]["hy_wordlimit"].ToString()) / 2).ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "0"); } } //多行文本 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()); } if (dtfield.Rows[0]["hy_onfocus"].ToString() != "") { txtTextBox.Attributes.Add("onfocus", dtfield.Rows[0]["hy_onfocus"].ToString()); } if (dtfield.Rows[0]["hy_onblur"].ToString() != "") { txtTextBox.Attributes.Add("onblur", dtfield.Rows[0]["hy_onblur"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "0"); } } //多行文本_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()); } if (dtfield.Rows[0]["hy_onfocus"].ToString() != "") { txtTextBox.Attributes.Add("onfocus", dtfield.Rows[0]["hy_onfocus"].ToString()); } if (dtfield.Rows[0]["hy_onblur"].ToString() != "") { txtTextBox.Attributes.Add("onblur", dtfield.Rows[0]["hy_onblur"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "0"); } } //按钮 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()); } if (dtfield.Rows[0]["hy_onfocus"].ToString() != "") { txtTextBox.Attributes.Add("onfocus", dtfield.Rows[0]["hy_onfocus"].ToString()); } if (dtfield.Rows[0]["hy_onblur"].ToString() != "") { txtTextBox.Attributes.Add("onblur", dtfield.Rows[0]["hy_onblur"].ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "1"); } } //文本加按钮 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()); } if (dtfield.Rows[0]["hy_wordlimit"].ToString() != "") { txtTextBox.MaxLength = System.Int32.Parse((System.Int32.Parse(dtfield.Rows[0]["hy_wordlimit"].ToString()) / 2).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); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "0"); } } //多行文本加按钮 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); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "0"); } } //意见加按钮 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_show = new Label(); txtTextBox_show.ID = dtfield.Rows[0]["hy_fieldid"].ToString() + "_show"; txtTextBox_show.Text = field_docvalue; tCell2.Controls.Add(txtTextBox_show); 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); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "9"); } } //数值 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()); } if (dtfield.Rows[0]["hy_onfocus"].ToString() != "") { txtTextBox.Attributes.Add("onfocus", dtfield.Rows[0]["hy_onfocus"].ToString()); } if (dtfield.Rows[0]["hy_onblur"].ToString() != "") { txtTextBox.Attributes.Add("onblur", dtfield.Rows[0]["hy_onblur"].ToString()); } //if (dtfield.Rows[0]["hy_wordlimit"].ToString() != "") //{ // txtTextBox.MaxLength = System.Int32.Parse((System.Int32.Parse(dtfield.Rows[0]["hy_wordlimit"].ToString())).ToString()); //} txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "3"); } } //对话框列表(下拉框 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 = new DataTable(); if (ls_sql.Contains("#")) { ls_sql = ls_sql.Replace("#",""); dt_options = Hyoa_global.GetDataTable_USER(ls_sql); } else { 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); //插入字段:共有哪几个查询条件 addsavefields(hy_fieldid, "0"); } } //复选框(查询时直接显示文本框) 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); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "7"); } } //单选框(查询时直接显示文本框) 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); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "8"); } } //口令 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()); } if (dtfield.Rows[0]["hy_onfocus"].ToString() != "") { txtTextBox.Attributes.Add("onfocus", dtfield.Rows[0]["hy_onfocus"].ToString()); } if (dtfield.Rows[0]["hy_onblur"].ToString() != "") { txtTextBox.Attributes.Add("onblur", dtfield.Rows[0]["hy_onblur"].ToString()); } if (dtfield.Rows[0]["hy_wordlimit"].ToString() != "") { txtTextBox.MaxLength = System.Int32.Parse((System.Int32.Parse(dtfield.Rows[0]["hy_wordlimit"].ToString())).ToString()); } txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "5"); } } //附件组件 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 = "<span id=\"fjinfoshow_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\">" + field_docvalue + "</span>"; 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); //插入字段:共有哪几个INPUT字段 addsavefields(hy_fieldid, "6"); } } //痕迹保留 if (field_type == "痕迹保留") { string ls_btnname = ""; HyoaClass.Hyoa_ntko Hyoa_ntko = new HyoaClass.Hyoa_ntko(); DataTable dt_ntko = Hyoa_ntko.GetntkofileByfother(this.txtdocid.Value); if (dt_ntko.Rows.Count > 0) { ls_btnname = "正文:" + this.hy_bt.Text; } else { ls_btnname = "<span id='ntko_wsc'>未上传正文,请点击上传!</span>"; } //-----开始输出字段------ if (ls_laborinput == "0") //输出LABLE { //field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='" + ls_btnname + "' 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');\" /> "; field_docvalue = "<a href=\"#\" 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');\">" + ls_btnname + "</a> "; 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='" + ls_btnname + "' 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');\" /> "; field_docvalue = "<a href=\"#\" 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');\">" + ls_btnname + "</a> "; 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; }