Пример #1
0
        public static void CleanupRequestData(string guidName, IDipsDbContext dbContext)
        {
            try
            {
                Log.Debug("Deleting database entries for request {@guidName}", guidName);

                var requests = dbContext.DipsRequest.Where(b => b.guid_name == guidName).ToList();

                foreach (var request in requests.Select(b => dbContext.Entry(b)))
                {
                    request.Reload();
                    request.State = EntityState.Deleted;
                }

                dbContext.SaveChanges();

                Log.Debug("Deleted database entries for request {@guidName}", guidName);
            }
            catch (Exception ex)
            {
                Log.Debug(ex, "Could not delete database entries for request {@guidName}", guidName);

                throw;
            }
        }
Пример #2
0
        public static void CleanupBatchData(string batchNumber, IDipsDbContext dbContext)
        {
            try
            {
                Log.Debug("Deleting database entries for batch {@batch}", batchNumber);

                var batches = dbContext.Queues.Where(b => b.S_BATCH == batchNumber).ToList();
                var vouchers = dbContext.NabChqPods.Where(v => v.S_BATCH == batchNumber);
                var indexes = dbContext.DbIndexes.Where(i => i.BATCH == batchNumber);

                foreach (var entry in batches.Select(b => dbContext.Entry(b)))
                {
                    entry.Reload();
                    entry.State = EntityState.Deleted;
                }
                foreach (var v in vouchers)
                {
                    dbContext.Entry(v).State = EntityState.Deleted;
                }
                foreach (var i in indexes)
                {
                    dbContext.Entry(i).State = EntityState.Deleted;
                }

                dbContext.SaveChanges();

                Log.Debug("Deleted database entries for batch {@batch}", batchNumber);
            }
            catch (Exception ex)
            {
                Log.Debug(ex, "Could not delete database entries for batch {@batch}", batchNumber);

                throw;
            }
        }
 public ValidateTransactionResponsePollingJob(
     ILifetimeScope component,
     IExchangePublisher<ValidateBatchTransactionResponse> responseExchange,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component = component;
     this.dbContext = dbContext;
     this.responseExchange = responseExchange;
     this.adapterConfiguration = adapterConfiguration;
 }
 public GetVouchersInformationRequestPollingJob(
     ILifetimeScope component,
     IExchangePublisher<GetVouchersInformationRequest> requestExchange,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component = component;
     this.dbContext = dbContext;
     this.requestExchange = requestExchange;
     this.adapterConfiguration = adapterConfiguration;
 }
 public GenerateCorrespondingVoucherResponsePollingJob(
     ILifetimeScope component,
     IExchangePublisher<GenerateCorrespondingVoucherResponse> responseExchange,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component = component;
     this.dbContext = dbContext;
     this.responseExchange = responseExchange;
     this.adapterConfiguration = adapterConfiguration;
 }
 public CorrectCodelineResponsePollingJob(
     ILifetimeScope component,
     IExchangePublisher<CorrectBatchCodelineResponse> responseExchange,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component = component;
     this.dbContext = dbContext;
     this.responseExchange = responseExchange;
     this.adapterConfiguration = adapterConfiguration;
 }
 public ValidateTransactionResponsePollingJob(
     ILifetimeScope component,
     IExchangePublisher <ValidateBatchTransactionResponse> responseExchange,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component            = component;
     this.dbContext            = dbContext;
     this.responseExchange     = responseExchange;
     this.adapterConfiguration = adapterConfiguration;
 }
 public CheckThirdPartyResponsePollingJob(
     ILifetimeScope component,
     IExchangePublisher<CheckThirdPartyBatchResponse> responseExchange,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component = component;
     this.dbContext = dbContext;
     this.responseExchange = responseExchange;
     this.adapterConfiguration = adapterConfiguration;
 }
