20240816 修改项目列表导出

This commit is contained in:
毕文静 2024-08-16 14:42:18 +08:00
parent efb0fb7974
commit 012f59da32
5 changed files with 28 additions and 91 deletions

View File

@ -1,77 +0,0 @@
错误信息开始=====>
错误类型:NullReferenceException
错误信息:未将对象引用设置到对象的实例。
错误堆栈:
在 FineUIPro.Web.ProjectData.UnitWork.getWBSSet() 位置 E:\五环\SGGL_CWCEC\SGGL\FineUIPro.Web\ProjectData\UnitWork.aspx.cs:行号 461
在 FineUIPro.Web.ProjectData.UnitWork.Window2_Close(Object sender, WindowCloseEventArgs e) 位置 E:\五环\SGGL_CWCEC\SGGL\FineUIPro.Web\ProjectData\UnitWork.aspx.cs:行号 221
在 FineUIPro.Window.OnClose(WindowCloseEventArgs e)
在 (Window , WindowCloseEventArgs )
在 FineUIPro.Window.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:08/13/2024 14:44:02
出错文件:http://localhost:8579/ProjectData/UnitWork.aspx
IP地址:::1
操作人员:JT
出错时间:08/13/2024 14:44:02
错误信息开始=====>
错误类型:NullReferenceException
错误信息:未将对象引用设置到对象的实例。
错误堆栈:
在 FineUIPro.Web.ProjectData.UnitWork.getWBSSet() 位置 E:\五环\SGGL_CWCEC\SGGL\FineUIPro.Web\ProjectData\UnitWork.aspx.cs:行号 461
在 FineUIPro.Web.ProjectData.UnitWork.Window2_Close(Object sender, WindowCloseEventArgs e) 位置 E:\五环\SGGL_CWCEC\SGGL\FineUIPro.Web\ProjectData\UnitWork.aspx.cs:行号 221
在 FineUIPro.Window.OnClose(WindowCloseEventArgs e)
在 (Window , WindowCloseEventArgs )
在 FineUIPro.Window.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:08/13/2024 15:04:20
出错文件:http://localhost:8579/ProjectData/UnitWork.aspx
IP地址:::1
操作人员:JT
出错时间:08/13/2024 15:04:20
错误信息开始=====>
错误类型:SqlException
错误信息:参数化查询 '(@projectId nvarchar(4000))SELECT p.QualityManagementSysId,
' 需要参数 '@projectId',但未提供该参数。
错误堆栈:
在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
在 System.Data.SqlClient.SqlDataReader.get_MetaData()
在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
在 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
在 System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
在 BLL.SQLHelper.GetDataTableRunText(String strSql, SqlParameter[] parameters) 位置 E:\五环\SGGL_CWCEC\SGGL\BLL\SQLHelper.cs:行号 311
在 FineUIPro.Web.CQMS.QualityPlanning.QualityManagementSys.BindGrid() 位置 E:\五环\SGGL_CWCEC\SGGL\FineUIPro.Web\CQMS\QualityPlanning\QualityManagementSys.aspx.cs:行号 59
在 FineUIPro.Web.CQMS.QualityPlanning.QualityManagementSys.Page_Load(Object sender, EventArgs e) 位置 E:\五环\SGGL_CWCEC\SGGL\FineUIPro.Web\CQMS\QualityPlanning\QualityManagementSys.aspx.cs:行号 24
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:08/14/2024 09:45:39
出错文件:http://localhost:8579/CQMS/QualityPlanning/QualityManagementSys.aspx
IP地址:::1
操作人员:JT
出错时间:08/14/2024 09:45:39

View File

@ -48,7 +48,7 @@
<f:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
<asp:Label ID="labNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="100px" ColumnID="ProjectCode" DataField="ProjectCode" SortField="ProjectCode" FieldType="String"
@ -77,13 +77,13 @@
</f:TemplateField>
<f:TemplateField ColumnID="tfSubcontractor" Width="400px" HeaderText="施工分包商" HeaderTextAlign="Center" TextAlign="Left">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# ConvertSubcontractor(Eval("ProjectId")) %>'
<asp:Label ID="lblSubcontractor" runat="server" Text='<%# ConvertSubcontractor(Eval("ProjectId")) %>'
ToolTip='<%# ConvertSubcontractor(Eval("ProjectId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField ColumnID="tfOwn" Width="150px" HeaderText="建设单位" HeaderTextAlign="Center" TextAlign="Left">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# ConvertOwn(Eval("ProjectId")) %>'
<asp:Label ID="lblOwn" runat="server" Text='<%# ConvertOwn(Eval("ProjectId")) %>'
ToolTip='<%# ConvertOwn(Eval("ProjectId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>

View File

@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
namespace FineUIPro.Web.ProjectData
@ -102,6 +103,7 @@ namespace FineUIPro.Web.ProjectData
}
#endregion
#region
/// <summary>
/// 双击事件
/// </summary>
@ -116,7 +118,9 @@ namespace FineUIPro.Web.ProjectData
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectSetView.aspx?ProjectId={0}", Grid1.SelectedRowID, "查看 - ")));
}
#endregion
#region
/// <summary>
/// 查看
/// </summary>
@ -126,6 +130,7 @@ namespace FineUIPro.Web.ProjectData
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectSetView.aspx?ProjectId={0}", Grid1.SelectedRowID, "查看 - ")));
}
#endregion
#region
/// <summary>
@ -204,12 +209,9 @@ namespace FineUIPro.Web.ProjectData
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("项目信息" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.AddHeader("content-disposition", "attachment; filename=项目信息.xls");
Response.ContentType = "application/vnd.ms-excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = this.Grid1.RecordCount;
this.BindGrid();
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}

View File

@ -85,13 +85,13 @@ namespace FineUIPro.Web.ProjectData {
protected global::FineUIPro.Button btnOut;
/// <summary>
/// lblNumber 控件。
/// labNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblNumber;
protected global::System.Web.UI.WebControls.Label labNumber;
/// <summary>
/// lblCM 控件。
@ -103,22 +103,22 @@ namespace FineUIPro.Web.ProjectData {
protected global::System.Web.UI.WebControls.Label lblCM;
/// <summary>
/// Label1 控件。
/// lblSubcontractor 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
protected global::System.Web.UI.WebControls.Label lblSubcontractor;
/// <summary>
/// Label2 控件。
/// lblOwn 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label2;
protected global::System.Web.UI.WebControls.Label lblOwn;
/// <summary>
/// ToolbarSeparator1 控件。

View File

@ -1012,6 +1012,18 @@ namespace FineUIPro.Web
{
html = (row.FindControl("lbCheckManNames") as AspNet.Label).Text;
}
if (column.ColumnID== "tfCM")
{
html = (row.FindControl("lblCM") as AspNet.Label).Text;
}
if (column.ColumnID == "tfSubcontractor")
{
html = (row.FindControl("lblSubcontractor") as AspNet.Label).Text;
}
if (column.ColumnID == "tfOwn")
{
html = (row.FindControl("lblOwn") as AspNet.Label).Text;
}
// 处理CheckBox
if (html.Contains("f-grid-static-checkbox"))
{