diff --git a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNotices.aspx.cs b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNotices.aspx.cs index 13e4c10e..7903b060 100644 --- a/SGGL/FineUIPro.Web/HSSE/Check/RectifyNotices.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/Check/RectifyNotices.aspx.cs @@ -7,6 +7,7 @@ using System.Data.SqlClient; using System.IO; using System.Linq; using System.Text; +using AspNet = System.Web.UI.WebControls; namespace FineUIPro.Web.HSSE.Check { @@ -342,6 +343,59 @@ namespace FineUIPro.Web.HSSE.Check Response.Write(GetGridTableHtml(Grid1)); Response.End(); } + public static string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + + foreach (GridColumn column in grid.Columns) + { + if (column.ColumnID != "Actions" && !column.Hidden) + { + sb.AppendFormat("", column.HeaderText); + } + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + if (column.ColumnID != "Actions" && !column.Hidden) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber" && (row.FindControl("labNumber") as AspNet.Label) != null) + { + html = (row.FindControl("labNumber") as AspNet.Label).Text; + } + if (column.ColumnID == "CheckManNames" && (row.FindControl("Label2") as AspNet.Label) != null) + { + html = (row.FindControl("Label2") as AspNet.Label).Text; + } + // 处理CheckBox + if (html.Contains("f-grid-static-checkbox")) + { + if (!html.Contains("f-checked")) + { + html = "×"; + } + else + { + html = "√"; + } + } + sb.AppendFormat("", html); + // sb.AppendFormat("", html); + } + } + + sb.Append(""); + } + sb.Append("
{0}
{0}{0}
"); + return sb.ToString(); + } #endregion protected void rbStates_SelectedIndexChanged(object sender, EventArgs e)