Пример #9
0
 public GenerateCorrespondingVoucherResponsePollingJob(
     ILifetimeScope component,
     IExchangePublisher <GenerateCorrespondingVoucherResponse> responseExchange,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component            = component;
     this.dbContext            = dbContext;
     this.responseExchange     = responseExchange;
     this.adapterConfiguration = adapterConfiguration;
 }
 public ValidateTransactionRequestProcessor(
     ILifetimeScope component,
     IMapper <ValidateBatchTransactionRequest, DipsQueue> dipsQueueMapper,
     IMapper <ValidateBatchTransactionRequest, IEnumerable <DipsNabChq> > dipsVoucherMapper,
     IMapper <ValidateBatchTransactionRequest, IEnumerable <DipsDbIndex> > dipsDbIndexMapper,
     IDipsDbContext dbContext = null)
 {
     this.component         = component;
     this.dbContext         = dbContext;
     this.dipsQueueMapper   = dipsQueueMapper;
     this.dipsVoucherMapper = dipsVoucherMapper;
     this.dipsDbIndexMapper = dipsDbIndexMapper;
 }
Пример #11
0
 public GenerateCorrespondingVoucherRequestProcessor(
     ILifetimeScope component,
     IMapper <GenerateCorrespondingVoucherRequest, DipsQueue> dipsQueueMapper,
     IMapper <GenerateCorrespondingVoucherRequest, IEnumerable <DipsNabChq> > dipsVoucherMapper,
     IMapper <GenerateCorrespondingVoucherRequest, IEnumerable <DipsDbIndex> > dipsDbIndexMapper,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component            = component;
     this.dbContext            = dbContext;
     this.dipsQueueMapper      = dipsQueueMapper;
     this.dipsVoucherMapper    = dipsVoucherMapper;
     this.dipsDbIndexMapper    = dipsDbIndexMapper;
     this.adapterConfiguration = adapterConfiguration;
 }
 public CheckThirdPartyRequestProcessor(
     ILifetimeScope component,
     IMapper <CheckThirdPartyBatchRequest, DipsQueue> dipsQueueMapper,
     IMapper <CheckThirdPartyBatchRequest, IEnumerable <DipsNabChq> > dipsVoucherMapper,
     IMapper <CheckThirdPartyBatchRequest, IEnumerable <DipsDbIndex> > dipsDbIndexMapper,
     IImageMergeHelper imageMergeHelper,
     IDipsDbContext dbContext = null)
 {
     this.component         = component;
     this.dbContext         = dbContext;
     this.dipsQueueMapper   = dipsQueueMapper;
     this.dipsVoucherMapper = dipsVoucherMapper;
     this.dipsDbIndexMapper = dipsDbIndexMapper;
     this.imageMergeHelper  = imageMergeHelper;
 }
Пример #13
0
 public CorrectCodelineRequestProcessor(
     ILifetimeScope component,
     IMapper <CorrectBatchCodelineRequest, DipsQueue> dipsQueueMapper,
     IMapper <CorrectBatchCodelineRequest, IEnumerable <DipsNabChq> > dipsVoucherMapper,
     IMapper <CorrectBatchCodelineRequest, IEnumerable <DipsDbIndex> > dipsDbIndexMapper,
     IImageMergeHelper imageMergeHelper,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component            = component;
     this.dbContext            = dbContext;
     this.dipsQueueMapper      = dipsQueueMapper;
     this.dipsVoucherMapper    = dipsVoucherMapper;
     this.dipsDbIndexMapper    = dipsDbIndexMapper;
     this.imageMergeHelper     = imageMergeHelper;
     this.adapterConfiguration = adapterConfiguration;
 }
 public GenerateBulkCreditRequestProcessor(
     ILifetimeScope component,
     IMapper <VoucherInformation[], DipsQueue> dipsQueueMapper,
     IMapper <VoucherInformation[], IEnumerable <DipsNabChq> > dipsVoucherMapper,
     IMapper <VoucherInformation[], IEnumerable <DipsDbIndex> > dipsDbIndexMapper,
     IScannedBatchHelper scannedBatchHelper,
     IAdapterConfiguration adapterConfiguration,
     IDipsDbContext dbContext = null)
 {
     this.component            = component;
     this.dbContext            = dbContext;
     this.dipsQueueMapper      = dipsQueueMapper;
     this.dipsVoucherMapper    = dipsVoucherMapper;
     this.dipsDbIndexMapper    = dipsDbIndexMapper;
     this.scannedBatchHelper   = scannedBatchHelper;
     this.adapterConfiguration = adapterConfiguration;
 }