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

50 lines
1.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}
}