using AsbCloudApp.Data.DailyReport; using ClosedXML.Excel; namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks { internal class SignBlock : BlockAbstract { private readonly SignDto blockDto; public CellAddress AddressDrillMasterHead { get; } public CellAddress AddressDrillMaster { get; } public CellAddress AddressSupervisorHead { get; } public CellAddress AddressSupervisor { get; } public override CellAddress AddressBlockBegin { get; } public override CellAddress AddressBlockEnd { get; } public SignBlock(CellAddress addressBlockBegin, SignDto blockDto) { AddressBlockBegin = addressBlockBegin.Copy(); this.blockDto = blockDto; AddressDrillMasterHead = addressBlockBegin + (3, 0); AddressDrillMaster = AddressDrillMasterHead + (0, 5); AddressSupervisorHead = AddressDrillMasterHead + (2, 0); AddressSupervisor = AddressSupervisorHead + (0, 5); AddressBlockEnd = AddressSupervisor + (0,1); } public override void Draw(IXLWorksheet sheet) { sheet.Range(AddressDrillMasterHead.RowNumber, AddressDrillMasterHead.ColumnNumber , AddressDrillMasterHead.RowNumber, AddressDrillMasterHead.ColumnNumber + 2) .Merge() .SetValue("Мастер буровой "); sheet.Range(AddressDrillMaster.RowNumber, AddressDrillMaster.ColumnNumber , AddressDrillMaster.RowNumber, AddressDrillMaster.ColumnNumber + 2) .Merge() .SetValue($"{blockDto.DrillingMaster}"); sheet.Range(AddressSupervisorHead.RowNumber, AddressSupervisorHead.ColumnNumber , AddressSupervisorHead.RowNumber, AddressSupervisorHead.ColumnNumber + 2) .Merge() .SetValue("Супервайзер "); sheet.Range(AddressSupervisor.RowNumber, AddressSupervisor.ColumnNumber , AddressSupervisor.RowNumber, AddressSupervisor.ColumnNumber + 2) .Merge() .SetValue($"{blockDto.Supervisor}"); } } }