rowData isn't HeaderCommon
This commit is contained in:
@ -38,9 +38,6 @@ public class PinRepository : IPinRepository
|
||||
|
||||
private (HeaderCommon?, HeaderCommon?) GetBoth(string rds, long bioRadId, long cdeId)
|
||||
{
|
||||
HeaderCommon? cdeHeader, bioRadHeader;
|
||||
cdeHeader = null;
|
||||
bioRadHeader = null;
|
||||
Dictionary<long, HeaderCommon>? toolIdToHeader;
|
||||
if (!_RdsToHeaderCommonCollection.TryGetValue(rds, out toolIdToHeader))
|
||||
{
|
||||
@ -48,10 +45,8 @@ public class PinRepository : IPinRepository
|
||||
if (!_RdsToHeaderCommonCollection.TryGetValue(rds, out toolIdToHeader))
|
||||
throw new Exception();
|
||||
}
|
||||
if (cdeHeader is null && toolIdToHeader.ContainsKey(cdeId))
|
||||
cdeHeader = toolIdToHeader[cdeId];
|
||||
if (bioRadHeader is null && toolIdToHeader.ContainsKey(bioRadId))
|
||||
bioRadHeader = toolIdToHeader[bioRadId];
|
||||
_ = toolIdToHeader.TryGetValue(cdeId, out HeaderCommon? cdeHeader);
|
||||
_ = toolIdToHeader.TryGetValue(bioRadId, out HeaderCommon? bioRadHeader);
|
||||
return new(bioRadHeader, cdeHeader);
|
||||
}
|
||||
|
||||
@ -79,31 +74,6 @@ public class PinRepository : IPinRepository
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Pinned? GetCDE(IMetrologyRepository metrologyRepository, int points, HeaderCommon bioRadHeader)
|
||||
{
|
||||
Pinned? result;
|
||||
List<string> values;
|
||||
const int thickness = 5;
|
||||
System.Data.DataTable dataTable = metrologyRepository.GetData((int)bioRadHeader.ToolTypeID, bioRadHeader.ID);
|
||||
if (dataTable.Rows.Count <= points || dataTable.Columns.Count <= thickness)
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
values = new();
|
||||
for (int i = 0; i < dataTable.Rows.Count - 1; i++)
|
||||
{
|
||||
if (dataTable.Rows[i]?.ItemArray[thickness] is null)
|
||||
break;
|
||||
values.Add(string.Concat(dataTable.Rows[i].ItemArray[thickness]));
|
||||
}
|
||||
if (values.Count <= points)
|
||||
result = null;
|
||||
else
|
||||
result = new(bioRadHeader, values);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Result<Pinned[]> IPinRepository.GetPinnedTable(IMetrologyRepository metrologyRepository, int id, string? biorad_id, string? cde_id, string? rds)
|
||||
{
|
||||
Result<Pinned[]>? r;
|
||||
|
Reference in New Issue
Block a user