task 1 complete task2 task2 change test data initialization task3 task2 fix fixes add percents minor fixes
30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using ComponentLibrary1.office_package.HelperModels;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ComponentLibrary1.pdf_table
|
|
{
|
|
public class PdfTableInfo<T> : IPdfInfo
|
|
{
|
|
public string FileName { get; set; } = string.Empty;
|
|
public string Title { get; set; } = string.Empty;
|
|
public List<TreeNode> Headers { get; set; } = new();
|
|
public List<T> Data { get; set; } = new();
|
|
|
|
public void CheckFields()
|
|
{
|
|
if (string.IsNullOrWhiteSpace(FileName))
|
|
throw new ArgumentException("Имя файла не может быть пустым.", nameof(FileName));
|
|
if (string.IsNullOrWhiteSpace(Title))
|
|
throw new ArgumentException("Название документа не может быть пустым.", nameof(Title));
|
|
if (Headers == null || Headers.Count == 0)
|
|
throw new ArgumentException("Заголовки для шапки не могут быть пустыми.", nameof(Headers));
|
|
if (Data == null || Data.Count == 0)
|
|
throw new ArgumentException("Данные для таблицы не могут быть пустыми.", nameof(Data));
|
|
}
|
|
}
|
|
}
|