public Message CreateServiceDocumentMessage(Message message, Document document, X509Certificate2 certificate2, DocumentType documentType, NamedContent generatedNotice) { var noticeMessage = AddDocumentToNewMessage( new Message() { Id = Guid.NewGuid().ToString(), From = CurrentBox, Recipients = message.GetRecipientListForSender(CurrentBox), }, new Document() { Id = (Guid.NewGuid().ToString()), DocumentType = documentType, ParentDocumentId = document.Id, FileName = generatedNotice.Name, Content = generatedNotice.Content }, CryptoApiHelper.Sign(certificate2, generatedNotice.Content, true)); return noticeMessage; }
private void SaveDocumentFlowArchive(NamedContent flowArchive) { if (!UserInput.ChooseYesNo("Сохранить архив документооборота?")) return; var directoryPath = ChooseDirectory(); if (!Directory.Exists(directoryPath)) Directory.CreateDirectory(directoryPath); Console.Out.WriteLine("Сохранение архива '{0}'", flowArchive.Name); FileHelper.WriteAllBytes(directoryPath, flowArchive.Name, flowArchive.Content); }
private void SaveFile(NamedContent namedContent) { if (!UserInput.ChooseYesNo("Сохранить файл?")) return; var directoryPath = ChooseDirectory(); if (!Directory.Exists(directoryPath)) Directory.CreateDirectory(directoryPath); Console.Out.WriteLine("Сохранение файла: '{0}'", namedContent.Name); FileHelper.WriteAllBytes(directoryPath, namedContent.Name, namedContent.Content); }
private void PrintDocumentFlowArchive(NamedContent flowArchive) { Console.Out.WriteLine("Архив документооборота: \n {0}\n {1} байт", flowArchive.Name, flowArchive.Content.Length); }