Testing I
This commit is contained in:
@ -19,7 +19,11 @@ public class PinRepository : IPinRepository
|
||||
Result<HeaderCommond[]> IPinRepository.GetPinnedTable(IMetrologyRepository metrologyRepository, int id, string? bioRad, string? cde)
|
||||
{
|
||||
Result<HeaderCommond[]>? r;
|
||||
if (!id.Equals(IPinRepository.ToolId.BioRad) && !id.Equals(IPinRepository.ToolId.CDE))
|
||||
HeaderCommon? cdeHeader = cde is null ? null : JsonSerializer.Deserialize<HeaderCommon>(cde);
|
||||
long cdeId = cdeHeader is null ? (long)IPinRepository.ToolId.CDE : cdeHeader.ToolTypeID;
|
||||
HeaderCommon? bioRadHeader = bioRad is null ? null : JsonSerializer.Deserialize<HeaderCommon>(bioRad);
|
||||
long bioRadId = bioRadHeader is null ? (long)IPinRepository.ToolId.BioRad : bioRadHeader.ToolTypeID;
|
||||
if (cdeHeader is not null && cdeHeader.ToolTypeID != id && bioRadHeader?.ToolTypeID != id)
|
||||
r = new() { Results = Array.Empty<HeaderCommond>(), TotalRows = 0 };
|
||||
else
|
||||
{
|
||||
@ -32,20 +36,52 @@ public class PinRepository : IPinRepository
|
||||
}
|
||||
else
|
||||
{
|
||||
const int rows = 11;
|
||||
List<string> values;
|
||||
const int points = 9;
|
||||
HeaderCommond headerCommond;
|
||||
List<HeaderCommond> results = new();
|
||||
HeaderCommon? cdeHeader = cde is null ? null : JsonSerializer.Deserialize<HeaderCommon>(cde);
|
||||
HeaderCommon? bioRadHeader = bioRad is null ? null : JsonSerializer.Deserialize<HeaderCommon>(bioRad);
|
||||
if (bioRadHeader is not null)
|
||||
{
|
||||
System.Data.DataTable dataTable = metrologyRepository.GetData((int)IPinRepository.ToolId.BioRad, bioRadHeader.ID);
|
||||
if (dataTable.Rows.Count == 11)
|
||||
;
|
||||
const int columns = 10;
|
||||
System.Data.DataTable dataTable = metrologyRepository.GetData((int)bioRadHeader.ToolTypeID, bioRadHeader.ID);
|
||||
if (dataTable.Rows.Count == rows && dataTable.Columns.Count == columns)
|
||||
{
|
||||
values = new();
|
||||
const int rs = 5;
|
||||
for (int i = 0; i < dataTable.Rows.Count - 1; i++)
|
||||
{
|
||||
if (dataTable.Rows[i]?.ItemArray[rs] is null)
|
||||
break;
|
||||
values.Add(string.Concat(dataTable.Rows[i].ItemArray[rs]));
|
||||
}
|
||||
if (values.Count > points)
|
||||
{
|
||||
headerCommond = new(bioRadHeader, values);
|
||||
results.Add(headerCommond);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cdeHeader is not null)
|
||||
{
|
||||
System.Data.DataTable dataTable = metrologyRepository.GetData((int)IPinRepository.ToolId.CDE, cdeHeader.ID);
|
||||
if (dataTable.Rows.Count == 11)
|
||||
;
|
||||
const int columns = 7;
|
||||
System.Data.DataTable dataTable = metrologyRepository.GetData((int)cdeHeader.ToolTypeID, cdeHeader.ID);
|
||||
if (dataTable.Rows.Count == rows && dataTable.Columns.Count == columns)
|
||||
{
|
||||
values = new();
|
||||
const int rs = 5;
|
||||
for (int i = 0; i < dataTable.Rows.Count - 1; i++)
|
||||
{
|
||||
if (dataTable.Rows[i]?.ItemArray[rs] is null)
|
||||
break;
|
||||
values.Add(string.Concat(dataTable.Rows[i].ItemArray[rs]));
|
||||
}
|
||||
if (values.Count > points)
|
||||
{
|
||||
headerCommond = new(cdeHeader, values);
|
||||
results.Add(headerCommond);
|
||||
}
|
||||
}
|
||||
}
|
||||
r = new()
|
||||
{
|
||||
|
Reference in New Issue
Block a user