private bool getData(string lsTable, string lsDwmc) { StringBuilder strShow = new StringBuilder(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sqlSelect = " select * from hyc_" + lsTable + " where 1=1 and hy_iftx ='1'"; if (this.qysj_s.Value != "") { sqlSelect += " and hyc_qdsj >= '" + this.qysj_s.Value + "' "; } if (this.qysj_e.Value != "") { sqlSelect += " and hyc_qdsj <= '" + this.qysj_e.Value + "' "; } if (this.txtFzr.Value != "") { sqlSelect += " and hyc_fzr = '" + this.txtFzr.Value + "' "; } if (this.hyfl.Items[hyfl.SelectedIndex].Text != "--请选择--") { sqlSelect += " and hyc_hyfl = '" + this.hyfl.Items[hyfl.SelectedIndex].Text + "' "; } if (this.txtKhmc.Value != "") { sqlSelect += " and hyc_jfmc like '%" + this.txtKhmc.Value + "%' "; } if (this.txtHtbh.Value != "") { sqlSelect += " and hyc_htbh = '" + this.txtHtbh.Value.Trim() + "' "; } sqlSelect += " order by hy_djsj desc "; DataTable dt = Hyoa_global.GetDataTable(sqlSelect); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { strShow.Append("<tr onmouseover=\"this.className='tr-over'\" onmouseout=\"this.className='TrList'\" class=\"TrList\">"); strShow.Append("<td width=\"5%\" height=\"22\" align=\"center\"><input type=\"checkbox\" name=\"docids\" value=\"" + dt.Rows[i]["docid"].ToString() + "\" /></td>"); strShow.Append("<td width=\"5%\" height=\"22\" align=\"center\">" + (i + 1) + "</td>"); DateTime htkssj; if (dt.Rows[i]["hy_zhtxsj"] != null && dt.Rows[i]["hy_zhtxsj"].ToString() != "") { strShow.Append("<td width=\"12%\" class=\"TdcellHead\"><p align=\"center\">" + Convert.ToDateTime(dt.Rows[i]["hy_zhtxsj"].ToString()).ToString("yyyy年MM月dd日") + "</p></td>"); } else { strShow.Append("<td width=\"12%\" class=\"TdcellHead\"><p align=\"center\"></p></td>"); } strShow.Append("<td width=\"25%\" class=\"TdcellHead\"><p align=\"center\">" + dt.Rows[i]["hyc_jfmc"].ToString() + "</p></td>"); strShow.Append("<td width=\"15%\" class=\"TdcellHead\"><p align=\"center\">" + dt.Rows[i]["hy_djrbmname"].ToString() + "</p></td>"); strShow.Append("<td width=\"30%\" class=\"TdcellHead\"><p align=\"center\">" + lsDwmc + "</p></td>"); strShow.Append("<td width=\"13%\" class=\"TdcellHead\"><p align=\"center\">"); strShow.Append("<a href=\"#\" onclick=\"var ss='main_look.aspx?op=modify&pop=_blank&mid=" + dt.Rows[i]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[i]["hy_tableid"].ToString() + "&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url='+window.location;window.open(ss);\">"); strShow.Append("查看</a></td></tr>"); } } this.lb_show.Text += strShow.ToString(); //如果没有数据 if (this.lb_show.Text == "") { return true; } else { return false; } }
//周报提交控制 private void Zbtjkz() { string sqlSelect = " select * from hyc_Tabletjjzr order by hyc_pxh desc "; string lsTjjzd = ""; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); DataTable dt = Hyoa_global.GetDataTable(sqlSelect); if (dt.Rows.Count > 0) { lsTjjzd = dt.Rows[0]["hyc_tjjzd"].ToString(); if (lsTjjzd.Contains("-")) { lsTjjzd = lsTjjzd.Replace("-", ""); //更改字段属性 sqlSelect = " update hyt_flowfield set hy_onclick='WdatePicker({isShowWeek:true,readOnly:true,minDate:''%y-%M-{%d}'',onpicked:function() {$dp.$(''gzzq'').value=$dp.cal.getP(''W'',''WW'');}});hymainajax_getzbjd();' where id='3e062916-45e1-4490-95c5-866a73337991' and hy_tableid='Tablezbgl' "; } else if (lsTjjzd.Contains("+")) { lsTjjzd = lsTjjzd.Replace("+", ""); //更改字段属性 sqlSelect = " update hyt_flowfield set hy_onclick='WdatePicker({isShowWeek:true,readOnly:true,minDate:''%y-%M-{%d-" + lsTjjzd + "}'',onpicked:function() {$dp.$(''gzzq'').value=$dp.cal.getP(''W'',''WW'');}});hymainajax_getzbjd();' where id='3e062916-45e1-4490-95c5-866a73337991' and hy_tableid='Tablezbgl' "; } else { Response.Write("<script>alert('对不起,周报提交截至点填写有误,请联系管理员!');</script>"); } Hyoa_global.ExcuteSQL_BASE(sqlSelect); } else { Response.Write("<script>alert('对不起,周报提交截至点未维护,请联系管理员!');</script>"); } }
//输出一个字段 //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 { //新合同标识 add by wjs at 20150618--start if (newHt != "") { 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() + "&newHt=" + newHt + "&motherid=" + this.txtdocid.Value + "&ishaverole=0\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>"; } 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=0\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>"; } //新合同标识 add by wjs at 20150618--end Label txtTextBox = new Label(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString(); txtTextBox.Text = field_docvalue; tCell2.Controls.Add(txtTextBox); } else { if (newHt != "") { 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() + "&newHt=" + newHt + "&motherid=" + this.txtdocid.Value + "&ishaverole=1\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>"; } 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; }
//判断单位名称是否存在并添加 private void Khdaxx() { HyoaClass.Hyoa_global db = new HyoaClass.Hyoa_global(); string ls_sql = ""; string sql = ""; DataTable dt = new DataTable(); ls_sql = "select * from hyc_Tablekhda where 1=1"; if (Request.Form["jfmc"] != null) { ls_sql += "and hyc_dwmc='" + Request.Form["jfmc"].ToString() + "'"; } dt = db.GetDataTable(ls_sql); if (dt.Rows.Count == 0) { sql = "insert into hyc_Tablekhda(DOCID,hy_mudelid,hy_tableid,hy_djrid,hy_djrname,hy_djrbmname,hy_djrbmid,hy_djsj,hyc_dwmc,hyc_dwdz)"; sql += " values ('" + System.Guid.NewGuid().ToString() + "'"; sql += ",'Mudelkhda','Tablekhda','" + Session["hyuid"].ToString() + "','" + Session["hyuname"].ToString() + "','" + Session["hydeptname"].ToString() + "','" + Session["hydeptid"].ToString() + "',getdate()"; if (Request.Form["jfmc"] != null) { sql += ",'" + Request.Form["jfmc"].ToString() + "','"; } if (Request.Form["jfdz"] != null) { sql += Request.Form["jfdz"].ToString() + "')"; } db.ExcuteSQL(sql); } }
//置为文档已读状态 edited by xf 20140625 private void UpdateReadFlag() { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = ""; //得到初始值 sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'"; DataTable dt = Hyoa_global.GetDataTable(sql); string ls_readuserlist = ""; string ls_readdatelist = ""; if ((dt.Rows[0]["hy_readuserlist"].ToString() + ",").IndexOf("," + Session["hyuid"].ToString() + ",") < 0) { ls_readuserlist = dt.Rows[0]["hy_readuserlist"].ToString() + "," + Session["hyuid"].ToString(); ls_readdatelist = dt.Rows[0]["hy_readdatelist"].ToString() + "," + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); sql = "update hyc_" + this.hy_tableid.Text + " set hy_readuserlist='" + ls_readuserlist + "' ,hy_readdatelist = '" + ls_readdatelist + "'"; sql += " where DOCID='" + this.txtdocid.Value + "'"; Hyoa_global.ExcuteSQL(sql); } }
private void Getslbh() { if (this.hy_tableid.Text == "Tableywsl") { string ls_sql = "SELECT TOP 1 * FROM hyc_Tableslbhwh ORDER BY hyc_pxh"; HyoaClass.Hyoa_global hyoa = new HyoaClass.Hyoa_global(); DataTable dt = hyoa.GetDataTable(ls_sql); if (dt.Rows.Count > 0) { string sqlSelect = ""; if (DateTime.Now.Year.ToString() != dt.Rows[0]["hyc_nf"].ToString()) { sqlSelect = " update hyc_Tableslbhwh set hyc_nf='" + DateTime.Now.Year.ToString() + "',hyc_slbh='1' where docid='" + dt.Rows[0]["DOCID"].ToString() + "' "; hyoa.ExcuteSQL(sqlSelect); } //Response.Write(sqlSelect); //return; string bh = dt.Rows[0]["hyc_slbh"].ToString(); this.txt_slbh.Value += "B"; this.txt_slbh.Value += dt.Rows[0]["hyc_nf"].ToString(); this.txt_slbh.Value += (Convert.ToInt32(DateTime.Now.Month.ToString()) < 10 ? "0" + DateTime.Now.Month : DateTime.Now.Month.ToString()); this.txt_slbh.Value += (Convert.ToInt32(DateTime.Now.Day.ToString()) < 10 ? "0" + DateTime.Now.Day : DateTime.Now.Day.ToString()); if (Convert.ToString(bh).Length == 1) { this.txt_slbh.Value += "000" + dt.Rows[0]["hyc_slbh"]; } if (Convert.ToString(bh).Length == 2) { this.txt_slbh.Value += "00" + dt.Rows[0]["hyc_slbh"]; } if (Convert.ToString(bh).Length == 3) { this.txt_slbh.Value += "0" + dt.Rows[0]["hyc_slbh"]; } if (Convert.ToString(bh).Length == 4) { this.txt_slbh.Value += dt.Rows[0]["hyc_slbh"].ToString(); } } } }
//新文档OPEN时的特殊处理 private void hywebopen_newdoc() { if (this.hy_tableid.Text == "Tablexjsq") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sqlSelect = " select hyc_nxj from hyc_Tablenxjwh where hyc_xm='" + this.Session["hyuname"].ToString() + "' and hyc_nf ='" + DateTime.Now.Year.ToString() + "' "; DataTable dt = Hyoa_global.GetDataTable(sqlSelect); if (dt.Rows.Count > 0) { this.txt_nf.Value = dt.Rows[0]["hyc_nxj"].ToString(); } ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>getNxj()</script>"); } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("login.aspx"); string ls_tip = "保存成功!"; if (this.Session["hyuid"].ToString() == "025" && this.hy_tableid.Text == "Tablejemx") { string sqlSelect = " select * from hyc_Tablefpbd where docid ='" + this.txtMotherid.Value + "' "; HyoaClass.Hyoa_global hyoaGlobal = new Hyoa_global(); DataTable dt = hyoaGlobal.GetDataTable(sqlSelect); if (dt.Rows.Count > 0) { this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString(); this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString(); this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString(); this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString(); } } #region 新建时先进行一次保存 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sql = ""; if (this.txtop.Value == "add") { //处理特殊字符 this.hy_bt.Text = ReplaceString_Tszf(this.hy_bt.Text); if (Session["conntype"].ToString() == "SQL") { //edited by xf 20140625 sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values ("; sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'"; sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'"; sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "','" + this.hy_djsj.Text + "','" + this.hy_bt.Text + "'"; sql += ",'','','," + Session["hyuid"].ToString() + ",',',') "; } if (Session["conntype"].ToString() == "ORACLE") { //edited by xf 20140625 sql = "insert into hyc_" + this.hy_tableid.Text + " (DOCID,hy_mudelid,hy_tableid,hy_flowid,hy_flowname,hy_curtacheid,hy_curtachename,hy_curclrid,hy_curclrname,hy_djrid,hy_djrname,hy_djrbmid,hy_djrbmname,hy_djsj,hy_bt,hy_readuserlist,hy_readdatelist,hy_clrylist,hy_cyrylist) values ("; sql += "'" + this.txtdocid.Value + "','" + this.hy_mudelid.Text + "','" + this.hy_tableid.Text + "','" + this.hy_flowid.Text + "','" + this.hy_flowname.Text + "'"; sql += ",'" + this.hy_curtacheid.Text + "','" + this.hy_curtachename.Text + "','" + this.hy_curclrid.Text + "','" + this.hy_curclrname.Text + "','" + this.hy_djrid.Text + "'"; sql += ",'" + this.hy_djrname.Text + "','" + this.hy_djrbmid.Text + "','" + this.hy_djrbmname.Text + "',to_date('" + this.hy_djsj.Text + "','YYYY-MM-DD HH24:MI:SS'),'" + this.hy_bt.Text + "'"; sql += ",'','','," + Session["hyuid"].ToString() + ",',',') "; } Hyoa_global.ExcuteSQL(sql); //调用添加客户名称的方法 if (this.hy_mudelid.Text == "MudelVODfwxy" && this.hy_tableid.Text == "TableVODfwxy" || this.hy_mudelid.Text == "Mudelffpdfwht" && this.hy_tableid.Text == "Tableffpdfwht" || this.hy_mudelid.Text == "Mudeljdhazfwht" && this.hy_tableid.Text == "Tablejdhazfwht" || this.hy_mudelid.Text == "Mudelsyyhfwxy" && this.hy_tableid.Text == "Tablesyyhfwxy" || this.hy_mudelid.Text == "MudelDVBazfwdght" && this.hy_tableid.Text == "TableDVBazfwdght" || this.hy_mudelid.Text == "MudelDVBazfwdght" && this.hy_tableid.Text == "TableDVBazfwdght" || this.hy_mudelid.Text == "Mudeljwdsjsxy" && this.hy_tableid.Text == "Tablejwdsjsxy" || this.hy_mudelid.Text == "Mudeljwdscsxy" && this.hy_tableid.Text == "Tablejwdscsxy" || this.hy_mudelid.Text == "Mudelkdjrht" && this.hy_tableid.Text == "Tablekdjrht" || this.hy_mudelid.Text == "Mudelsjcsfwht" && this.hy_tableid.Text == "Tablesjcsfwht" || this.hy_mudelid.Text == "Mudelsjgdcsfwht" && this.hy_tableid.Text == "Tablesjgdcsfwht" || this.hy_mudelid.Text == "Mudelsjtxyyhzxy" && this.hy_tableid.Text == "Tablesjtxyyhzxy" || this.hy_mudelid.Text == "Mudelzdyht" && this.hy_tableid.Text == "Tablezdyht") { Khdaxx(); //添加客户信息内容 Htblzt(); //添加办理状态表 } //add by zxx 20150305 if (this.hy_mudelid.Text == "Mudelxjsq" && this.hy_tableid.Text == "Tablexjsq" || this.hy_mudelid.Text == "Mudelshd" && this.hy_tableid.Text == "Tableshd" || this.hy_mudelid.Text == "Mudelszds" && this.hy_tableid.Text == "Tableszds") { Htblzt(); //添加办理状态表 } //add by ccg 20150617 if (this.hy_mudelid.Text == "Mudelsyyhfwxy_new" && this.hy_tableid.Text == "Tablesyyhfwxy_new" || this.hy_mudelid.Text == "Mudelszdsywfwht_new" && this.hy_tableid.Text == "Tableszdsywfwht_new" || this.hy_mudelid.Text == "Mudeljwdscsxy_new" && this.hy_tableid.Text == "Tablejwdscsxy_new" || this.hy_mudelid.Text == "Mudeljwdsjm" && this.hy_tableid.Text == "Tablejwdsjm" || this.hy_mudelid.Text == "Mudelsjcsfwht_new" && this.hy_tableid.Text == "Tablesjcsfwht_new" || this.hy_mudelid.Text == "Mudelkdjrht_new" && this.hy_tableid.Text == "Tablekdjrht_new" || this.hy_mudelid.Text == "Mudelsjgdcsfwht_new" && this.hy_tableid.Text == "Tablesjgdcsfwht_new" || this.hy_mudelid.Text == "Mudelsjtxyyhzxy_new" && this.hy_tableid.Text == "Tablesjtxyyhzxy_new" || this.hy_mudelid.Text == "Mudelzdyht" && this.hy_tableid.Text == "Tablezdyht" || this.hy_mudelid.Text == "Mudelgcsght" && this.hy_tableid.Text == "Tablegcsght" || this.hy_mudelid.Text == "Mudelqtht" && this.hy_tableid.Text == "Tableqtht" || this.hy_mudelid.Text == "Mudelgxhzhht" && this.hy_tableid.Text == "Tablegxhzhht") { Htblzt(); //添加办理状态表 } } #endregion //更新内容 sql = "update hyc_" + this.hy_tableid.Text + " set hy_tableid='" + hy_tableid.Text + "',hy_bt='" + hy_bt.Text + "' "; #region 根据“需要保存的字段”来进行保存 if (txtsavefields.Text != "") { string[] lv_savefields = txtsavefields.Text.Split(','); string[] lv_savefields_sx = txtsavefields_sx.Text.Split(','); string fielddocvalue = ""; for (int i = 0; i < lv_savefields.Length; i++) { if (lv_savefields_sx[i].ToString() == "0") //文本 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); fielddocvalue = ReplaceString_Tszf(fielddocvalue); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'"; } } if (lv_savefields_sx[i].ToString() == "1") //日期 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); if (Session["conntype"].ToString() == "SQL") { if (fielddocvalue == "") sql += ",hyc_" + lv_savefields[i].ToString() + "=null"; else sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'"; } if (Session["conntype"].ToString() == "ORACLE") { if (fielddocvalue == "") sql += ",hyc_" + lv_savefields[i].ToString() + "=null"; else sql += ",hyc_" + lv_savefields[i].ToString() + "=to_date('" + fielddocvalue + "','YYYY-MM-DD HH24:MI:SS')"; } } } if (lv_savefields_sx[i].ToString() == "3") //数值 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); if (fielddocvalue == "") sql += ",hyc_" + lv_savefields[i].ToString() + "=0"; else sql += ",hyc_" + lv_savefields[i].ToString() + "=" + fielddocvalue; } } if (lv_savefields_sx[i].ToString() == "5") //口令 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); fielddocvalue = ReplaceString_Tszf(fielddocvalue); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'"; } } if (lv_savefields_sx[i].ToString() == "6") //编辑器 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); fielddocvalue = ReplaceString_Tszf(fielddocvalue); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + fielddocvalue + "'"; } } if (lv_savefields_sx[i].ToString() == "7") //复选框 { string s = ""; CheckBoxList txfs = (CheckBoxList)this.FindControl(lv_savefields[i].ToString()); foreach (ListItem li in txfs.Items) { if (li.Selected) { if (li.Selected) s += li.Value + ","; } } s = s.TrimEnd(','); s = ReplaceString_Tszf(s); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'"; } if (lv_savefields_sx[i].ToString() == "8") //单选框 { string s = ""; RadioButtonList txfs = (RadioButtonList)this.FindControl(lv_savefields[i].ToString()); foreach (ListItem li in txfs.Items) { if (li.Selected) { if (li.Selected) s += li.Value + ","; } } s = s.TrimEnd(','); s = ReplaceString_Tszf(s); sql += ",hyc_" + lv_savefields[i].ToString() + "='" + s + "'"; } if (lv_savefields_sx[i].ToString() == "9") //意见 { if (this.Request.Form[lv_savefields[i].ToString()] != null) { fielddocvalue = this.Request.Form[lv_savefields[i].ToString()].ToString(); fielddocvalue = ReplaceString_Tszf(fielddocvalue); if (fielddocvalue != "") { HyoaClass.Hyoa_yj Hyoa_yj = new HyoaClass.Hyoa_yj(); Hyoa_yj.yjid = Hyoa_global.GetRandom(); Hyoa_yj.hy_tableid = this.hy_tableid.Text; Hyoa_yj.hy_fatherid = this.txtdocid.Value; Hyoa_yj.hy_fieldid = lv_savefields[i].ToString(); Hyoa_yj.hy_yjuserid = Session["hyuid"].ToString(); Hyoa_yj.hy_yjusername = Session["hyuname"].ToString(); Hyoa_yj.hy_yjdeptid = Session["hydeptid"].ToString(); Hyoa_yj.hy_yjdeptname = Session["hydeptname"].ToString(); Hyoa_yj.hy_yjtime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); Hyoa_yj.hy_yjbody = fielddocvalue; Hyoa_yj.hy_yjip = HttpContext.Current.Request.UserHostAddress; Hyoa_yj.hy_yjifshow = ""; Hyoa_yj.Insert(); } } } } } #endregion #region 保存 if (this.txtwhichoperation.Value == "1") { sql += hylcbctscl(); //特殊处理 } #endregion #region 完成 if (this.txtwc.Text == "1") { Htblztwc(); //特殊处理 } #endregion #region 确认 if (this.txtwhichoperation.Value == "111") { sql += ",hy_ifconfirm='1'"; } #endregion #region 取消确认 if (this.txtwhichoperation.Value == "112") { sql += ",hy_ifconfirm='0'"; } #endregion #region 在主表单内嵌列表的功能中,保存、提交和确认子表单时,需要将父文档的DOCID保存到当前记录的hy_motherid中 //ADD BY XF 2011-11-17 if (this.txtwhichoperation.Value == "1" || this.txtwhichoperation.Value == "2" || this.txtwhichoperation.Value == "111") { if (Request.QueryString["op"] != null) { if (Request.QueryString["op"].ToString() != "") { if (Request.QueryString["motherid"] != null) { if (Request.QueryString["motherid"].ToString() != "") { sql += ",hy_motherid='" + Request.QueryString["motherid"].ToString() + "'"; } } } } } #endregion sql += " where DOCID='" + this.txtdocid.Value + "'"; Hyoa_global.ExcuteSQL(sql); if (this.txtop.Value == "add") { string slbh_sql = "SELECT TOP 1 * FROM hyc_Tableslbhwh ORDER BY hyc_pxh"; string update_sql = ""; DataTable dt_slbh = Hyoa_global.GetDataTable(slbh_sql); if (dt_slbh.Rows.Count > 0) { int bh = Convert.ToInt32(dt_slbh.Rows[0]["hyc_slbh"].ToString()); bh = bh + 1; string docid = dt_slbh.Rows[0]["DOCID"].ToString(); update_sql = "UPDATE hyc_Tableslbhwh SET hyc_slbh = '" + bh + "' WHERE DOCID = '" + docid + "'"; } Hyoa_global.ExcuteSQL(update_sql); } // add by wjs 20141029 end if (this.hy_tableid.Text == "Tabletjjzr") { Zbtjkz(); } #region 处理完成后的提示及跳转(增加刷新附件功能) if (this.txtifsxfj.Text == "1") { Response.Write("<script>window.location='main.aspx?op=modify&mid=" + this.hy_mudelid.Text + "&tableid=" + this.hy_tableid.Text + "&docid=" + this.txtdocid.Value + "&url=" + this.txturl.Value + "'</script>"); } //合同标志位 路径特殊跳转 else if (this.txt_nextFlag.Value == "1") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');try{window.opener.location.reload();}catch(err){}self.close();</script>"); } } #endregion }
//加载主表单 Written by xf 20110515 private void DataPlay() { txtsavefields.Text = ""; txtsavefields_sx.Text = ""; if (this.Request.QueryString["op"] != null) { this.txtop.Value = this.Request.QueryString["op"].ToString(); //新增还是修改 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); #region 新文档 if (this.Request.QueryString["op"] == "add") { this.td_ydry.Visible = false; //新文档时,“已读人员”按钮隐藏 //文档ID(保存POST到当前页面时,DOCID不重新加载) if (!this.IsPostBack) { this.txtdocid.Value = Hyoa_global.GetRandom(); this.hy_djsj.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } this.hy_djrid.Text = this.Session["hyuid"].ToString(); this.hy_djrname.Text = this.Session["hyuname"].ToString(); this.hy_djrbmid.Text = this.Session["hydeptid"].ToString(); this.hy_djrbmname.Text = this.Session["hydeptname"].ToString(); this.lblcurtachenameshow.Text = this.lbltablename.Text; //如果非流程(授权用户可新建信息、可删除所有信息) if (this.txttablerole.Value == "0") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息) if (this.txttablerole.Value == "1") { this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息、授权用户可管理所有信息) if (this.txttablerole.Value == "2") { this.txtSystemClRight.Value = "1"; } //如果非流程(授权用户可新建、只能删自己新建的信息) if (this.txttablerole.Value == "3") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } if (this.txtSystemClRight.Value == "1") { this.td_submit.Visible = true; //保存 this.td_continue.Visible = true; //保存并继续新建 this.td_xyb.Visible = false; //下一步 if (this.hy_tableid.Text == "Tablekdjrht" || this.hy_tableid.Text == "Tablesyyhfwxy" || this.hy_tableid.Text == "Tablejdhazfwht" || this.hy_tableid.Text == "TableVODfwxy" || this.hy_tableid.Text == "Tableffpdfwht" || this.hy_tableid.Text == "TableDVBazfwdght" || this.hy_tableid.Text == "Tablejwdsjsxy" || this.hy_tableid.Text == "Tablejwdscsxy" || this.hy_tableid.Text == "Tablekdjrht" || this.hy_tableid.Text == "Tablesjcsfwht" || this.hy_tableid.Text == "Tablesjgdcsfwht" || this.hy_tableid.Text == "Tablesjtxyyhzxy" || this.hy_tableid.Text == "Tablezdyht" || this.hy_tableid.Text == "Tablegxhzhht" || this.hy_tableid.Text == "Tableqtht" || this.hy_tableid.Text == "Tablexjsq" || this.hy_tableid.Text == "Tableshd" || this.hy_tableid.Text == "Tableszds") { this.td_continue.Visible = false; this.td_xyb.Visible = true; } if (this.hy_tableid.Text == "Tablesyyhfwxy_new" || this.hy_tableid.Text == "Tableszdsywfwht_new" || this.hy_tableid.Text == "Tablejwdscsxy_new" || this.hy_tableid.Text == "Tablejwdsjm" || this.hy_tableid.Text == "Tablesjcsfwht_new" || this.hy_tableid.Text == "Tablekdjrht_new" || this.hy_tableid.Text == "Tablesjgdcsfwht_new" || this.hy_tableid.Text == "Tablesjtxyyhzxy_new" || this.hy_tableid.Text == "Tablegcsght") { this.td_continue.Visible = false; this.td_xyb.Visible = true; } if (this.hy_tableid.Text == "Tablefpbd") { this.btn_consubmit.Value = "付 款"; this.td_consubmit.Visible = true;//确认td_qxsubmit } } else { this.td_submit.Visible = false; //保存 this.td_xyb.Visible = false; //下一步 this.td_continue.Visible = false; //保存并继续新建 } //加载页面 GetMainTableHtml("0", this.txtSystemClRight.Value, "0", ""); hywebopen_newdoc(); //新文档OPEN时的特殊处理 } #endregion #region 旧文档 if (this.Request.QueryString["op"] == "modify") { if (this.Request.QueryString["docid"] != null) { this.txtdocid.Value = this.Request.QueryString["docid"].ToString(); string sql = "select * from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "' "; DataTable dt = Hyoa_global.GetDataTable(sql); if (dt.Rows.Count > 0) { this.hy_mudelid.Text = dt.Rows[0]["hy_mudelid"].ToString(); this.hy_tableid.Text = dt.Rows[0]["hy_tableid"].ToString(); this.hy_flowid.Text = dt.Rows[0]["hy_flowid"].ToString(); this.hy_flowname.Text = dt.Rows[0]["hy_flowname"].ToString(); this.hy_curtacheid.Text = dt.Rows[0]["hy_curtacheid"].ToString(); this.hy_curtachename.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.lblcurtachenameshow.Text = dt.Rows[0]["hy_curtachename"].ToString(); this.hy_curclrid.Text = dt.Rows[0]["hy_curclrid"].ToString(); this.hy_curclrname.Text = dt.Rows[0]["hy_curclrname"].ToString(); this.hy_djrid.Text = dt.Rows[0]["hy_djrid"].ToString(); this.hy_djrname.Text = dt.Rows[0]["hy_djrname"].ToString(); this.hy_djrbmid.Text = dt.Rows[0]["hy_djrbmid"].ToString(); this.hy_djrbmname.Text = dt.Rows[0]["hy_djrbmname"].ToString(); this.hy_djsj.Text = dt.Rows[0]["hy_djsj"].ToString(); if (!this.IsPostBack) { this.hy_bt.Text = dt.Rows[0]["hy_bt"].ToString(); } this.hy_iftx.Text = dt.Rows[0]["hy_iftx"].ToString(); this.hy_zhtxsj.Text = dt.Rows[0]["hy_zhtxsj"].ToString(); this.hy_readuserlist.Text = dt.Rows[0]["hy_readuserlist"].ToString(); this.hy_readdatelist.Text = dt.Rows[0]["hy_readdatelist"].ToString(); this.hy_clrylist.Text = dt.Rows[0]["hy_clrylist"].ToString(); this.hy_cyrylist.Text = dt.Rows[0]["hy_cyrylist"].ToString(); this.hy_motherid.Text = dt.Rows[0]["hy_motherid"].ToString(); this.hy_ifconfirm.Text = dt.Rows[0]["hy_ifconfirm"].ToString(); // this.txt_slbh.Value=dt.Rows[0]["hyc_slbh"].ToString(); UpdateReadFlag(); //打开时添加阅读情况 } dt.Clear(); this.lblcurtachenameshow.Text = this.lbltablename.Text; //如果非流程(授权用户统一管理) if (this.txttablerole.Value == "0") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") this.txtSystemClRight.Value = "1"; } //如果非流程(每个人管理自己的信息) if (this.txttablerole.Value == "1") { //判断是否为当前文档登记人 if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } //如果非流程(每个人操作自己的信息、授权用户可管理所有信息) if (this.txttablerole.Value == "2") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") { this.txtSystemClRight.Value = "1"; } else { if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } } //如果非流程(授权用户可新建、只能删自己新建的信息) if (this.txttablerole.Value == "3") { if (Hy_IfHaveRole(this.hy_mudelid.Text, Session["hyuid"].ToString()) == "1") { if (this.hy_djrid.Text == Session["hyuid"].ToString()) this.txtSystemClRight.Value = "1"; } } if (this.txtSystemClRight.Value == "1") { this.td_submit.Visible = true; //保存 this.td_continue.Visible = false; //保存并继续新建 this.td_xyb.Visible = false; //下一步 if (this.hy_tableid.Text == "Tablekdjrht" || this.hy_tableid.Text == "Tablesyyhfwxy" || this.hy_tableid.Text == "Tablejdhazfwht" || this.hy_tableid.Text == "TableVODfwxy" || this.hy_tableid.Text == "Tableffpdfwht" || this.hy_tableid.Text == "TableDVBazfwdght" || this.hy_tableid.Text == "Tablejwdsjsxy" || this.hy_tableid.Text == "Tablejwdscsxy" || this.hy_tableid.Text == "Tablekdjrht" || this.hy_tableid.Text == "Tablesjcsfwht" || this.hy_tableid.Text == "Tablesjgdcsfwht" || this.hy_tableid.Text == "Tablesjtxyyhzxy" || this.hy_tableid.Text == "Tablezdyht" || this.hy_tableid.Text == "Tablegxhzhht" || this.hy_tableid.Text == "Tableqtht" || this.hy_tableid.Text == "Tablexjsq" || this.hy_tableid.Text == "Tableshd" || this.hy_tableid.Text == "Tableszds" //下面新合同 add by ccg 20150617 || this.hy_tableid.Text == "Tablesyyhfwxy_new" || this.hy_tableid.Text == "Tableszdsywfwht_new" || this.hy_tableid.Text == "Tablejwdscsxy_new" || this.hy_tableid.Text == "Tablejwdsjm" || this.hy_tableid.Text == "Tablesjcsfwht_new" || this.hy_tableid.Text == "Tablekdjrht_new" || this.hy_tableid.Text == "Tablesjgdcsfwht_new" || this.hy_tableid.Text == "Tablesjtxyyhzxy_new" || this.hy_tableid.Text == "Tablezdyht" || this.hy_tableid.Text == "Tablegcsght" || this.hy_tableid.Text == "Tableqtht" || this.hy_tableid.Text == "Tablegxhzhht") { string sql_wc = ""; DataTable dtwc; sql_wc = "select * from hyt_blzt where DOCID='" + this.txtdocid.Value + "' and hy_state='未完成'"; dtwc = Hyoa_global.GetDataTable(sql_wc); if (dtwc.Rows.Count > 0) { if (dtwc.Rows[0]["hy_state"].ToString() == "未完成") { this.td_wcan.Visible = true; //完成 } } this.td_continue.Visible = false; this.td_xyb.Visible = true; } if (this.hy_ifconfirm.Text != "1" && this.hy_tableid.Text == "Tablefpbd") { this.btn_consubmit.Value = "付款"; this.td_consubmit.Visible = true; //确认 } } else { this.td_submit.Visible = false; //保存 //this.td_wcan.Visible = false; //完成 this.td_xyb.Visible = false; //下一步 this.td_continue.Visible = false; //保存并继续新建 } //如果是超级管理员把取消按钮显示出来。用于用户确认后还要修改 //if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString())) //{ // this.td_qxsubmit.Visible = true; //取消按钮 //} //加载主表单页面 GetMainTableHtml("1", this.txtSystemClRight.Value, "0", ""); //----加载评论页面 s add by xf 2011-11-19----- HyoaClass.Hyoa_tableconfig Hyoa_tableconfig_forpinglun = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig_forpinglun = Hyoa_tableconfig_forpinglun.GetTablesbymudelidandtableid(this.hy_mudelid.Text, this.hy_tableid.Text); if (dt_tableconfig_forpinglun.Rows.Count > 0) { if (dt_tableconfig_forpinglun.Rows[0]["hy_ifcomment"] != null) { if (dt_tableconfig_forpinglun.Rows[0]["hy_ifcomment"].ToString() == "是") { this.tb_nbsp.Visible = true; this.tb_pltitle.Visible = true; this.tb_plbody.Visible = true; this.td_pinglun.Visible = true; //得到已经评论的内容 HyoaClass.Hyoa_pinglun Hyoa_pinglun = new HyoaClass.Hyoa_pinglun(); DataTable dt_pinglun = Hyoa_pinglun.GetcommentByfatherid(this.txtdocid.Value); if (dt_pinglun.Rows.Count > 0) { //输出评论记录 this.lblbody.Text = ""; for (var i = 0; i < dt_pinglun.Rows.Count; i++) { this.lblbody.Text += dt_pinglun.Rows[i]["hy_plbody"].ToString() + "<br> "; this.lblbody.Text += "(评论人:" + dt_pinglun.Rows[i]["hy_plusername"].ToString() + " 所在部门:" + dt_pinglun.Rows[i]["hy_pldeptname"].ToString(); this.lblbody.Text += " 评论时间:" + dt_pinglun.Rows[i]["hy_pltime"].ToString() + " IP:" + dt_pinglun.Rows[i]["hy_plip"].ToString(); this.lblbody.Text += ")<br><hr height=1 color=#DEEEFE></hr>"; } } } } } //----加载评论页面 e----- } hywebopen_olddoc(); //旧文档OPEN的特殊处理 } #endregion } // 部门礼品卡 显示导出按键 小潘 2015-12 if (this.hy_tableid.Text == "Tablelpksqd") { //if (this.hy_curtacheid.Text == "tache0001" || this.hy_curtacheid.Text == "**") //{ this.td_dc.Visible = true; //} } }
// 开票 检测是否付款 protected void btnKp_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string sqlSelect = " select docid from hyc_Tablefpbd where hyc_fatherid='" + this.txtdocid.Value + "' "; DataTable dt = Hyoa_global.GetDataTable(sqlSelect); if (dt.Rows.Count > 0) { Response.Write("<script>alert('对不起,该合同已经开票!!!');</script>"); return; } ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>CreateForm();</script>"); }
protected void btndelinfo_sq_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); String[] v_uids = this.txtuids.Value.Split(','); string ls_filepath = ""; if (this.txttableid.Value == "TableVODfwxy" || this.txttableid.Value == "Tableffpdfwht" || this.txttableid.Value == "Tablejdhazfwht" || this.txttableid.Value == "Tablesyyhfwxy" || this.txttableid.Value == "TableDVBazfwdght" || this.txttableid.Value == "TableDVBazfwdght" || this.txttableid.Value == "Tablejwdsjsxy" || this.txttableid.Value == "Tablejwdscsxy" || this.txttableid.Value == "Tablekdjrht" || this.txttableid.Value == "Tablesjcsfwht" || this.txttableid.Value == "Tablesjgdcsfwht" || this.txttableid.Value == "Tablesjtxyyhzxy" || this.txttableid.Value == "Tablezdyht" || this.txttableid.Value == "Tablesyyhfwxy_new" || this.txttableid.Value == "Tableszdsywfwht_new" || this.txttableid.Value == "Tablejwdscsxy_new" || this.txttableid.Value == "Tablejwdsjm" || this.txttableid.Value == "Tablesjcsfwht_new" || this.txttableid.Value == "Tablekdjrht_new" || this.txttableid.Value == "Tablesjgdcsfwht_new" || this.txttableid.Value == "Tablesjtxyyhzxy_new" || this.txttableid.Value == "Tableqtht" || this.txttableid.Value == "Tablegxhzhht") { for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { string sql = "update hyc_" + txttableid.Value + " set hy_iftx='1',hy_zhtxsj='" + System.DateTime.Now.ToString() + "' where DOCID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(sql); //删除文档时将待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = v_uids[i]; Hyoa_dbsy.Deletebydocid(v_uids[i]); //删除文档时将待办事宜删除end //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start add by xf 20121016 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cl.DeleteByDOCID(); HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cy.DeleteByDOCID(); //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end ////删的时候将附件也删除start //HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); //DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]); //if (dtfileatt.Rows.Count > 0) //{ // for (int k = 0; k < dtfileatt.Rows.Count; k++) // { // ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString(); // if (File.Exists(ls_filepath)) // { // System.IO.File.Delete(ls_filepath); // } // Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString(); // Hyoa_fileatt.Delete(); // } //} //删的时候将附件也删除end //生成删除日志 start string ls_oppcontent = "表名:hyc_" + txttableid.Value + ";文档ID:" + v_uids[i] + "被删除。"; HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log(); Hyoa_log.ID = System.Guid.NewGuid().ToString(); Hyoa_log.hy_createtime = System.DateTime.Now.ToString(); string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } Hyoa_log.hy_oppip = userip; Hyoa_log.hy_opptype = "删除"; Hyoa_log.hy_oppcontent = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); } else { for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { //判断是否是当前用户的文档 string sql = "select * from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'"; DataTable dt_judge = Hyoa_global.GetDataTable(sql); if (dt_judge.Rows.Count > 0) { if (dt_judge.Rows[0]["hy_djrid"].ToString() == Session["hyuid"].ToString()) { sql = "delete from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(sql); //删除文档时将待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = v_uids[i]; Hyoa_dbsy.Deletebydocid(v_uids[i]); //删除文档时将待办事宜删除end //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start add by xf 20121016 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cl.DeleteByDOCID(); HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cy.DeleteByDOCID(); //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end //删的时候将附件也删除start HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]); if (dtfileatt.Rows.Count > 0) { for (int k = 0; k < dtfileatt.Rows.Count; k++) { ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString(); if (File.Exists(ls_filepath)) { System.IO.File.Delete(ls_filepath); } Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString(); Hyoa_fileatt.Delete(); } } //删的时候将附件也删除end //生成删除日志 start string ls_oppcontent = "表名:hyc_" + txttableid.Value + ";文档ID:" + v_uids[i] + "被删除。"; HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log(); Hyoa_log.ID = System.Guid.NewGuid().ToString(); Hyoa_log.hy_createtime = System.DateTime.Now.ToString(); string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (userip == null || userip == "") { userip = Request.ServerVariables["REMOTE_ADDR"]; } Hyoa_log.hy_oppip = userip; Hyoa_log.hy_opptype = "删除"; Hyoa_log.hy_oppcontent = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end } } } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); } }
//输出一个字段 public void GetFieldHtml(TableRow tRow, int li_colnums_show, string hy_fieldid) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); //得到字段属性 DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.txtmudelid.Value, hy_fieldid, this.txttableid.Value); if (dtfield.Rows.Count > 0) { string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString(); //插入单元格(左侧) TableCell tCell = new TableCell(); tRow.Cells.Add(tCell); tCell.Width = Unit.Percentage((30 / 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())); //插入单元格(右侧) TableCell tCell2 = new TableCell(); tRow.Cells.Add(tCell2); tCell2.Width = Unit.Percentage((70 / li_colnums_show)); tCell2.Height = Unit.Pixel(30); tCell2.CssClass = "Tdcellright"; tCell2.HorizontalAlign = HorizontalAlign.Left; //单行文本 if (field_type == "文本") { 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()); } tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个查询条件 addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString(), "0"); } //多行文本 if (field_type == "多行文本") { 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()); } tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个查询条件 addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString(), "0"); } //日期 if (field_type == "日期") { TextBox txtTextBox = new TextBox(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString() + "_s"; 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("45%"); if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } txtTextBox.Attributes.Add("onclick", "WdatePicker({el:$dp.$('" + dtfield.Rows[0]["hy_fieldid"].ToString() + "_s" + "')})"); tCell2.Controls.Add(txtTextBox); tCell2.Controls.Add(new LiteralControl("至")); TextBox txtTextBox2 = new TextBox(); txtTextBox2.ID = dtfield.Rows[0]["hy_fieldid"].ToString() + "_e"; if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { txtTextBox2.ReadOnly = true; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox2.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } txtTextBox2.Width = Unit.Parse("45%"); if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox2.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } txtTextBox2.Attributes.Add("onclick", "WdatePicker({el:$dp.$('" + dtfield.Rows[0]["hy_fieldid"].ToString() + "_e" + "')})"); tCell2.Controls.Add(txtTextBox2); //插入字段:共有哪几个查询条件 addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString() + "_s", "1"); addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString() + "_e", "2"); } //文本加按钮 if (field_type == "文本加按钮") { 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()); } tCell2.Controls.Add(txtTextBox); Button btnButton = new Button(); btnButton.ID = "btn_" + dtfield.Rows[0]["hy_fieldid"].ToString(); btnButton.CssClass = "btn3"; btnButton.Text = " 选 择 "; btnButton.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); tCell2.Controls.Add(btnButton); //插入字段:共有哪几个查询条件 addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString(), "0"); } //多行文本加按钮 if (field_type == "多行文本加按钮") { 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(); } txtTextBox.Width = Unit.Parse("60%"); if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } tCell2.Controls.Add(txtTextBox); Button btnButton = new Button(); btnButton.ID = "btn_" + dtfield.Rows[0]["hy_fieldid"].ToString(); btnButton.CssClass = "btn3"; btnButton.Text = " 选 择 "; btnButton.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString()); tCell2.Controls.Add(btnButton); //插入字段:共有哪几个查询条件 addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString(), "0"); } //数值 if (field_type == "数值") { TextBox txtTextBox = new TextBox(); txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString() + "_s"; if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } txtTextBox.Width = Unit.Parse("45%"); if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } tCell2.Controls.Add(txtTextBox); tCell2.Controls.Add(new LiteralControl("至")); TextBox txtTextBox2 = new TextBox(); txtTextBox2.ID = dtfield.Rows[0]["hy_fieldid"].ToString() + "_e"; if (dtfield.Rows[0]["hy_class"].ToString() != "") { txtTextBox2.CssClass = dtfield.Rows[0]["hy_class"].ToString(); } txtTextBox2.Width = Unit.Parse("45%"); if (dtfield.Rows[0]["hy_height"].ToString() != "") { txtTextBox2.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString()); } tCell2.Controls.Add(txtTextBox2); //插入字段:共有哪几个查询条件 addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString() + "_s", "3"); addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString() + "_e", "4"); } //对话框列表(下拉框 if (field_type == "对话框列表") { 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() != "") { DataTable dt_options = Hyoa_global.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); 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("--请选择--", "")); tCell2.Controls.Add(ddlDropDownList); //插入字段:共有哪几个查询条件 addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString(), "0"); } //复选框(查询时直接显示文本框) if (field_type == "复选框") { TextBox txtTextBox = new TextBox(); 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()); } tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个查询条件 addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString(), "0"); } //单选框(查询时直接显示文本框) if (field_type == "单选框") { TextBox txtTextBox = new TextBox(); 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()); } tCell2.Controls.Add(txtTextBox); //插入字段:共有哪几个查询条件 addsearchfields(dtfield.Rows[0]["hy_fieldid"].ToString(), "0"); } } }
private void DataPlay(int PageNo) { //得到当前模块对应的role HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel(); DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value); string ls_role = "Role9999"; if (dt_mudel.Rows.Count > 0) { ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString(); } //根据表ID和模块ID得到当前传进来的模块是否有流程 HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dttableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.txtmudelid.Value, this.txttableid.Value); //根据表单得到对应的所有字段 HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); DataTable dtflowfield = Hyoa_flowfield.Getflowfieldsbytableid(dttableconfig.Rows[0]["ID"].ToString()); //循环所有字段 string ls_flowfield = ""; if (dtflowfield.Rows.Count > 0) { for (int i = 0; i < dtflowfield.Rows.Count; i++) { string ls_fieldtype = dtflowfield.Rows[i]["hy_fieldtype"].ToString(); if (ls_fieldtype == "文本" || ls_fieldtype == "多行文本" || ls_fieldtype == "文本加按钮" || ls_fieldtype == "多行文本加按钮" || ls_fieldtype == "日期" || ls_fieldtype == "数值" || ls_fieldtype == "对话框列表" || ls_fieldtype == "复选框" || ls_fieldtype == "单选框" || ls_fieldtype == "口令") { ls_flowfield += ",a.hyc_" + dtflowfield.Rows[i]["hy_fieldid"].ToString(); } } } //判断当前用户是否有删除权限 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //如果非流程(授权用户可新建信息、可删除所有信息) if (dttableconfig.Rows[0]["hy_tablerole"].ToString() == "0") { if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString())) { this.isrole.Value = "1"; this.newcontrol.Visible = true; this.delcontrol.Visible = true; //this.copycontrol.Visible = true; } else { this.isrole.Value = "0"; } } //如果非流程(每个人管理自己的信息) if (dttableconfig.Rows[0]["hy_tablerole"].ToString() == "1") { this.isrole.Value = "1"; this.newcontrol.Visible = true; this.delcontrol_my.Visible = true; //this.copycontrol.Visible = true; } //如果非流程(每个人管理自己的信息、授权用户可管理所有信息) if (dttableconfig.Rows[0]["hy_tablerole"].ToString() == "2") { if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString())) { this.isrole.Value = "1"; this.newcontrol.Visible = true; this.delcontrol.Visible = true; //this.copycontrol.Visible = true; } else { this.isrole.Value = "0"; this.newcontrol.Visible = true; this.delcontrol_my.Visible = true; //this.copycontrol.Visible = true; } } //如果非流程(授权用户可新建、只能删自己新建的信息) if (dttableconfig.Rows[0]["hy_tablerole"].ToString() == "3") { if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString())) { this.isrole.Value = "1"; this.newcontrol.Visible = true; this.delcontrol_sq.Visible = true; //this.copycontrol.Visible = true; } } HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig(); DataTable dtlist = Hyoa_listconfig.Getlistconfig(this.txtlistid.Value); //列表配置 this.lbdisplaytitle.Text = ""; //得到当前页号 this.curpage.Text = PageNo.ToString(); //---查询条件---开始 string cmdStr_Search = ""; if (txtsearchfields.Text != "") { string[] lv_searchfields = txtsearchfields.Text.Split(','); string[] lv_searchfields_sx = txtsearchfields_sx.Text.Split(','); for (int i = 0; i < lv_searchfields.Length; i++) { string ls_fieldid = lv_searchfields[i].ToString(); string ls_fieldid_sx = lv_searchfields_sx[i].ToString(); string ls_searchtext = ""; if (this.Request.Form[ls_fieldid] != null) { ls_searchtext = this.Request.Form[ls_fieldid].ToString(); } if (ls_searchtext != "") { if (ls_fieldid_sx == "0") { if (ls_searchtext.Contains(",")) { string[] lv_searchfieldSplit = ls_searchtext.Split(','); for (int n = 0; n < lv_searchfieldSplit.Length; n++) { if (n == 0) { cmdStr_Search += " and hyc_" + ls_fieldid + " like '%" + lv_searchfieldSplit[n] + "%' "; } else { cmdStr_Search += " or hyc_" + ls_fieldid + " like '%" + lv_searchfieldSplit[n] + "%' "; } } } else { cmdStr_Search += " and hyc_" + ls_fieldid + " like '%" + ls_searchtext + "%' "; } } else { if (ls_fieldid_sx == "1") { if (Session["conntype"].ToString() == "SQL") { cmdStr_Search += " and left(CONVERT(varchar, hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ", 120 ) ,10) >= '" + ls_searchtext + "' "; } if (Session["conntype"].ToString() == "ORACLE") { cmdStr_Search += " and to_char(hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ",'YYYY-MM-DD') >= '" + ls_searchtext + "' "; } } if (ls_fieldid_sx == "2") { if (Session["conntype"].ToString() == "SQL") { cmdStr_Search += " and left(CONVERT(varchar, hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ", 120 ) ,10) <= '" + ls_searchtext + "' "; } if (Session["conntype"].ToString() == "ORACLE") { cmdStr_Search += " and to_char(hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ",'YYYY-MM-DD') <= '" + ls_searchtext + "' "; } } if (ls_fieldid_sx == "3") { cmdStr_Search += " and hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + " >= " + ls_searchtext + " "; } if (ls_fieldid_sx == "4") { cmdStr_Search += " and hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + " <= " + ls_searchtext + " "; } } } } } //---查询条件---结束 //---排序---开始 string cmdStr_SearchSort = ""; if (dtlist.Rows[0]["hy_sortfield1"].ToString() != "") { if (cmdStr_SearchSort == "") { cmdStr_SearchSort = " order by hyc_" + dtlist.Rows[0]["hy_sortfield1"].ToString() + " " + dtlist.Rows[0]["hy_sorttype1"].ToString(); } else { cmdStr_SearchSort += " ,hyc_" + dtlist.Rows[0]["hy_sortfield1"].ToString() + " " + dtlist.Rows[0]["hy_sorttype1"].ToString(); } } if (dtlist.Rows[0]["hy_sortfield2"].ToString() != "") { if (cmdStr_SearchSort == "") { cmdStr_SearchSort = " order by hyc_" + dtlist.Rows[0]["hy_sortfield2"].ToString() + " " + dtlist.Rows[0]["hy_sorttype2"].ToString(); } else { cmdStr_SearchSort += " ,hyc_" + dtlist.Rows[0]["hy_sortfield2"].ToString() + " " + dtlist.Rows[0]["hy_sorttype2"].ToString(); } } if (dtlist.Rows[0]["hy_sortfield3"].ToString() != "") { if (cmdStr_SearchSort == "") { cmdStr_SearchSort = " order by hyc_" + dtlist.Rows[0]["hy_sortfield3"].ToString() + " " + dtlist.Rows[0]["hy_sorttype3"].ToString(); } else { cmdStr_SearchSort += " ,hyc_" + dtlist.Rows[0]["hy_sortfield3"].ToString() + " " + dtlist.Rows[0]["hy_sorttype3"].ToString(); } } if (this.txtfieldid.Value != "" && this.txtfieldsort.Value != "") { cmdStr_SearchSort = " order by hyc_" + this.txtfieldid.Value + " " + this.txtfieldsort.Value + " "; } if (cmdStr_SearchSort == "") { //没有配置,则默认按登记日期 cmdStr_SearchSort = " order by hy_djsj desc "; } //---排序---结束 //--根据查询条件得到返回数据集--s DataTable dt = new DataTable(); //单页数据集 DataTable dt_total = new DataTable(); //数据总条数,返回总条数值 DataTable dttable = Hyoa_tableconfig.GetTable(this.txttableid.Value); //得到表配置信息查看当前表是否有流程 hy_ifflowdoc string sql_sc = ""; //sql语句 hy_iftx=1 表示该合同已删除 if (this.txttableid.Value == "TableVODfwxy" || this.txttableid.Value == "Tableffpdfwht" || this.txttableid.Value == "Tablejdhazfwht" || this.txttableid.Value == "Tablesyyhfwxy" || this.txttableid.Value == "TableDVBazfwdght" || this.txttableid.Value == "TableDVBazfwdght" || this.txttableid.Value == "Tablejwdsjsxy" || this.txttableid.Value == "Tablejwdscsxy" || this.txttableid.Value == "Tablekdjrht" || this.txttableid.Value == "Tablesjcsfwht" || this.txttableid.Value == "Tablesjgdcsfwht" || this.txttableid.Value == "Tablesjtxyyhzxy" || this.txttableid.Value == "Tablezdyht" || this.txttableid.Value == "Tablesyyhfwxy_new" || this.txttableid.Value == "Tableszdsywfwht_new" || this.txttableid.Value == "Tablejwdscsxy_new" || this.txttableid.Value == "Tablejwdsjm" || this.txttableid.Value == "Tablesjcsfwht_new" || this.txttableid.Value == "Tablekdjrht_new" || this.txttableid.Value == "Tablesjgdcsfwht_new" || this.txttableid.Value == "Tablesjtxyyhzxy_new" || this.txttableid.Value == "Tableqtht" || this.txttableid.Value == "Tablegxhzhht") { sql_sc = " and hy_iftx is null"; } string cmdStr = ""; if (dttable.Rows[0]["hy_ifdisplayall"].ToString() == "是") { string ls_from = ""; ls_from = " hyc_" + this.txttableid.Value + " where 1=1 " + sql_sc + cmdStr_Search; if (Session["conntype"].ToString() == "SQL") { cmdStr = "select top " + PageSize.Text + " * from " + ls_from; cmdStr += " and DOCID not in (select top " + ((PageNo - 1) * int.Parse(PageSize.Text)).ToString() + " DOCID from " + ls_from + cmdStr_SearchSort + ") " + cmdStr_SearchSort; } if (Session["conntype"].ToString() == "ORACLE") { cmdStr = " select * from ( "; cmdStr += " select my_table.*, rownum as my_rownum from "; cmdStr += " ( "; cmdStr += " select * from hyc_" + this.txttableid.Value + " where 1=1 " + cmdStr_Search + cmdStr_SearchSort; cmdStr += " ) my_table "; cmdStr += " where rownum<= " + ((PageNo) * int.Parse(PageSize.Text)).ToString(); cmdStr += " ) where my_rownum> " + ((PageNo - 1) * int.Parse(PageSize.Text)).ToString(); } dt = Hyoa_global.GetDataTable(cmdStr); cmdStr = "select count(*) from " + ls_from; dt_total = Hyoa_global.GetDataTable(cmdStr); } else { string ls_from = " hyc_" + this.txttableid.Value + " where 1=1 " + sql_sc; //特殊处理 add by wjs at 20150701 依据模块id得到权限id 再依据权限id来判断显示内容 start string strRoleid = ""; string sqlSelect = " select hy_roleid from hyt_mudel where hy_mudelid='" + this.txtmudelid.Value + "' "; DataTable dt_role = Hyoa_global.GetDataTable_BASE(sqlSelect); if (dt_role.Rows.Count > 0) { strRoleid = dt_role.Rows[0]["hy_roleid"].ToString(); strRoleid = strRoleid.Substring(0, strRoleid.Length - 3); //查看所有权限 直接查看所有 if (Hyoa_global.isHaveRole(strRoleid + "001", this.Session["hyuid"].ToString())) { } else if (Hyoa_global.isHaveRole(strRoleid + "003", this.Session["hyuid"].ToString())) { ls_from += " and hy_djrbmid='" + this.Session["hydeptid"].ToString() + "' "; } else { ls_from += " and hy_djrid='" + this.Session["hyuid"].ToString() + "' "; } } else { ls_from += " and hy_djrid='" + this.Session["hyuid"].ToString() + "' "; } //特殊处理 add by wjs at 20150701 依据模块id得到权限id 再依据权限id来判断显示内容 end ls_from += " " + cmdStr_Search; if (Session["conntype"].ToString() == "SQL") { cmdStr = "select top " + PageSize.Text + " * from " + ls_from; cmdStr += " and DOCID not in (select top " + ((PageNo - 1) * int.Parse(PageSize.Text)).ToString() + " DOCID from " + ls_from + cmdStr_SearchSort + ") " + cmdStr_SearchSort; } if (Session["conntype"].ToString() == "ORACLE") { cmdStr = " select * from ( "; cmdStr += " select my_table.*, rownum as my_rownum from "; cmdStr += " ( "; cmdStr += " select * from hyc_" + this.txttableid.Value + " where 1=1 " + cmdStr_Search + cmdStr_SearchSort; cmdStr += " ) my_table "; cmdStr += " where rownum<= " + ((PageNo) * int.Parse(PageSize.Text)).ToString(); cmdStr += " ) where my_rownum> " + ((PageNo - 1) * int.Parse(PageSize.Text)).ToString(); } this.strSQL.Value = cmdStr; dt = Hyoa_global.GetDataTable(cmdStr); cmdStr = "select count(*) from " + ls_from; dt_total = Hyoa_global.GetDataTable(cmdStr); } //--根据查询条件得到返回数据集--e //开始输出----整合成HTML为数据行 DataTable tempTable = dt.Clone(); DataColumn col = new DataColumn("displaycol", typeof(String)); //定义新的一列 add tempTable.Columns.Add(col); //追加一列 add string lscolname = ""; string lscolnameid = ""; string lscolwidth = ""; string ls_col = ""; string[] lvcolname; string[] lvcolnameid; string[] lvcolwidth; string lscolwidthper; lscolname = dtlist.Rows[0]["hy_columnshow"].ToString(); //要显示的列名:附件,标题,收文来源 lscolnameid = dtlist.Rows[0]["hy_columnshowid"].ToString(); //要显示的列名id:uploadfile1,Hy_bt,Hy_swly lscolwidth = dtlist.Rows[0]["hy_width"].ToString(); //要显示的列名id:10,20,30 lvcolname = lscolname.Split(','); lvcolnameid = lscolnameid.Split(','); lvcolwidth = lscolwidth.Split(','); if (dt.Rows.Count <= 0) { //如果没有数据则输出表头 for (int n = 0; n < lvcolname.Length; n++) { if (n >= lvcolwidth.Length) { lscolwidthper = ""; }//此判断是为了防止对应宽度没有输入时,会溢出报错。 else { lscolwidthper = lvcolwidth[n]; } this.lbdisplaytitle.Text += "<td width=\"" + lscolwidthper + "%\" class=\"TdcellHead\"><p align=\"center\">" + lvcolname[n] + "</td>"; } } for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); //输出主表所有字段,start for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } //输出主表所有字段,end //////开始得到列的值 DataTable dtgetsqlfield; for (int m = 0; m < lvcolname.Length; m++) { //如果有数据,则输出数据 if (m >= lvcolwidth.Length) { lscolwidthper = ""; }//此判断是为了防止对应宽度没有输入时,会溢出报错。 else { lscolwidthper = lvcolwidth[m]; } dtgetsqlfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.txtmudelid.Value, lvcolnameid[m], this.txttableid.Value); if (i % System.Int32.Parse(PageSize.Text) == 0) this.lbdisplaytitle.Text += "<td width=\"" + lscolwidthper + "%\" class=\"TdcellHead\"><p align=\"center\"><a href=\"#\" title=\"点击可排序\" onclick=\"fun_sort('" + lvcolnameid[m] + "');\">" + lvcolname[m] + "</a></p></td>"; //根据字段英文名,得到数据库中对应的字段 string lsgetsqlfield = "hyc_" + dtgetsqlfield.Rows[0]["hy_fieldid"].ToString(); //根据数据库中对应的字段,得到输出字段的值start (日期型根据格式进行了转换) string lsgetputfiled = ""; if (dtgetsqlfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") { if (dt.Rows[i][lsgetsqlfield].ToString() != "") lsgetputfiled = System.DateTime.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToShortDateString(); } else { //解决Float小数点后面出现N位小数乱码的问题 if (dtgetsqlfield.Rows[0]["hy_fieldtype"].ToString() == "数值") { if (dt.Rows[i][lsgetsqlfield].ToString() != "") { //是否包含小数点,包含的话,取小数点后两位 //if (dt.Rows[i][lsgetsqlfield].ToString().Contains(".") == true) //{ // lsgetputfiled = float.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToString("F2"); //} //else //{ lsgetputfiled = float.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToString(); //} } else { lsgetputfiled = "0"; } //lsgetputfiled = dt.Rows[i][lsgetsqlfield].ToString(); } else { lsgetputfiled = dt.Rows[i][lsgetsqlfield].ToString(); } } if (lsgetputfiled == "") lsgetputfiled = " "; //根据得到的SQL字段,得到输出字段的值end if (dtgetsqlfield.Rows[0]["hy_ifdbsybt"].ToString() == "是") { ls_col += "<td width=\"" + lscolwidthper + "%\" align=\"center\"><a href=\"#\" onclick=\"var ss='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() + "&url='+window.location;window.location=ss;\">" + lsgetputfiled + "</a></td>"; } else { ls_col += "<td width=\"" + lscolwidthper + "%\" align=\"center\">" + lsgetputfiled + "</td>"; } } dr["displaycol"] = ls_col; //将新值赋给相应的列 add ls_col = ""; tempTable.Rows.Add(dr); } int TotalRecord = int.Parse(dt_total.Rows[0][0].ToString()); this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.ShowTotalRecord.Text = TotalRecord.ToString(); //计算及显示总页数 int TotalPage; if (TotalRecord < System.Int32.Parse(PageSize.Text)) { TotalPage = 1; } else { if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0) { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1; } else { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text); } } this.ShowTotalPage.Text = TotalPage.ToString(); this.rptlist.DataSource = tempTable; this.rptlist.DataBind(); dt.Clear(); //列表中的一些特殊处理,都放在这个函数内 DataPlay_Tscl(); }
private void DataPlay(int PageNo) { //根据表ID和模块ID得到当前传进来的模块是否有流程 HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dttableconfig = Hyoa_tableconfig.GetTablesbymudelidandtableid(this.txtmudelid.Value, this.txttableid.Value); //根据表单得到对应的所有字段 HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); DataTable dtflowfield = Hyoa_flowfield.Getflowfieldsbytableid(dttableconfig.Rows[0]["ID"].ToString()); //循环所有字段 string ls_flowfield = ""; if (dtflowfield.Rows.Count > 0) { for (int i = 0; i < dtflowfield.Rows.Count; i++) { string ls_fieldtype = dtflowfield.Rows[i]["hy_fieldtype"].ToString(); if (ls_fieldtype == "文本" || ls_fieldtype == "多行文本" || ls_fieldtype == "文本加按钮" || ls_fieldtype == "多行文本加按钮" || ls_fieldtype == "日期" || ls_fieldtype == "数值" || ls_fieldtype == "对话框列表" || ls_fieldtype == "复选框" || ls_fieldtype == "单选框" || ls_fieldtype == "口令") { ls_flowfield += ",a.hyc_" + dtflowfield.Rows[i]["hy_fieldid"].ToString(); } } } HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig(); DataTable dtlist = Hyoa_listconfig.Getlistconfig(this.txtlistid.Value); //列表配置 this.lbdisplaytitle.Text = ""; //得到当前页号 this.curpage.Text = PageNo.ToString(); //---查询条件---开始 string cmdStr_Search = ""; if (txtsearchfields.Text != "") { string[] lv_searchfields = txtsearchfields.Text.Split(','); string[] lv_searchfields_sx = txtsearchfields_sx.Text.Split(','); for (int i = 0; i < lv_searchfields.Length; i++) { string ls_fieldid = lv_searchfields[i].ToString(); string ls_fieldid_sx = lv_searchfields_sx[i].ToString(); string ls_searchtext = ""; if (this.Request.Form[ls_fieldid] != null) { ls_searchtext = this.Request.Form[ls_fieldid].ToString(); } if (ls_searchtext != "") { if (ls_fieldid_sx == "0") { cmdStr_Search += " and hyc_" + ls_fieldid + " like '%" + ls_searchtext + "%' "; } else { if (ls_fieldid_sx == "1") { if (Session["conntype"].ToString() == "SQL") { cmdStr_Search += " and left(CONVERT(varchar, hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ", 120 ) ,10) >= '" + ls_searchtext + "' "; } if (Session["conntype"].ToString() == "ORACLE") { cmdStr_Search += " and to_char(hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ",'YYYY-MM-DD') >= '" + ls_searchtext + "' "; } } if (ls_fieldid_sx == "2") { if (Session["conntype"].ToString() == "SQL") { cmdStr_Search += " and left(CONVERT(varchar, hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ", 120 ) ,10) <= '" + ls_searchtext + "' "; } if (Session["conntype"].ToString() == "ORACLE") { cmdStr_Search += " and to_char(hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + ",'YYYY-MM-DD') <= '" + ls_searchtext + "' "; } } if (ls_fieldid_sx == "3") { cmdStr_Search += " and hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + " >= " + ls_searchtext + " "; } if (ls_fieldid_sx == "4") { cmdStr_Search += " and hyc_" + ls_fieldid.Substring(0, ls_fieldid.Length - 2) + " <= " + ls_searchtext + " "; } } } } } //---查询条件---结束 //---排序---开始 string cmdStr_SearchSort = ""; if (dtlist.Rows[0]["hy_sortfield1"].ToString() != "") { if (cmdStr_SearchSort == "") { cmdStr_SearchSort = " order by hyc_" + dtlist.Rows[0]["hy_sortfield1"].ToString() + " " + dtlist.Rows[0]["hy_sorttype1"].ToString(); } else { cmdStr_SearchSort += " ,hyc_" + dtlist.Rows[0]["hy_sortfield1"].ToString() + " " + dtlist.Rows[0]["hy_sorttype1"].ToString(); } } if (dtlist.Rows[0]["hy_sortfield2"].ToString() != "") { if (cmdStr_SearchSort == "") { cmdStr_SearchSort = " order by hyc_" + dtlist.Rows[0]["hy_sortfield2"].ToString() + " " + dtlist.Rows[0]["hy_sorttype2"].ToString(); } else { cmdStr_SearchSort += " ,hyc_" + dtlist.Rows[0]["hy_sortfield2"].ToString() + " " + dtlist.Rows[0]["hy_sorttype2"].ToString(); } } if (dtlist.Rows[0]["hy_sortfield3"].ToString() != "") { if (cmdStr_SearchSort == "") { cmdStr_SearchSort = " order by hyc_" + dtlist.Rows[0]["hy_sortfield3"].ToString() + " " + dtlist.Rows[0]["hy_sorttype3"].ToString(); } else { cmdStr_SearchSort += " ,hyc_" + dtlist.Rows[0]["hy_sortfield3"].ToString() + " " + dtlist.Rows[0]["hy_sorttype3"].ToString(); } } if (this.txtfieldid.Value != "" && this.txtfieldsort.Value != "") { cmdStr_SearchSort = " order by hyc_" + this.txtfieldid.Value + " " + this.txtfieldsort.Value + " "; } if (cmdStr_SearchSort == "") { //没有配置,则默认按登记日期 cmdStr_SearchSort = " order by hy_djsj desc "; } //---排序---结束 //--根据查询条件得到返回数据集--s DataTable dt = new DataTable(); //单页数据集 DataTable dt_total = new DataTable(); //数据总条数,返回总条数值 DataTable dttable = Hyoa_tableconfig.GetTable(this.txttableid.Value); //得到表配置信息查看当前表是否有流程 hy_ifflowdoc string cmdStr = ""; string ls_from = ""; ls_from = " hyc_" + this.txttableid.Value + " where 1=1 "; if (this.txttableid.Value == "Tablefpbd") { ls_from += " and hyc_sfbf <> '1' " + cmdStr_Search; } else { ls_from += cmdStr_Search; } if (Session["conntype"].ToString() == "SQL") { cmdStr = "select top " + PageSize.Text + " * from " + ls_from; cmdStr += " and DOCID not in (select top " + ((PageNo - 1) * int.Parse(PageSize.Text)).ToString() + " DOCID from " + ls_from + cmdStr_SearchSort + ")" + cmdStr_SearchSort; } if (Session["conntype"].ToString() == "ORACLE") { cmdStr = " select * from ( "; cmdStr += " select my_table.*, rownum as my_rownum from "; cmdStr += " ( "; cmdStr += " select * from hyc_" + this.txttableid.Value + " where 1=1 " + cmdStr_Search + cmdStr_SearchSort; cmdStr += " ) my_table "; cmdStr += " where rownum<= " + ((PageNo) * int.Parse(PageSize.Text)).ToString(); cmdStr += " ) where my_rownum> " + ((PageNo - 1) * int.Parse(PageSize.Text)).ToString(); } dt = Hyoa_global.GetDataTable(cmdStr); cmdStr = "select count(*) from " + ls_from; dt_total = Hyoa_global.GetDataTable(cmdStr); //--根据查询条件得到返回数据集--e //开始输出----整合成HTML为数据行 DataTable tempTable = dt.Clone(); DataColumn col = new DataColumn("displaycol", typeof(String)); //定义新的一列 add tempTable.Columns.Add(col); //追加一列 add string lscolname = ""; string lscolnameid = ""; string lscolwidth = ""; string ls_col = ""; string[] lvcolname; string[] lvcolnameid; string[] lvcolwidth; string lscolwidthper; lscolname = dtlist.Rows[0]["hy_columnshow"].ToString(); //要显示的列名:附件,标题,收文来源 lscolnameid = dtlist.Rows[0]["hy_columnshowid"].ToString(); //要显示的列名id:uploadfile1,Hy_bt,Hy_swly lscolwidth = dtlist.Rows[0]["hy_width"].ToString(); //要显示的列名id:10,20,30 lvcolname = lscolname.Split(','); lvcolnameid = lscolnameid.Split(','); lvcolwidth = lscolwidth.Split(','); if (dt.Rows.Count <= 0) { //如果没有数据则输出表头 for (int n = 0; n < lvcolname.Length; n++) { if (n >= lvcolwidth.Length) { lscolwidthper = ""; }//此判断是为了防止对应宽度没有输入时,会溢出报错。 else { lscolwidthper = lvcolwidth[n]; } this.lbdisplaytitle.Text += "<td width=\"" + lscolwidthper + "%\" class=\"TdcellHead\"><p align=\"center\">" + lvcolname[n] + "</td>"; } } for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); //输出主表所有字段,start for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } //输出主表所有字段,end //////开始得到列的值 DataTable dtgetsqlfield; for (int m = 0; m < lvcolname.Length; m++) { //如果有数据,则输出数据 if (m >= lvcolwidth.Length) { lscolwidthper = ""; }//此判断是为了防止对应宽度没有输入时,会溢出报错。 else { lscolwidthper = lvcolwidth[m]; } dtgetsqlfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.txtmudelid.Value, lvcolnameid[m], this.txttableid.Value); if (i % System.Int32.Parse(PageSize.Text) == 0) this.lbdisplaytitle.Text += "<td width=\"" + lscolwidthper + "%\" class=\"TdcellHead\"><p align=\"center\"><a href=\"#\" title=\"点击可排序\" onclick=\"fun_sort('" + lvcolnameid[m] + "');\">" + lvcolname[m] + "</a></p></td>"; //根据字段英文名,得到数据库中对应的字段 string lsgetsqlfield = "hyc_" + dtgetsqlfield.Rows[0]["hy_fieldid"].ToString(); //根据数据库中对应的字段,得到输出字段的值start (日期型根据格式进行了转换) string lsgetputfiled = ""; if (dtgetsqlfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") { if (dt.Rows[i][lsgetsqlfield].ToString() != "") lsgetputfiled = System.DateTime.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToShortDateString(); } else { //解决Float小数点后面出现N位小数乱码的问题 if (dtgetsqlfield.Rows[0]["hy_fieldtype"].ToString() == "数值") { if (dt.Rows[i][lsgetsqlfield].ToString() != "") { //是否包含小数点,包含的话,取小数点后两位 //if (dt.Rows[i][lsgetsqlfield].ToString().Contains(".") == true) //{ // lsgetputfiled = float.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToString("F2"); //} //else //{ lsgetputfiled = float.Parse(dt.Rows[i][lsgetsqlfield].ToString()).ToString(); // } } else { lsgetputfiled = "0"; } //lsgetputfiled = dt.Rows[i][lsgetsqlfield].ToString(); } else { lsgetputfiled = dt.Rows[i][lsgetsqlfield].ToString(); } } if (lsgetputfiled == "") lsgetputfiled = " "; //根据得到的SQL字段,得到输出字段的值end if (dtgetsqlfield.Rows[0]["hy_ifdbsybt"].ToString() == "是") { ls_col += "<td width=\"" + lscolwidthper + "%\" align=\"center\"><a href=\"#\" onclick=\"var ss='main.aspx?op=modify&mid=" + dt.Rows[i]["hy_mudelid"].ToString() + "&tableid=" + dt.Rows[i]["hy_tableid"].ToString() + "&docid=" + dt.Rows[i]["DOCID"].ToString() + "&url='+window.location;window.location=ss;\">" + lsgetputfiled + "</a></td>"; } else { ls_col += "<td width=\"" + lscolwidthper + "%\" align=\"center\">" + lsgetputfiled + "</td>"; } } //如果是流程表单,则最后追加两列(当前环节和当前处理人) #region 如果是流程表单,则最后追加两列(当前环节和当前处理人) //表头 if (dt.Rows[i]["hy_flowid"].ToString() != "" && dt.Rows[i]["hy_flowid"].ToString() != null && i == 0) { this.lbdisplaytitle.Text += "<td width=\"10%\" class=\"TdcellHead\"><p align=\"center\">当前环节</td>"; //if (dt.Rows[i]["hy_curtachename"].ToString() != "结束") //{ // this.lbdisplaytitle.Text += "<td width=\"10%\" class=\"TdcellHead\"><p align=\"center\">当前处理人</td>"; //} } //数据 if (dt.Rows[i]["hy_flowid"].ToString() != "" && dt.Rows[i]["hy_flowid"].ToString() != null) { ls_col += "<td width=\"10%\" align=\"center\">" + dt.Rows[i]["hy_curtachename"].ToString() + " </td>"; //if (dt.Rows[i]["hy_curtachename"].ToString() != "结束") //{ // ls_col += "<td width=\"10%\" align=\"center\">" + dt.Rows[i]["hy_curclrname"].ToString() + " </td>"; //} } #endregion dr["displaycol"] = ls_col; //将新值赋给相应的列 add ls_col = ""; tempTable.Rows.Add(dr); } int TotalRecord = int.Parse(dt_total.Rows[0][0].ToString()); this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.ShowTotalRecord.Text = TotalRecord.ToString(); //计算及显示总页数 int TotalPage; if (TotalRecord < System.Int32.Parse(PageSize.Text)) { TotalPage = 1; } else { if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0) { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1; } else { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text); } } this.ShowTotalPage.Text = TotalPage.ToString(); this.rptlist.DataSource = tempTable; this.rptlist.DataBind(); dt.Clear(); //列表中的一些特殊处理,都放在这个函数内 DataPlay_Tscl(); }