예제 #1
0
        public int ExportAttachmentToMyDocuments(int id_attachment)
        {
            if (id_attachment < 1)
            {
                throw new ArgumentException(@"Invalid attachment id", "id_attachment");
            }

            var documentsDal = new DocumentsDal(MailBoxManager, TenantId, Username);
            var documentId   = documentsDal.StoreAttachmentToMyDocuments(id_attachment);

            return(documentId);
        }
예제 #2
0
        public int ExportAttachmentsToMyDocuments(int id_message)
        {
            if (id_message < 1)
            {
                throw new ArgumentException(@"Invalid message id", "id_message");
            }

            var documentsDal         = new DocumentsDal(MailBoxManager, TenantId, Username);
            var savedAttachmentsList = documentsDal.StoreAttachmentsToMyDocuments(id_message);

            return(savedAttachmentsList.Count);
        }
예제 #3
0
        public int ExportAttachmentsToDocuments(int id_message, string id_folder = null)
        {
            if (id_message < 1)
            {
                throw new ArgumentException(@"Invalid message id", "id_message");
            }

            if (string.IsNullOrEmpty(id_folder))
            {
                id_folder = DocumentsDal.MY_DOCS_FOLDER_ID;
            }

            var scheme               = HttpContext.Current == null ? Uri.UriSchemeHttp : HttpContext.Current.Request.GetUrlRewriter().Scheme;
            var documentsDal         = new DocumentsDal(MailBoxManager, TenantId, Username, scheme);
            var savedAttachmentsList = documentsDal.StoreAttachmentsToDocuments(id_message, id_folder);

            return(savedAttachmentsList.Count);
        }