50 lines
1.6 KiB
C#
50 lines
1.6 KiB
C#
using System.IO;
|
||
using ToolsOffice.Interfaces.Word.Models;
|
||
using ToolsOffice.Interfaces.Word.Models.Cases;
|
||
|
||
namespace ToolsOffice.Interfaces.Word
|
||
{
|
||
public abstract class BuilderWordDocument
|
||
{
|
||
/// <summary>
|
||
/// Создание документа с заголовком и таблицей
|
||
/// </summary>
|
||
/// <param name="model"></param>
|
||
/// <returns></returns>
|
||
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);
|
||
}
|
||
|
||
/// <summary>
|
||
/// Создание документа
|
||
/// </summary>
|
||
/// <param name="model"></param>
|
||
public abstract void CreateDocument(ModelWordDocument model);
|
||
|
||
/// <summary>
|
||
/// Создание абзаца с текстом
|
||
/// </summary>
|
||
/// <param name="model"></param>
|
||
public abstract void CreateParagraph(ModelWordParagraph model);
|
||
|
||
/// <summary>
|
||
/// Создание абзаца с текстом
|
||
/// </summary>
|
||
/// <param name="model"></param>
|
||
public abstract void CreateTable(ModelWordTable model);
|
||
|
||
/// <summary>
|
||
/// Сохранение файла
|
||
/// </summary>
|
||
/// <param name="info"></param>
|
||
public abstract Stream SaveDocument(ModelWordDocument info);
|
||
}
|
||
} |