DepartmentProject/DepartmentPortal/Common/ToolsOffice/Interfaces/Word/BuilderWordDocument.cs

45 lines
1.4 KiB
C#
Raw Normal View History

2022-12-17 23:44:29 +04:00
using System.IO;
using ToolsOffice.Interfaces.Word.Models;
2022-12-19 12:17:45 +04:00
using ToolsOffice.Interfaces.Word.Models.Cases;
2022-12-17 23:44:29 +04:00
namespace ToolsOffice.Interfaces.Word
{
public abstract class BuilderWordDocument
{
2022-12-19 12:17:45 +04:00
public Stream CreateDocumentWithTable(ModelWordDocumentWithHeaderAndTable model)
{
if (model == null || model.Document == null || model.Header == null || model.Table == null)
{
return null;
}
CreateDocument(model.Document);
CreateParagraph(model.Header);
CreateTable(model.Table);
return SaveDocument(model.Document);
}
2022-12-17 23:44:29 +04:00
/// <summary>
/// Создание документа
/// </summary>
/// <param name="model"></param>
public abstract void CreateDocument(ModelWordDocument model);
2022-12-17 23:44:29 +04:00
/// <summary>
/// Создание абзаца с текстом
/// </summary>
/// <param name="model"></param>
public abstract void CreateParagraph(ModelWordParagraph model);
2022-12-17 23:44:29 +04:00
/// <summary>
/// Создание абзаца с текстом
/// </summary>
/// <param name="model"></param>
public abstract void CreateTable(ModelWordTable model);
2022-12-17 23:44:29 +04:00
/// <summary>
/// Сохранение файла
/// </summary>
/// <param name="info"></param>
public abstract Stream SaveDocument(ModelWordDocument info);
2022-12-17 23:44:29 +04:00
}
}