コード例 #1
0
        public async Task CreateNote(NoteRequest noteRequest)
        {
            var note = new FWTCreateNoteToParent
            {
                NoteDetails = new FWTCreateNoteDetail
                {
                    Text = noteRequest.NoteText
                },
                ParentId   = noteRequest.CaseRef,
                ParentType = noteRequest.Interaction
            };

            await _verintConnection.createNotesAsync(note);
        }
コード例 #2
0
        public async Task CreateNotesWithAttachment(NoteWithAttachments note)
        {
            try
            {
                var repositoryResult = await AddDocumentToRepository(note.Attachments);

                var attachedFileReferences = new List <FWTNoteDetailAttachment>();

                repositoryResult.ForEach(r =>
                {
                    attachedFileReferences.Add(new FWTNoteDetailAttachment
                    {
                        AttachmentIdentifier    = r.documentReference,
                        AttachmentName          = r.documentName,
                        AttachmentTypeSpecified = false
                    });
                });

                var noteWithAttachments = new FWTCreateNoteToParent
                {
                    NoteDetails = new FWTCreateNoteDetail
                    {
                        Text            = note.AttachmentsDescription,
                        NoteAttachments = attachedFileReferences.ToArray()
                    },
                    ParentId   = note.CaseRef,
                    ParentType = note.Interaction
                };

                await _verintConnection.createNotesAsync(noteWithAttachments);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
                _logger.LogError(exception, "Error when adding attachment");
                throw;
            }
        }