修改穿透页面

This commit is contained in:
高飞 2023-06-08 20:36:05 +08:00
parent aab94ec761
commit a82f96f3d2
4 changed files with 211 additions and 51 deletions

View File

@ -16,7 +16,7 @@
ShowHeader="true" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="质量验收" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="ID" DataIDField="ID" AllowSorting="true"
runat="server" BoxFlex="1" DataKeyNames="ProjectId" DataIDField="ProjectId" AllowSorting="true"
SortField="ProjectName" SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true"
IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
EnableTextSelection="True">
@ -61,18 +61,26 @@
<f:RenderField Width="350px" ColumnID="ProjectName" DataField="ProjectName" FieldType="String" HeaderText="项目名称" TextAlign="Left"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="allcount" DataField="allcount" FieldType="Int"
HeaderText="总项数" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="ccount" DataField="ccount" FieldType="Int"
HeaderText="合格数" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="ucCount" DataField="ucCount" FieldType="Int"
HeaderText="不合格数" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="rateV" DataField="rateV" FieldType="String" HeaderText="一次验收合格率(%" TextAlign="Left"
HeaderTextAlign="Center">
</f:RenderField>
<f:TemplateField ColumnID="Count1" Width="100px" HeaderText="总项数" HeaderTextAlign="Center" TextAlign="Right">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Count1(Eval("ProjectId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField ColumnID="Count2" Width="100px" HeaderText="合格数" HeaderTextAlign="Center" TextAlign="Right">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Count2(Eval("ProjectId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField ColumnID="Count3" Width="100px" HeaderText="不合格数" HeaderTextAlign="Center" TextAlign="Right">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Count3(Eval("ProjectId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:TemplateField ColumnID="Count4" Width="100px" HeaderText="一次验收合格率(%" HeaderTextAlign="Center" TextAlign="Right">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Count4(Eval("ProjectId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />

View File

@ -30,32 +30,17 @@ namespace FineUIPro.Web.DataShow
}
#endregion
#region
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"select NEWID() as ID, v.ProjectId,v.ProjectCode,v.ProjectName,v.allcount,v.ccount,isnull(v.allCount,0)-ISNULL(v.cCount,0) as ucCount,
(case when isnull(v.allCount,0) > 0 then cast(ISNULL(v.cCount,0) *1.0 /isnull(v.allCount,0)*100 as decimal(18, 2))
else 0 end) as rateV
from (select B.ProjectId,p.ProjectCode,p.ProjectName,COUNT(*) as allCount,
isnull((select COUNT(*)
from ProcessControl_InspectionManagementDetail AS Detail
LEFT JOIN WBS_BreakdownProject AS Breakp ON Detail.ControlPointType=Breakp.BreakdownProjectId
LEFT JOIN ProcessControl_InspectionManagement AS Inspection ON Detail.InspectionId=Inspection.InspectionId
where Breakp.CheckAcceptType =@type AND Inspection.IsOnceQualified = 1
group by Breakp.ProjectId),0) as cCount
FROM ProcessControl_InspectionManagementDetail AS A
LEFT JOIN WBS_BreakdownProject AS B ON A.ControlPointType=B.BreakdownProjectId
left join Base_Project as p on B.ProjectId=p.ProjectId
where p.projectId is not null AND B.CheckAcceptType =@type ";
string strSql = @"select ProjectId,ProjectCode, ProjectName from Base_Project where ProjectState =1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@type", this.rbType.SelectedValue));
string cpara = string.Empty;
if (this.drpProject.SelectedValue != Const._Null)
{
strSql += " AND B.projectId = @projectId"; ///状态为已完成
strSql += " AND projectId = @projectId"; ///状态为已完成
listStr.Add(new SqlParameter("@projectId", this.drpProject.SelectedValue));
}
@ -63,13 +48,17 @@ namespace FineUIPro.Web.DataShow
//{
// strSql += " AND h.RegisterDate >=@StartTime";
// listStr.Add(new SqlParameter("@StartTime", this.txtStartTime.Text));
// cpara += " AND c.RegisterDate >=" + this.txtStartTime.Text;
//}
//if (!string.IsNullOrEmpty(this.txtEndTime.Text))
//{
// strSql += " AND h.RegisterDate <=@EndTime";
// listStr.Add(new SqlParameter("@EndTime", this.txtEndTime.Text));
// cpara += " AND c.RegisterDate <=" + this.txtEndTime.Text;
//}
strSql += " group by B.ProjectId,p.ProjectCode,p.ProjectName) as v";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
@ -77,7 +66,6 @@ namespace FineUIPro.Web.DataShow
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
@ -133,5 +121,98 @@ namespace FineUIPro.Web.DataShow
BindGrid();
}
#endregion
/// <summary>
/// 数量
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected int Count1(object projectId)
{
int cout1 = 0;
if (projectId != null)
{
var getT = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue
select x).Distinct().ToList();
cout1 = getT.Count();
}
return cout1;
}
/// <summary>
/// 数量
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected int Count2(object projectId)
{
int cout1 = 0;
if (projectId != null)
{
var getT = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue && y.IsOnceQualified == true
select x).Distinct().ToList();
cout1 = getT.Count();
}
return cout1;
}
/// <summary>
/// 数量
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected int Count3(object projectId)
{
int cout1 = 0;
if (projectId != null)
{
var getT1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue
select x).Distinct().ToList();
var getT2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue && y.IsOnceQualified == true
select x).Distinct().ToList();
cout1 = getT1.Count() - getT2.Count();
}
return cout1;
}
/// <summary>
/// 数量
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected string Count4(object projectId)
{
string rate = string.Empty;
if (projectId != null)
{
var getT1 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue
select x).Distinct().ToList();
var getT2 = (from x in Funs.DB.ProcessControl_InspectionManagementDetail
join y in Funs.DB.ProcessControl_InspectionManagement on x.InspectionId equals y.InspectionId
join z in Funs.DB.WBS_BreakdownProject on x.ControlPointType equals z.BreakdownProjectId
where z.ProjectId == projectId.ToString() && z.CheckAcceptType == this.rbType.SelectedValue && y.IsOnceQualified == true
select x).Distinct().ToList();
if (getT1.Count() > 0)
{
rate = Math.Round(getT2.Count() * 1.0 / getT1.Count() * 100, 2).ToString();
}
}
return rate;
}
}
}

