DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/DrillingProgram/ContentListSheet.cs
2024-08-19 10:01:07 +05:00

40 lines
921 B
C#

using AsbCloudApp.Data;
using ClosedXML.Excel;
using System;
using System.Collections.Generic;
using System.Linq;
namespace AsbCloudInfrastructure.Services.DrillingProgram;
public class ContentListSheet
{
private readonly List<DrillingProgramPartDto> parts;
public ContentListSheet(IEnumerable<DrillingProgramPartDto> parts)
{
this.parts = parts.ToList();
}
public void Draw(IXLWorksheet sheet)
{
sheet.Style.Font.FontName = "Calibri";
sheet.Style.Font.FontSize = 12;
sheet.Cell(2, 2)
.SetValue("Содержание")
.Style
.Font.SetBold(true)
.Font.SetFontSize(14);
for (int i = 0; i < parts.Count; i++)
{
sheet.Cell(4 + i, 1)
.SetValue(i + 1);
sheet.Cell(4 + i, 2)
.SetValue(parts[i].Name);
}
}
}