示例#1
0
 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;
 }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
 private void PrintDocumentFlowArchive(NamedContent flowArchive)
 {
     Console.Out.WriteLine("Архив документооборота: \n {0}\n {1} байт", flowArchive.Name, flowArchive.Content.Length);
 }