This commit is contained in:
2024-10-21 15:53:48 +08:00
8 changed files with 31 additions and 61 deletions
@@ -118,7 +118,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
{
string strSql = "select v.*,newid() as New_ID from (SELECT distinct * FROM HJGL_View_InspectionBatch WHERE 1=1";
List<SqlParameter> listStr = new List<SqlParameter>();
if (this.drpProjectId.SelectedValue != null && this.drpProjectId.SelectedValue!="null")
if (this.drpProjectId.SelectedValue != null && this.drpProjectId.SelectedValue != "null")
{
strSql += " AND ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.drpProjectId.SelectedValue));
@@ -155,7 +155,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
{
this.GetShowColumn(c.Columns);
}
}
#endregion
@@ -192,7 +192,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
// BindGrid();
//}
//#endregion
#region
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
@@ -227,7 +227,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
@@ -244,23 +244,19 @@ namespace FineUIPro.Web.HJGL.WeldingReport
// n++;
//}
Model.Sys_UserShowColumns c = BLL.Sys_UserShowColumnsService.GetColumnsByUserId(this.CurrUser.UserId, "3");
List<string> columns = new List<string>();
if (c != null)
{
string[] items = c.Columns.Split(',');
columns = new List<string>(items);
}
else
{
for (int i=1; i <= Grid1.Columns.Count; i++)
{
columns.Add(i.ToString());
}
}
if (!columns.Contains("0"))
Model.Sys_UserShowColumns c = BLL.Sys_UserShowColumnsService.GetColumnsByUserId(this.CurrUser.UserId, "3");
List<string> columns = new List<string>();
if (c != null)
{
columns.Add("0");
string[] items = ("0," + c.Columns).Split(',');
columns = new List<string>(items);
}
else
{
for (int i = 1; i <= Grid1.Columns.Count; i++)
{
columns.Add(i.ToString());
}
}
Response.ClearContent();
string filename = Funs.GetNewFileName();
@@ -295,9 +291,9 @@ namespace FineUIPro.Web.HJGL.WeldingReport
{
if (column.ColumnIndex == 0)
{
sb.AppendFormat("<td align='center' style='width:45px;'>{0}</td>", column.HeaderText);
sb.AppendFormat("<td align='center' style='width:118px;'>{0}</td>", column.HeaderText);
}
if (column.ColumnIndex == 1)
else if (column.ColumnIndex == 1)
{
sb.AppendFormat("<td align='center' style='width:118px;'>{0}</td>", column.HeaderText);
}
@@ -389,6 +385,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
}
}
sb.Append("</tr>");
int a = 1;
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
@@ -398,6 +395,10 @@ namespace FineUIPro.Web.HJGL.WeldingReport
if (columnIndexs.Contains(columnIndex))
{
string html = value.ToString();
if (columnIndex == 0)
{
html = a.ToString();
}
if (html.StartsWith(Grid.TEMPLATE_PLACEHOLDER_PREFIX))
{
// 模板列
@@ -430,6 +431,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
}
columnIndex++;
}
a++;
sb.Append("</tr>");
}
sb.Append("</table>");