2023-07-24 11:14:07 +05:00
|
|
|
using System.Linq;
|
|
|
|
using AsbCloudApp.Data.AutogeneratedDailyReport;
|
|
|
|
using ClosedXML.Excel;
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.AutogeneratedDailyReportBlocks;
|
|
|
|
|
|
|
|
public class LimitingParameterExcelBlockWriter : IExcelBlockWriter
|
|
|
|
{
|
2023-07-24 16:27:31 +05:00
|
|
|
private const int rowHeaderBlock = 20;
|
2023-07-24 11:14:07 +05:00
|
|
|
|
|
|
|
private const int columnNameFeedRegulator = 1;
|
|
|
|
private const int columnDepth = 2;
|
|
|
|
private const int columnTotalHours = 3;
|
|
|
|
private const int columnPercentDepth = 4;
|
|
|
|
|
|
|
|
public void Write(IXLWorksheet sheet, AutoGeneratedDailyReportDto report)
|
|
|
|
{
|
2023-07-28 11:14:45 +05:00
|
|
|
var i = 1;
|
|
|
|
foreach (var limitingParameter in report.LimitingParameters)
|
2023-07-24 11:14:07 +05:00
|
|
|
{
|
2023-07-28 11:14:45 +05:00
|
|
|
var row = sheet.Row( i++ + rowHeaderBlock);
|
|
|
|
row.Cell(columnNameFeedRegulator).Value = limitingParameter.NameFeedRegulator;
|
|
|
|
row.Cell(columnDepth).Value = limitingParameter.Depth;
|
|
|
|
row.Cell(columnTotalHours).Value = limitingParameter.Hours;
|
|
|
|
row.Cell(columnPercentDepth).Value = limitingParameter.PercentDepth;
|
2023-07-24 11:14:07 +05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|