Advertisement
Guest User

123

a guest
Apr 2nd, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.61 KB | None | 0 0
  1. private void FillQuantitativeIndicators(ExcelWorksheet commonSheet, IterationReportBuilderCounter counter,
  2.             IterationReportCommonSheetParams commonSheetParams)
  3.         {
  4.             var amountColumn = CalculateAmountColumn(counter.Iteration);
  5.             commonSheet.Cells[25 + commonSheetParams.RowOffset, counter.Iteration + 2, 27 + commonSheetParams.RowOffset,
  6.                 counter.Iteration + 2].Style.Numberformat.Format = "0.0";
  7.  
  8.             var iterationReportData = commonSheetParams.ProductType == ProductType.OneCEtp ? _iterationReportOneCData : _iterationReportAstralEtData;
  9.             var oneCAmount = iterationReportData.OneCAmount;
  10.             var cSharpAmount = iterationReportData.CSharpAmount;
  11.             var directSchemeData = iterationReportData.DirectSchemeData;
  12.             var remoteProcessing = iterationReportData.RemoteProcessing;
  13.             var planCp = iterationReportData.CpPlans;
  14.             var certificateAmount = iterationReportData.CertificateAmount;
  15.             var lastYearTariffsCount = iterationReportData.LastYearTariffCount;
  16.             var lastIterationTariffsCount = iterationReportData.LastIterationTariffCount;
  17.  
  18.             commonSheet.Cells[11 + commonSheetParams.RowOffset, 1, 11 + commonSheetParams.RowOffset, counter.Iteration + 2].Merge = true;
  19.             commonSheet.Cells[12 + commonSheetParams.RowOffset, counter.Iteration + 2].FormulaR1C1 =
  20.                 $"SUM(R{commonSheetParams.RowOffset + 13}C{counter.Iteration + 2}:R{commonSheetParams.RowOffset + 16}C{counter.Iteration + 2})";
  21.             commonSheet.Cells[13 + commonSheetParams.RowOffset, counter.Iteration + 2].Value = remoteProcessing;
  22.             commonSheet.Cells[14 + commonSheetParams.RowOffset, counter.Iteration + 2].Value = oneCAmount;
  23.             commonSheet.Cells[15 + commonSheetParams.RowOffset, counter.Iteration + 2].Value = cSharpAmount;
  24.             commonSheet.Cells[16 + commonSheetParams.RowOffset, counter.Iteration + 2].Value = directSchemeData;
  25.  
  26.             commonSheet.Cells[17 + commonSheetParams.RowOffset, counter.Iteration + 2].Value = planCp.Abonents;
  27.             commonSheet.Cells[18 + commonSheetParams.RowOffset, counter.Iteration + 2].FormulaR1C1 =
  28.                 $"'{commonSheetParams.DataSheetName}'!R14C{amountColumn}";
  29.             commonSheet.Cells[19 + commonSheetParams.RowOffset, counter.Iteration + 2].FormulaR1C1 =
  30.                 $"'{commonSheetParams.DataSheetName}'!R27C{amountColumn}";
  31.             commonSheet.Cells[20 + commonSheetParams.RowOffset, counter.Iteration + 2].Value = certificateAmount;
  32.             commonSheet.Cells[21 + commonSheetParams.RowOffset, counter.Iteration + 2].FormulaR1C1 = counter.Iteration == 1
  33.                 ? $"R{commonSheetParams.RowOffset + 20}C{counter.Iteration + 2}"
  34.                 : $"R{commonSheetParams.RowOffset + 20}C{counter.Iteration + 2} + R{commonSheetParams.RowOffset + 21}C{counter.Iteration + 1}";
  35.             commonSheet.Cells[22 + commonSheetParams.RowOffset, counter.Iteration + 2].Value = planCp.ToProlongate;
  36.             commonSheet.Cells[23 + commonSheetParams.RowOffset, counter.Iteration + 2].Value = planCp.LostPercent;
  37.             commonSheet.Cells[24 + commonSheetParams.RowOffset, counter.Iteration + 2].FormulaR1C1 =
  38.                 $"(R{18 + commonSheetParams.RowOffset}C{counter.Iteration + 2} - {lastYearTariffsCount}) / {lastYearTariffsCount} * 100";
  39.             commonSheet.Cells[25 + commonSheetParams.RowOffset, counter.Iteration + 2].FormulaR1C1 =
  40.                 $"(R{18 + commonSheetParams.RowOffset}C{counter.Iteration + 2} - {lastIterationTariffsCount}) / {lastIterationTariffsCount} * 100";
  41.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement