LaaProduction http/sql packages in use. Solution refactored.

This commit is contained in:
Stoyan Zlatev
2023-06-14 15:26:59 +02:00
parent 65261c8ade
commit f04bc95206
52 changed files with 855 additions and 550 deletions
@@ -1,7 +1,6 @@
namespace LaaProductionWeb.Services
{
using FluentSQLClient.Interfaces;
using LaaProductionSQL.Interfaces;
using LaaProductionWeb.Services.Interfaces;
using LaaProductionWeb.Services.Models.Reports;
@@ -12,10 +11,10 @@
public partial class ReportService : IReportService
{
private readonly IFluentSQLConnection fluentSQL;
private readonly ISQLConnection sqlConnection;
public ReportService(IFluentSQLConnection fluentSQL)
=> this.fluentSQL = fluentSQL;
public ReportService(ISQLConnection sqlConnection)
=> this.sqlConnection = sqlConnection;
public CordonelPressureSensorModel LoadCordonelPressureSensorReport(CordonelPressureSensorModel model = null)
{
@@ -27,7 +26,7 @@
var where = model.Filter.Where();
var orderBy = model.Filter.OrderBy();
model.Items = this.fluentSQL
model.Items = this.sqlConnection
.CreateCommand($@"
SELECT [APS].[AuftragNr] AS [AuftragNr]
, [APS].[PositionNr] AS [PosNr]
@@ -84,7 +83,7 @@
var where = model.Filter.Where();
var orderBy = model.Filter.OrderBy();
model.Items = this.fluentSQL
model.Items = this.sqlConnection
.CreateCommand($@"
SELECT DISTINCT
[PT].[CordonelPressureTest_FertigungsAuftragsNr] AS [FertigungNr] -- 0
@@ -178,7 +177,7 @@
}
};
var headers = Array.Empty<string>();
var items = this.fluentSQL
var items = this.sqlConnection
.CreateCommand($@"
SELECT DISTINCT
[PT].[CordonelPressureTest_FertigungsAuftragsNr] AS [FertigungNr] -- 0 Filter
@@ -243,7 +242,7 @@
}
public IEnumerable<HeliumPressurePoint> LoadHeliumPressureResults(int testId)
=> this.fluentSQL
=> this.sqlConnection
.CreateCommand($@"
SELECT [CordonelPressureTestTestPoints_Id]
, [CordonelPressureTest_TestPointNr]
@@ -268,7 +267,7 @@
var where = model.Filter.Where();
var orderBy = model.Filter.OrderBy();
model.Items = this.fluentSQL
model.Items = this.sqlConnection
.CreateCommand($@"
SELECT [DP].[FertigungsauftragNr] AS [FertigungNr]
, [PCB2SN].[MapPcbIdToSerialNumber_SerialNumber] AS [SerienNr]
@@ -341,7 +340,7 @@
}
};
var headers = Array.Empty<string>();
var items = this.fluentSQL
var items = this.sqlConnection
.CreateCommand($@"
SELECT [DP].[FertigungsauftragNr] AS [FertigungNr]
, [PCB2SN].[MapPcbIdToSerialNumber_SerialNumber] AS [SerienNr]