protected BatchAccessor(IObservableGroup observableGroup, IComponentDatabase componentDatabase, IBatchBuilder batchBuilder, IComponentTypeLookup componentTypeLookup) { ObservableGroup = observableGroup; ComponentDatabase = componentDatabase; BatchBuilder = batchBuilder; ComponentTypeLookup = componentTypeLookup; SetupAccessor(); }
public void BuildBatch(IBatchBuilder batchBuilder, string filePath) { using (StreamReader reader = new StreamReader(filePath)) { string line = null; PaymentRequest paymentRequest = null; while ((line = reader.ReadLine()) != null) { var lineValues = line.Split('^'); var currentLineType = lineValues[0]; switch (currentLineType) { case "B": batchBuilder.AddHeader(lineValues); break; case "H": paymentRequest = batchBuilder.CreatePaymentRequest(); paymentRequest.AddHeader(lineValues); batchBuilder.AddPaymentRequest(paymentRequest); break; case "L": InvoiceLine invoiceLine = batchBuilder.CreateInvoiceLine(); invoiceLine.AddValues(lineValues); paymentRequest.AddInvoiceLine(invoiceLine); break; default: break; } } } }
protected BatchedSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IBatchBuilderFactory batchBuilderFactory, IThreadHandler threadHandler) : base(componentDatabase, componentTypeLookup, threadHandler) { _batchBuilder = batchBuilderFactory.Create <T1, T2>(); }
public ReferenceBatchAccessor(IObservableGroup observableGroup, IComponentDatabase componentDatabase, IBatchBuilder batchBuilder, IComponentTypeLookup componentTypeLookup) : base(observableGroup, componentDatabase, batchBuilder, componentTypeLookup) { }