103 lines
3.4 KiB
C#
103 lines
3.4 KiB
C#
using CandidateReviewBusinessLogic.OfficePackage.HelperEnums;
|
||
using CandidateReviewBusinessLogic.OfficePackage.HelperModels;
|
||
|
||
namespace CandidateReviewBusinessLogic.OfficePackage
|
||
{
|
||
public abstract class AbstractSaveToPdf
|
||
{
|
||
public void CreateDocReportResume(PdfInfo info)
|
||
{
|
||
CreatePdf(info);
|
||
|
||
// Заголовок резюме
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = $"Резюме: {info.Title}",
|
||
Style = "NormalTitle",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||
});
|
||
|
||
// ФИО и вакансия
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = $"ФИО: {info.Resume.UserName ?? "Не указано"}",
|
||
Style = "Normal",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = $"Вакансия: {info.Resume.VacancyName ?? "Не указано"}",
|
||
Style = "Normal",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
// Образование
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = "Образование:",
|
||
Style = "Subtitle",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = info.Resume.Education ?? "Не указано",
|
||
Style = "Normal",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
// Опыт работы
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = "Опыт работы:",
|
||
Style = "Subtitle",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = info.Resume.Experience ?? "Не указано",
|
||
Style = "Normal",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
// Навыки
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = "Навыки:",
|
||
Style = "Subtitle",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = info.Resume.Skills ?? "Не указано",
|
||
Style = "Normal",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
// Описание
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = "Описание:",
|
||
Style = "Subtitle",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
CreateParagraph(new PdfParagraph
|
||
{
|
||
Text = info.Resume.Description ?? "Не указано",
|
||
Style = "Normal",
|
||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||
});
|
||
|
||
SavePdf(info);
|
||
}
|
||
|
||
protected abstract void CreatePdf(PdfInfo info);
|
||
protected abstract void CreateParagraph(PdfParagraph paragraph);
|
||
protected abstract void SavePdf(PdfInfo info);
|
||
}
|
||
}
|