DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/LimitingParameterExcelBlockWriter.cs

28 lines
968 B
C#

using System.Linq;
using AsbCloudApp.Data.AutogeneratedDailyReport;
using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.AutogeneratedDailyReportBlocks;
public class LimitingParameterExcelBlockWriter : IExcelBlockWriter
{
private const int rowHeaderBlock = 20;
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)
{
var i = 1;
foreach (var limitingParameter in report.LimitingParameters)
{
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;
}
}
}