2024-07-04 11:02:45 +05:00
|
|
|
using AsbCloudApp.Data;
|
2022-07-06 17:24:09 +05:00
|
|
|
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
|
2022-07-06 17:24:09 +05:00
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
private readonly List<DrillingProgramPartDto> parts;
|
2023-04-18 16:22:53 +05:00
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
public ContentListSheet(IEnumerable<DrillingProgramPartDto> parts)
|
2022-07-06 17:24:09 +05:00
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
this.parts = parts.ToList();
|
|
|
|
}
|
2022-07-06 17:24:09 +05:00
|
|
|
|
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);
|
2022-07-06 17:24:09 +05:00
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
for (int i = 0; i < parts.Count; i++)
|
2022-07-06 17:24:09 +05:00
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
sheet.Cell(4 + i, 1)
|
|
|
|
.SetValue(i + 1);
|
2023-04-18 16:22:53 +05:00
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
sheet.Cell(4 + i, 2)
|
|
|
|
.SetValue(parts[i].Name);
|
|
|
|
}
|
|
|
|
}
|
2022-07-06 17:24:09 +05:00
|
|
|
}
|