Esempio n. 1
0
        public HttpResponseMessage DownloadFromBlob(HttpRequestMessage request, int companyid, string documentPath, string servicepProvider)
        {
            var objResult = new Object();

            serviceProvider = (BlobServiceProvider)BlobStorageFactory.GetBlobServiceProviders(servicepProvider);
            serviceProvider.Download(companyid, documentPath);
            try { return(request.CreateResponse(HttpStatusCode.Created, objResult)); }
            catch (Exception ex) { return(request.CreateResponse(HttpStatusCode.BadRequest, objResult)); }
        }
Esempio n. 2
0
        public HttpResponseMessage MergeDocuments(HttpRequestMessage request, int companyid, object pdfFiles, string blobPath, string servicepProvider)
        {
            var objResult = new Object();

            serviceProvider = (BlobServiceProvider)BlobStorageFactory.GetBlobServiceProviders(servicepProvider);
            objResult       = serviceProvider.Merge(companyid, pdfFiles, blobPath);
            if (objResult != null)
            {
                return(request.CreateResponse(HttpStatusCode.Created, objResult));
            }
            else
            {
                return(request.CreateResponse(HttpStatusCode.NotFound, objResult));
            }
        }
Esempio n. 3
0
        public HttpResponseMessage UploadToBlob(HttpRequestMessage request, MemoryStream stream, string blobPath, int companyId, string servicepProvider)
        {
            string objResult = "";

            try
            {
                serviceProvider = BlobStorageFactory.GetBlobServiceProviders(servicepProvider);
                if (serviceProvider == null)
                {
                    return(request.CreateResponse(HttpStatusCode.NotFound, "No BLOB storage provider found."));
                }

                objResult = serviceProvider.Upload(blobPath, stream, companyId) as string;
                if (objResult != null)
                {
                    return(request.CreateResponse(HttpStatusCode.Created, objResult));
                }
                else
                {
                    return(request.CreateResponse(HttpStatusCode.NotFound, objResult));
                }
            }
            catch (Exception ex) { return(request.CreateResponse(HttpStatusCode.BadRequest, ex.Message)); }
        }