예제 #1
0
        public override int RunJob()
        {
            try
            {
                FileLock(true);
                _deleteParticipantDataTimeout             = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("DeleteParticipantDataTimeout"));
                _deleteInputFileErrorsOver1YearOldTimeout = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("DeleteOldInputFileErrorsTimeout"));
                int jobReturnCode = ClearUpload();

                InputFileHistory ifh = inputFileHistoryRepository.Find(x => x.Code == _inputFileHistoryCode).First();
                ifh.Status = "Cancelled";
                inputFileHistoryRepository.Update(ifh);

                //unlock the File provider for future uploads
                FileLock(false);

                return(jobReturnCode);
            }
            catch (Exception e)
            {
                if (CurrentStep != null)
                {
                    CurrentStep.Finish(false);
                }
                UnhandledException = e;
                spRunner2.PublishError("Clear Participant Data", 3, e.Message, _inputFileHistoryCode, null, null);
                //Log error to db for debug purposes.

                //unlock the File provider for future uploads
                FileLock(false);
                return(1);
            }
        }
        public override int RunJob()
        {
            try
            {
                FileLock(true);

                _deleteParticipantDataTimeout             = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("DeleteParticipantDataTimeout"));
                _deleteInputFileErrorsOver1YearOldTimeout = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("DeleteOldInputFileErrorsTimeout"));
                _deleteValidatedParticipantDataTimeout    = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("DeleteValidatedParticipantDataTimeout"));
                _copyValidatedParticipantsTimeout         = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("CopyValidatedParticipantsTimeout"));
                int jobReturnCode = ValidatedUpload(_decisionLevel);

                //unlock the File provider for future uploads
                FileLock(false);

                return(jobReturnCode);
            }
            catch (Exception e)
            {
                if (CurrentStep != null)
                {
                    CurrentStep.Finish(false);
                }
                UnhandledException = e;
                spRunner2.PublishError("Copy Valid Records", 3, e.Message, _inputFileHistoryCode, null, null);
                //Log error to db for debug purposes.

                //unlock the File provider for future uploads
                FileLock(false);
                return(1);
            }
        }
        public override int  RunJob()
        {
            try
            {
                FileLock(true);
                //Insert of the file upload history record
                InsertHistoryRecord();

                //set up timeouts for job
                _deleteParticipantDataTimeout         = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("DeleteParticipantDataTimeout"));
                _validateParticipantDuplicatesTimeout = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ValidateParticipantDuplicatesTimeout"));
                _validateAgreementRegionTimeout       = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ValidateAgreementRegionTimeout"));
                _validateParticipantPostCodeTimeout   = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ValidateParticipantPostCodeTimeout"));
                _validateLeaverTimeout                      = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ValidateLeaverTimeout"));
                _validateLeavingDateTimeout                 = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ValidateLeavingDateTimeout"));
                _validateStartDateTimeout                   = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ValidateStartDateTimeout"));
                _participantSelectValidCountTimeout         = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ParticipantSelectValidCountTimeout"));
                _participantSelectErrorCountTimeout         = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ParticipantSelectErrorCountTimeout"));
                _participantSelectWarningCountTimeout       = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ParticipantSelectWarningCountTimeout"));
                _participantSelectInformationalCountTimeout = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("ParticipantSelectInformationalCountTimeout"));
                _loadParticipantMessagesTimeout             = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("LoadParticipantMessagesTimeout"));
                _copyParticipantBulkLoadedFlatTimeout       = Convert.ToInt32(DataAccessUtilities.GetSystemParameterByName("CopyParticipantBulkLoadedFlatTimeout"));
                Guid historyFileGuid = _inputFileHistoryRow.Code;

                int jobReturnCode = UploadFile();

                //leave locked until a decision has been made
                //FileLock(false);

                return(jobReturnCode);
            }
            catch (Exception e)
            {
                if (CurrentStep != null)
                {
                    CurrentStep.Finish(false);
                }
                UnhandledException = e;
                spRunner2.PublishError("File Upload", 3, e.Message, _inputFileHistoryCode, null, null);
                //Log error to db for debug purposes.

                //unlock the File provider for future uploads
                FileLock(false);
                return(1);
            }
        }