Exemplo n.º 1
0
        public int addReferralFile(DLModel.RFAReferralFile _rfaReferralFile)
        {
            if (_rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.IMRApplication)
            {
                _rfaReferralFileRepo.Delete(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAFileTypeID == GlobalConst.FileTypes.IMRApplication);
            }
            else if (_rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.ProofofService)
            {
                _rfaReferralFileRepo.Delete(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAFileTypeID == GlobalConst.FileTypes.ProofofService);
            }
            else if (_rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.TimeExtensionProofOfService)
            {
                _rfaReferralFileRepo.Delete(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAFileTypeID == GlobalConst.FileTypes.TimeExtensionProofOfService);
            }
            else if (_rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.RFIPreparationLetter)
            {
                _rfaReferralFileRepo.Delete(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAFileTypeID == GlobalConst.FileTypes.RFIPreparationLetter);
            }
            else if (_rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.DeterminationLetter)
            {
                _rfaReferralFileRepo.Delete(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAFileTypeID == GlobalConst.FileTypes.DeterminationLetter);
            }
            else if (_rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.IMRSplitContent)
            {
                _rfaReferralFileRepo.Delete(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAFileTypeID == GlobalConst.FileTypes.IMRSplitContent);
            }
            else if (_rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.IMRSplitBarcode)
            {
                _rfaReferralFileRepo.Delete(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAFileTypeID == GlobalConst.FileTypes.IMRSplitBarcode);
            }
            else if (_rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.WithdrawnUpload)
            {
                _rfaReferralFileRepo.Delete(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAReferralFileName == _rfaReferralFile.RFAReferralFileName && fl.RFAFileTypeID == GlobalConst.FileTypes.WithdrawnUpload);
            }
            else if (_rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.ClientAuthorizedUpload)
            {
                _rfaReferralFileRepo.Delete(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAReferralFileName == _rfaReferralFile.RFAReferralFileName && fl.RFAFileTypeID == GlobalConst.FileTypes.ClientAuthorizedUpload);
            }


            if (_rfaReferralFileRepo.GetAll(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAFileTypeID == GlobalConst.FileTypes.TimeExtensionPN && _rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.TimeExtensionPN).Count() > 0)
            {
                return(0);
            }
            else if (_rfaReferralFileRepo.GetAll(fl => fl.RFAReferralID == _rfaReferralFile.RFAReferralID && fl.RFAFileTypeID == GlobalConst.FileTypes.TimeExtension && _rfaReferralFile.RFAFileTypeID == GlobalConst.FileTypes.TimeExtension).Count() > 0)
            {
                return(0);
            }
            else
            {
                return(_rfaReferralFileRepo.Add(_rfaReferralFile).RFAReferralFileID);
            }
        }
Exemplo n.º 2
0
 public int updateReferralFile(DLModel.RFAReferralFile _rfaReferralFile)
 {
     return(_rfaReferralFileRepo.Update(_rfaReferralFile));
 }