View File

@ -7,13 +7,11 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.DataShow
{
public partial class QualityAcceptance
{
namespace FineUIPro.Web.DataShow {
public partial class QualityAcceptance {
/// <summary>
/// form1 控件。
/// </summary>
@ -22,7 +20,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@ -31,7 +29,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
@ -40,7 +38,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
@ -49,7 +47,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
@ -58,7 +56,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// drpProject 控件。
/// </summary>
@ -67,7 +65,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpProject;
/// <summary>
/// rbType 控件。
/// </summary>
@ -76,7 +74,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbType;
/// <summary>
/// btnClose 控件。
/// </summary>
@ -85,7 +83,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// labNumber 控件。
/// </summary>
@ -94,7 +92,43 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label labNumber;
/// <summary>
/// Label2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label2;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
/// <summary>
/// Label3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label3;
/// <summary>
/// Label4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label4;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -103,7 +137,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@ -112,7 +146,7 @@ namespace FineUIPro.Web.DataShow
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>

View File

@ -4159,3 +4159,40 @@ IP地址:::1
出错时间:06/07/2023 18:39:10
出错时间:06/07/2023 18:39:10
错误信息开始=====>
错误类型:SqlException
错误信息:列名 'isDelete' 无效。
列名 'isDelete' 无效。
错误堆栈:
在 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.DataShow.QualityAcceptance.BindGrid() 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\DataShow\QualityAcceptance.aspx.cs:行号 63
在 FineUIPro.Web.DataShow.QualityAcceptance.Page_Load(Object sender, EventArgs e) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\DataShow\QualityAcceptance.aspx.cs:行号 27
在 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)
出错时间:06/08/2023 20:35:05
出错文件:http://localhost:9733/DataShow/QualityAcceptance.aspx
IP地址:::1
出错时间:06/08/2023 20:35:05