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>
|
2022-12-19 11:10:05 +04:00
|
|
|
|
public abstract void CreateDocument(ModelWordDocument model);
|
2022-12-17 23:44:29 +04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Создание абзаца с текстом
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model"></param>
|
2022-12-19 11:10:05 +04:00
|
|
|
|
public abstract void CreateParagraph(ModelWordParagraph model);
|
2022-12-17 23:44:29 +04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Создание абзаца с текстом
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model"></param>
|
2022-12-19 11:10:05 +04:00
|
|
|
|
public abstract void CreateTable(ModelWordTable model);
|
2022-12-17 23:44:29 +04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Сохранение файла
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="info"></param>
|
2022-12-19 11:10:05 +04:00
|
|
|
|
public abstract Stream SaveDocument(ModelWordDocument info);
|
2022-12-17 23:44:29 +04:00
|
|
|
|
}
|
|
|
|
|
}
|