Пример #1
0
        private DataTable ConvertCCMExcelToDataTable(System.Web.HttpPostedFileBase postedFile)
        {
            IFileProvider fileProvider  = new FileSystemProvider();
            IExcelFactory excelFactory  = new ExcelFactory();
            CurrentInfo   objCurInfo    = new CurrentInfo();
            string        containerName = objCurInfo.GetCompanyCode().ToLower();
            string        fileName      = postedFile.FileName;

            string[] excelRetrieveColumns = new string[] { "Row_No", "Customer_Name", "Sur_Name", "Speciality_Name", "Gender", "Qualification", "Address1",
                                                           "Address2", "Local_Area", "Pin_Code", "City", "State", "Country", "Phone", "Mobile", "Fax", "Email", "Hospital_Name", "Hospital_Classification",
                                                           "DOB", "Anniversary_Date", "Registration_No" };

            _CCMExcelTemplateFileName = fileProvider.GetFilePathToSave(UPLOAD_PATH_KEY_NAME, fileName);
            string whereQuery = " LEN(Customer_Name) >0 ";

            DataControl.Repository.AzureBlobUpload objAzureUpload = new Repository.AzureBlobUpload();
            DataControl.Abstraction.IFileProvider  objPathProv    = new DataControl.Impl.FileSystemProvider();

            string accKey = objPathProv.GetConfigValue("UPLOADEDFILEBLOBACCKEY");

            string blobURL = objAzureUpload.PutAzureBlobStorage(postedFile.InputStream, postedFile.FileName, accKey, containerName);

            System.IO.Stream stream = objAzureUpload.AzureblockDownload(postedFile.FileName, accKey, containerName);
            DataTable        dt     = new DataTable();

            dt = objAzureUpload.ConvertStreamToDataTable(stream, "Customer_Name");
            return(dt);
        }
        private DataTable ConvertRCPAExcelToDataTable(System.Web.HttpPostedFileBase postedFile)
        {
            IFileProvider fileProvider  = new FileSystemProvider();
            IExcelFactory excelFactory  = new ExcelFactory();
            CurrentInfo   objCurInfo    = new CurrentInfo();
            string        containerName = objCurInfo.GetCompanyCode().ToLower();
            string        fileName      = postedFile.FileName;

            string[] excelRetrieveColumns = new string[] { "*" };

            _employeeExcelTemplateFileName = fileProvider.GetFilePathToSave(UPLOAD_PATH_KEY_NAME, fileName);
            string whereQuery = " LEN(Region_Name) >0 ";

            //  postedFile.SaveAs(_employeeExcelTemplateFileName);

            DataControl.Repository.AzureBlobUpload objAzureUpload = new Repository.AzureBlobUpload();
            DataControl.Abstraction.IFileProvider  objPathProv    = new DataControl.Impl.FileSystemProvider();

            string accKey = objPathProv.GetConfigValue("UPLOADEDFILEBLOBACCKEY");

            string blobURL = objAzureUpload.PutAzureBlobStorage(postedFile.InputStream, postedFile.FileName, accKey, containerName);

            System.IO.Stream stream = objAzureUpload.AzureblockDownload(postedFile.FileName, accKey, containerName);
            DataTable        dt     = new DataTable();

            dt = objAzureUpload.ConvertStreamToDataTable(stream, "D_Doctor_Name");
            return(dt);
        }
Пример #3
0
        public void DownloadInwardExcelTemplate()
        {
            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
            DataControl.Repository.FileDownload   objFileDownload = new DataControl.Repository.FileDownload();
            DataControl.Abstraction.IFileProvider objProvider     = new DataControl.Impl.FileSystemProvider();
            string error    = string.Empty;
            string fileName = "BulkInwardUpload.xlsx";
            string blobURL  = objProvider.GetConfigValue("EXCELTEMPLATES") + fileName;

            objFileDownload.DownloadFile(blobURL, fileName, out error);
        }
Пример #4
0
        /// <summary>
        /// get the selected message details
        /// </summary>
        /// <param name="msgCode"></param>
        /// <returns>returns the selected message details in the form of json </returns>
        public string GetSelectedMsgDetails(string msgCode, string TargetAddress)
        {
            DataControl.CurrentInfo   objCurInfo = new DataControl.CurrentInfo();
            DataControl.BLMessaging   objMsg     = new DataControl.BLMessaging();
            DataControl.JSONConverter objJson    = new DataControl.JSONConverter();
            DataControl.Repository.AzureBlobUpload objAzureUpload = new DataControl.Repository.AzureBlobUpload();
            DataControl.Abstraction.IFileProvider  objPathProv    = new DataControl.Impl.FileSystemProvider();
            string accKey  = objPathProv.GetConfigValue("NBFILES");
            string blobURL = accKey + objCurInfo.GetCompanyCode().ToLower();

            return(objJson.Serialize(objMsg.GetSelectedMsgDetails(objCurInfo.GetCompanyCode(), msgCode, TargetAddress)) + "~" + blobURL);
        }