forked from ddrilling/AsbCloudServer
37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
|
using AsbCloudApp.Data.AutogeneratedDailyReport;
|
||
|
using ClosedXML.Excel;
|
||
|
|
||
|
namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.AutogeneratedDailyReportBlocks;
|
||
|
|
||
|
public class HeadExcelBlockWriter : IExcelBlockWriter
|
||
|
{
|
||
|
private const int columnCustomer = 1;
|
||
|
private const int columnDeposit = 2;
|
||
|
private const int columnCluster = 3;
|
||
|
private const int columnWell = 4;
|
||
|
|
||
|
private const int columnFrom = 1;
|
||
|
private const int columnTo = 2;
|
||
|
private const int columnWellDepthIntervalStartDate = 3;
|
||
|
private const int columnWellDepthIntervalFinishDate = 4;
|
||
|
|
||
|
public void Write(IXLWorksheet sheet, AutoGeneratedDailyReportDto report)
|
||
|
{
|
||
|
const int rowHeaderBlockSectionOne = 2;
|
||
|
const int rowHeaderBlockSectionTwo = 5;
|
||
|
|
||
|
var rowSectionOne = sheet.Row(1 + rowHeaderBlockSectionOne);
|
||
|
|
||
|
rowSectionOne.Cell(columnCustomer).Value = report.Head.Customer;
|
||
|
rowSectionOne.Cell(columnDeposit).Value = report.Head.Deposit;
|
||
|
rowSectionOne.Cell(columnCluster).Value = report.Head.ClusterName;
|
||
|
rowSectionOne.Cell(columnWell).Value = report.Head.WellName;
|
||
|
|
||
|
var rowSectionTwo = sheet.Row(1 + rowHeaderBlockSectionTwo);
|
||
|
|
||
|
rowSectionTwo.Cell(columnFrom).Value = report.Head.From;
|
||
|
rowSectionTwo.Cell(columnTo).Value = report.Head.To;
|
||
|
rowSectionTwo.Cell(columnWellDepthIntervalStartDate).Value = report.Head.WellDepthIntervalStartDate;
|
||
|
rowSectionTwo.Cell(columnWellDepthIntervalFinishDate).Value = report.Head.WellDepthIntervalFinishDate;
|
||
|
}
|
||
|
}
|