Exemple #1
0
 public DocumentMigration()
 {
     SettingPage = new PageSetting();
     Headers     = new HeadersDocuments();
     Single      = new Single();
     Fotters     = new Fotters();
     Body        = new BodyDocument();
 }
Exemple #2
0
 /// <summary>
 /// Создание документов по Миграции
 /// </summary>
 /// <param name="fullPath">Полный путь к сохранению файла с именем</param>
 /// <param name="documentTemplate">Шаблон документа из БД</param>
 /// <param name="migration">Журнал миграции</param>
 /// <param name="model">Модель с параметрами</param>
 /// <param name="isTemplate">Шаблон ЮЛ или ФЛ</param>
 /// <param name="ifns">ИФНС номер инспекции</param>
 private void GenerateDoc(string fullPath, LibaryXMLAutoReports.FullTemplateSheme.Document documentTemplate, ReportMigration[] migration, MigrationParse model, int isTemplate, string ifns)
 {
     using (WordprocessingDocument package = WordprocessingDocument.Create(fullPath, WordprocessingDocumentType.Document))
     {
         MainDocumentPart mainDocumentPart = package.AddMainDocumentPart();
         DocumentFormat.OpenXml.Wordprocessing.Document doc = new DocumentFormat.OpenXml.Wordprocessing.Document();
         Fotters.FottersAddDocument(mainDocumentPart, documentTemplate.Templates.Stone.Stone4, documentTemplate.Templates.Stone.Stone5);
         doc.Append(SettingPage.AddSetting(mainDocumentPart));
         doc.Append(Headers.HeaderDocumentIfns(documentTemplate, mainDocumentPart, ifns, model.N280, model.Otdel));
         doc.Append(Body.TextDocumentFormatMigration(documentTemplate));
         doc.Append(Body.GenerateMigrationTable(migration, isTemplate));
         doc.Append(Single.AddSingle(documentTemplate));
         mainDocumentPart.Document = doc;
         package.MainDocumentPart.Document.Save();
         package.Close();
     }
 }