private void AddCountsOfCulvertsWorkedOn(ExcelWorksheet worksheet, List <SimulationDataModel> simulationDataModels, List <int> simulationYears, CurrentCell currentCell, ProjectRowNumberModel projectRowNumberModel, List <string> treatments) { int startRow, startColumn, row, column; bridgeWorkSummaryCommon.SetRowColumns(currentCell, out startRow, out startColumn, out row, out column); foreach (var item in treatments) { if (item.ToLower().Contains("culvert")) { worksheet.Cells[row++, column].Value = item; } } worksheet.Cells[row++, column].Value = Properties.Resources.Total; column++; var fromColumn = column + 1; foreach (var year in simulationYears) { row = startRow; column = ++column; double culvertTotalCount = 0; foreach (var item in treatments) { if (item.ToLower().Contains("culvert")) { var culvertCount = bridgeWorkSummaryComputationHelper.CalculateCountByProject(simulationDataModels, year, item); worksheet.Cells[row, column].Value = culvertCount; projectRowNumberModel.TreatmentsCount.Add(item + "_" + year, row); row++; culvertTotalCount += culvertCount; } } worksheet.Cells[row, column].Value = culvertTotalCount; } excelHelper.ApplyBorder(worksheet.Cells[startRow, startColumn, row, column]); excelHelper.ApplyColor(worksheet.Cells[startRow, fromColumn, row, column], Color.LightSteelBlue); bridgeWorkSummaryCommon.UpdateCurrentCell(currentCell, ++row, column); }
private void AddCountsOfCulvertsWorkedOn(ExcelWorksheet worksheet, List <SimulationDataModel> simulationDataModels, List <int> simulationYears, CurrentCell currentCell, ProjectRowNumberModel projectRowNumberModel) { int startRow, startColumn, row, column; bridgeWorkSummaryCommon.SetRowColumns(currentCell, out startRow, out startColumn, out row, out column); worksheet.Cells[row++, column].Value = Properties.Resources.NoTreatment; worksheet.Cells[row++, column].Value = Properties.Resources.Preservation; worksheet.Cells[row++, column].Value = Properties.Resources.PreservationPoorFix; worksheet.Cells[row++, column].Value = Properties.Resources.Rehabilitation; worksheet.Cells[row++, column].Value = Properties.Resources.Replacement; worksheet.Cells[row++, column].Value = Properties.Resources.Total; column++; var fromColumn = column + 1; foreach (var year in simulationYears) { row = startRow; column = ++column; var noTreatmentCount = bridgeWorkSummaryComputationHelper.CalculateNoTreatmentCountForCulverts(simulationDataModels, year); worksheet.Cells[row, column].Value = noTreatmentCount; projectRowNumberModel.CulvertsNoTreatmentRow = row; int preservationPoorFixrow = row + 2; var preservationPoorFixCount = bridgeWorkSummaryComputationHelper.CalculatePreservationPoorFixCount(simulationDataModels, year); worksheet.Cells[preservationPoorFixrow, column].Value = preservationPoorFixCount; var preservationCount = bridgeWorkSummaryComputationHelper.CalculateCountByProject(simulationDataModels, year, Properties.Resources.CulvertPreservation) - preservationPoorFixCount; worksheet.Cells[++row, column].Value = preservationCount; projectRowNumberModel.CulvertsPreservationRow = row; row = preservationPoorFixrow + 1; var rehabilitationCount = bridgeWorkSummaryComputationHelper.CalculateCountByProject(simulationDataModels, year, Properties.Resources.CulvertRehabilitation); worksheet.Cells[row, column].Value = rehabilitationCount; projectRowNumberModel.CulvertsRehabilitationRow = row; var replacementCount = bridgeWorkSummaryComputationHelper.CalculateCountByProject(simulationDataModels, year, Properties.Resources.CulvertReplacement); worksheet.Cells[++row, column].Value = replacementCount; projectRowNumberModel.CulvertsReplacementRow = row; worksheet.Cells[++row, column].Value = preservationCount + preservationPoorFixCount + rehabilitationCount + replacementCount; } excelHelper.ApplyBorder(worksheet.Cells[startRow, startColumn, row, column]); excelHelper.ApplyColor(worksheet.Cells[startRow, fromColumn, row, column], Color.LightSteelBlue); bridgeWorkSummaryCommon.UpdateCurrentCell(currentCell, ++row, column); }