260320_01_EHN: 분석 도중 쓸데없는 코드들 제거
This commit is contained in:
@@ -179,7 +179,7 @@ namespace Keps.WinForms.Services
|
||||
string sortKey,
|
||||
string sortDisplayName,
|
||||
bool descending,
|
||||
List<ClusterSummaryRow> allocationRows,
|
||||
List<ClusterSummaryRow> workingRows,
|
||||
int signedOffset,
|
||||
string offsetDescription,
|
||||
bool isAutoAllocation)
|
||||
@@ -190,23 +190,23 @@ namespace Keps.WinForms.Services
|
||||
List<ExtractionRow> populationRows = new List<ExtractionRow>();
|
||||
List<PollingPlaceRecord> extractedSourceRows = new List<PollingPlaceRecord>();
|
||||
|
||||
foreach (ClusterSummaryRow allocation in allocationRows.OrderBy(x => x.ClusterNo))
|
||||
foreach (ClusterSummaryRow workingRow in workingRows.OrderBy(x => x.ClusterNo))
|
||||
{
|
||||
List<PollingPlaceRecord> clusterRows = allRows.Where(x => x.ClusterValue == allocation.ClusterNo).ToList();
|
||||
List<PollingPlaceRecord> clusterRows = allRows.Where(x => x.ClusterValue == workingRow.ClusterNo).ToList();
|
||||
clusterRows = descending
|
||||
? clusterRows.OrderByDescending(x => x.GetSortValue(sortKey)).ThenBy(x => x.EupMyeonDong).ThenBy(x => GetPollingPlaceSortValue(x.PollingPlaceNo)).ThenBy(x => x.PollingPlaceNo).ToList()
|
||||
: clusterRows.OrderBy(x => x.GetSortValue(sortKey)).ThenBy(x => x.EupMyeonDong).ThenBy(x => GetPollingPlaceSortValue(x.PollingPlaceNo)).ThenBy(x => x.PollingPlaceNo).ToList();
|
||||
|
||||
int interval;
|
||||
int startPosition;
|
||||
List<int> extractIds = SelectLegacyExtractIds(clusterRows.Count, allocation.SampleCount, signedOffset, out interval, out startPosition);
|
||||
List<int> extractIds = SelectLegacyExtractIds(clusterRows.Count, workingRow.SampleCount, signedOffset, out interval, out startPosition);
|
||||
HashSet<int> selectedPositions = new HashSet<int>(extractIds);
|
||||
|
||||
for (int i = 0; i < clusterRows.Count; i++)
|
||||
{
|
||||
int originalOrder = i + 1;
|
||||
PollingPlaceRecord row = clusterRows[i];
|
||||
populationRows.Add(CreateExtractionRow(row, allocation.ClusterNo, originalOrder, originalOrder, interval, startPosition, offsetDescription, row.GetSortValue(sortKey), selectedPositions.Contains(originalOrder), selectedPositions.Contains(originalOrder)));
|
||||
populationRows.Add(CreateExtractionRow(row, workingRow.ClusterNo, originalOrder, originalOrder, interval, startPosition, offsetDescription, row.GetSortValue(sortKey), selectedPositions.Contains(originalOrder), selectedPositions.Contains(originalOrder)));
|
||||
}
|
||||
|
||||
for (int i = 0; i < extractIds.Count; i++)
|
||||
@@ -219,7 +219,7 @@ namespace Keps.WinForms.Services
|
||||
|
||||
PollingPlaceRecord row = clusterRows[extractId - 1];
|
||||
extractedSourceRows.Add(row);
|
||||
extractedRows.Add(CreateExtractionRow(row, allocation.ClusterNo, i + 1, extractId, interval, startPosition, offsetDescription, row.GetSortValue(sortKey), true, true));
|
||||
extractedRows.Add(CreateExtractionRow(row, workingRow.ClusterNo, i + 1, extractId, interval, startPosition, offsetDescription, row.GetSortValue(sortKey), true, true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,9 +235,9 @@ namespace Keps.WinForms.Services
|
||||
ExtractedRows = extractedRows.OrderBy(x => x.ClusterNo).ThenBy(x => x.ClusterOrder).ToList(),
|
||||
PopulationRows = populationRows.OrderBy(x => x.ClusterNo).ThenBy(x => x.OriginalOrder).ToList(),
|
||||
AdjustmentRows = BuildAdjustmentRows(extractedRows),
|
||||
VerificationRows = BuildVerificationRows(allRows, extractedSourceRows, allocationRows, candidateMeta),
|
||||
VerificationRows = BuildVerificationRows(allRows, extractedSourceRows, workingRows, candidateMeta),
|
||||
ClusterMax = clusterMax,
|
||||
TotalSampleCount = allocationRows.Sum(x => x.SampleCount),
|
||||
TotalSampleCount = workingRows.Sum(x => x.SampleCount),
|
||||
IsAutoAllocation = isAutoAllocation,
|
||||
SortDisplayName = sortDisplayName,
|
||||
SortDescending = descending,
|
||||
@@ -308,15 +308,7 @@ namespace Keps.WinForms.Services
|
||||
using (SqlConnection connection = _connectionFactory.Open())
|
||||
using (SqlCommand command = new SqlCommand(LegacySqlCatalog.RealCandidateNames, connection))
|
||||
{
|
||||
int electionNo;
|
||||
if (int.TryParse(electionName, out electionNo))
|
||||
{
|
||||
command.Parameters.AddWithValue("@electionName", electionNo);
|
||||
}
|
||||
else
|
||||
{
|
||||
command.Parameters.AddWithValue("@electionName", electionName);
|
||||
}
|
||||
command.Parameters.AddWithValue("@electionName", electionName);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user