DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/DrillingProgram/ContentListSheet.cs

40 lines
921 B
C#
Raw Permalink Normal View History

using AsbCloudApp.Data;
using ClosedXML.Excel;
using System;
using System.Collections.Generic;
using System.Linq;
2024-08-19 10:01:07 +05:00
namespace AsbCloudInfrastructure.Services.DrillingProgram;
public class ContentListSheet
{
2024-08-19 10:01:07 +05:00
private readonly List<DrillingProgramPartDto> parts;
2024-08-19 10:01:07 +05:00
public ContentListSheet(IEnumerable<DrillingProgramPartDto> parts)
{
2024-08-19 10:01:07 +05:00
this.parts = parts.ToList();
}
2024-08-19 10:01:07 +05:00
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);
2024-08-19 10:01:07 +05:00
for (int i = 0; i < parts.Count; i++)
{
2024-08-19 10:01:07 +05:00
sheet.Cell(4 + i, 1)
.SetValue(i + 1);
2024-08-19 10:01:07 +05:00
sheet.Cell(4 + i, 2)
.SetValue(parts[i].Name);
}
}
}