Пример #1
0
        public ActionResult uploadNotificationDoc(RFAReferralFile _rfaReferralFile)
        {
            StorageModel _storageModel = new StorageModel();

            _storageModel            = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(_rfaReferralFile.RFAReferralID, GlobalConst.ConstantChar.Char_R));
            _storageModel.path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            _storageModel.FolderName = GlobalConst.FolderName.LegalDocs;

            string filename     = Guid.NewGuid().ToString() + Path.GetExtension(_rfaReferralFile.rfaReferralFile.FileName);
            string path         = _storageService.GeneateStorage(_storageModel);
            string fileToDelete = _rfaReferralFile.RFAReferralFileName;

            _rfaReferralFile.rfaReferralFile.SaveAs(path + GlobalConst.ConstantChar.DoubleBackSlash + filename);

            _rfaReferralFile.RFAReferralFileName = filename;
            _rfaReferralFile.RFAFileTypeID       = GlobalConst.FileType.UploadInitialNotifications;
            _rfaReferralFile.RFAFileCreationDate = DateTime.Now;
            _rfaReferralFile.RFAFileUserID       = MMCUser.UserId;
            if (_rfaReferralFile.RFAReferralFileID == 0)
            {
                _rfaReferralFile.RFAReferralFileID = _intakeService.addReferralFile(Mapper.Map <serviceModel.IntakeService.RFAReferralFile>(_rfaReferralFile));
            }
            else
            {
                System.IO.File.Delete(path + GlobalConst.ConstantChar.DoubleBackSlash + fileToDelete);
                _intakeService.updateReferralFile(Mapper.Map <serviceModel.IntakeService.RFAReferralFile>(_rfaReferralFile));
            }
            _rfaReferralFile.rfaReferralFile = null;
            return(Json(_rfaReferralFile, GlobalConst.ContentTypes.TextHtml));
        }
Пример #2
0
        public JsonResult UploadIMRDecisionDoc(int id, int id2)
        {
            HttpPostedFileBase fileContent   = Request.Files[0];
            string             filename      = Guid.NewGuid().ToString() + Path.GetExtension(fileContent.FileName);
            StorageModel       _storageModel = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(id, GlobalConst.ConstantChar.Char_R));

            _storageModel.path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            _storageModel.FolderName = GlobalConst.FolderName.MedicalRecords;
            string path = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + filename;

            RFAReferralFile _rfaFile = new RFAReferralFile();

            _rfaFile.RFAReferralID       = id;
            _rfaFile.RFAReferralFileName = filename;
            _rfaFile.RFAFileTypeID       = GlobalConst.FileType.IMRDecisionUpload;
            _rfaFile.RFAFileCreationDate = DateTime.Now;
            _rfaFile.RFAFileUserID       = MMCUser.UserId;

            if (id2 != 0)
            {
                System.IO.File.Delete(path);
                fileContent.SaveAs(path);
                _rfaFile.RFAReferralFileID = id2;
                _intakeService.updateReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile));
            }
            else
            {
                fileContent.SaveAs(path);
                id2 = _intakeService.addReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile));
            }
            return(Json(id2));
        }
Пример #3
0
        public ActionResult uploadIntakeFile(RFAReferralFile _rfaReferralFile)
        {
            string path         = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString() + GlobalConst.VirtualPathFolders.IntakeUploadFiles);
            string filename     = Guid.NewGuid().ToString() + Path.GetExtension(_rfaReferralFile.rfaReferralFile.FileName);
            string fileToDelete = _rfaReferralFile.RFAReferralFileName;

            _rfaReferralFile.rfaReferralFile.SaveAs(path + "\\" + filename);

            _rfaReferralFile.RFAReferralFileName = filename;

            if (_rfaReferralFile.RFAReferralFileID == 0)
            {
                _rfaReferralFile = Mapper.Map <RFAReferralFile>(_intakeService.addReferralFileIntake(GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf, MMCUser.UserId));
                _commonService.AddProcessLevelByReferralID(_rfaReferralFile.RFAReferralID, GlobalConst.ProcessLevel.Intake);
                _commonService.AddProcessLevelByReferralID(_rfaReferralFile.RFAReferralID, GlobalConst.ProcessLevel.ClaimVerification);
                System.IO.File.Move(path + "\\" + filename, path + "\\" + _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf);
                _rfaReferralFile.Mode = "Add";
            }
            else
            {
                _rfaReferralFile.RFAFileTypeID = GlobalConst.FileTypes.IntakeUpload;
                if (System.IO.File.Exists(path + "\\" + _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf))
                {
                    System.IO.File.Delete(path + "\\" + _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf);
                }

                _rfaReferralFile.RFAReferralFileName = _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf;
                _rfaReferralFile.RFAFileUserID       = MMCUser.UserId;
                _rfaReferralFile.RFAFileCreationDate = DateTime.Now;
                _intakeService.updateReferralFile(Mapper.Map <serviceModel.IntakeService.RFAReferralFile>(_rfaReferralFile));
                _pdfSplitterService.deleteIntakeUploadedFile(Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath]), fileToDelete);
                System.IO.File.Move(path + "\\" + filename, path + "\\" + _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf);
                _rfaReferralFile.Mode = "Update";
            }
            filename = _rfaReferralFile.RFAReferralID + "_" + GlobalConst.VirtualPathFolders.IntakeUpload + GlobalConst.Extension.pdf;
            _rfaReferralFile.RFAReferralFileFullPath = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString() + GlobalConst.VirtualPathFolders.IntakeUploadFiles + "\\" + filename;
            _rfaReferralFile.rfaReferralFile         = null;
            _rfaReferralFile.TotalPages = _pdfSplitterService.getTotalPageofFileIntake(Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath]), filename);
            return(Json(_rfaReferralFile, GlobalConst.ContentTypes.TextHtml));
        }