2024-05-29 01:11:23 +04:00
|
|
|
|
using LawFirmBusinessLogic.OfficePackages.HelperEnums;
|
|
|
|
|
using LawFirmBusinessLogic.OfficePackages.HelperModels;
|
|
|
|
|
|
|
|
|
|
namespace LawFirmBusinessLogic.OfficePackages
|
|
|
|
|
{
|
|
|
|
|
public abstract class AbstractSaveToPdfClientCaseHearing
|
|
|
|
|
{
|
|
|
|
|
public void CreateDoc(PDFClientCaseHearingInfo info)
|
|
|
|
|
{
|
|
|
|
|
CreatePdf(info);
|
|
|
|
|
CreateParagraph(new PdfParagraph
|
|
|
|
|
{
|
|
|
|
|
Text = info.Title,
|
|
|
|
|
Style = "NormalTitle",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
|
|
|
|
});
|
|
|
|
|
CreateParagraph(new PdfParagraph
|
|
|
|
|
{
|
|
|
|
|
Text = $"с{info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}",
|
|
|
|
|
Style = "Normal",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
|
|
|
|
});
|
|
|
|
|
CreateTable(new List<string> { "3cm", "5cm", "5cm" });
|
|
|
|
|
CreateRow(new PdfRowParameters
|
|
|
|
|
{
|
2024-05-30 10:16:46 +04:00
|
|
|
|
Texts = new List<string> { "Клиент", "Дело", "Тип" },
|
2024-05-29 01:11:23 +04:00
|
|
|
|
Style = "NormalTitle",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
foreach (var ch in info.ClientCaseHearing)
|
|
|
|
|
{
|
|
|
|
|
CreateRow(new PdfRowParameters
|
|
|
|
|
{
|
|
|
|
|
Texts = new List<string> { ch.ClientName, " ", " " },
|
|
|
|
|
Style = "Normal",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
foreach (var cas in ch.Case)
|
|
|
|
|
CreateRow(new PdfRowParameters
|
|
|
|
|
{
|
2024-05-30 10:16:46 +04:00
|
|
|
|
Texts = new List<string> { " ", cas.CaseName, cas.CaseType },
|
2024-05-29 01:11:23 +04:00
|
|
|
|
Style = "Normal",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
|
|
|
|
});
|
|
|
|
|
CreateRow(new PdfRowParameters
|
|
|
|
|
{
|
|
|
|
|
Texts = new List<string> { " ", " ", "Итого: " + ch.Case.Count.ToString() },
|
|
|
|
|
Style = "Normal",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Rigth
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CreateTable(new List<string> { "3cm", "5cm", "5cm" });
|
|
|
|
|
CreateRow(new PdfRowParameters
|
|
|
|
|
{
|
|
|
|
|
Texts = new List<string> { "Клиент", "Суд", "Дата слушания" },
|
|
|
|
|
Style = "NormalTitle",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
|
|
|
|
});
|
|
|
|
|
foreach (var ch in info.ClientCaseHearing)
|
|
|
|
|
{
|
|
|
|
|
CreateRow(new PdfRowParameters
|
|
|
|
|
{
|
|
|
|
|
Texts = new List<string> { ch.ClientName, " ", " " },
|
|
|
|
|
Style = "Normal",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
foreach (var hear in ch.Hearing)
|
|
|
|
|
CreateRow(new PdfRowParameters
|
|
|
|
|
{
|
|
|
|
|
Texts = new List<string> { " ", hear.Judge, hear.HearingDate.ToShortDateString() },
|
|
|
|
|
Style = "Normal",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
|
|
|
|
});
|
|
|
|
|
CreateRow(new PdfRowParameters
|
|
|
|
|
{
|
|
|
|
|
Texts = new List<string> { " ", " ", "Итого: " + ch.Hearing.Count.ToString() },
|
|
|
|
|
Style = "Normal",
|
|
|
|
|
ParagraphAlignment = PdfParagraphAlignmentType.Rigth
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
SavePdf(info);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Создание doc-файла
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="info"></param>
|
|
|
|
|
protected abstract void CreatePdf(PDFClientCaseHearingInfo info);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Создание параграфа с текстом
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="title"></param>
|
|
|
|
|
/// <param name="style"></param>
|
|
|
|
|
protected abstract void CreateParagraph(PdfParagraph paragraph);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Создание таблицы
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="title"></param>
|
|
|
|
|
/// <param name="style"></param>
|
|
|
|
|
protected abstract void CreateTable(List<string> columns);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Создание и заполнение строки
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="rowParameters"></param>
|
|
|
|
|
protected abstract void CreateRow(PdfRowParameters rowParameters);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Сохранение файла
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="info"></param>
|
|
|
|
|
protected abstract void SavePdf(PDFClientCaseHearingInfo info);
|
|
|
|
|
}
|
|
|
|
|
}
|