Example #1
0
        async Task CycleProprietari(string fileName, MemoryStream stream)
        {
            var judeteAllInclussive = new ConcurrentBag <Judet>(context.Judete.Include(z => z.UATs).ThenInclude(w => w.Localitati));

            var x = await Importer.GetDTOs <OutputProprietarAdresa>(stream, fileName, new ImportConfig(), excelConfiguration);

            IAddressParser addressParser  = (IAddressParser)serviceBuilder.GetService("AddressParser");
            var            addressMatcher = (IMatcher)serviceBuilder.GetService("AddressMatcher");
            var            matchProcessor = (IMatchProcessor)serviceBuilder.GetService("AddressMatchProcessor");

            object locker = new object();

            Parallel.ForEach(x, y =>
            {
                var z = new Proprietar();

                lock (locker)
                {
                    context.Proprietari.Add(z);
                }

                z.FromDTO(y);
                z.Adresa.FromDTO(y, judeteAllInclussive, addressParser, addressMatcher, matchProcessor);
                z.Adresa.Intravilan = true;
            });
        }
Example #2
0
        public WalletService(
            ICqrsEngine cqrsEngine,
            IBlockchainWalletsRepository walletRepository,
            IBlockchainSignFacadeClient blockchainSignFacadeClient,
            IAddressParser addressParser,
            IFirstGenerationBlockchainWalletRepository firstGenerationBlockchainWalletRepository,
            IAssetsServiceWithCache assetsServiceWithCache,
            IBlockchainExtensionsService blockchainExtensionsService,
            IAddressService addressService,
            ILegacyWalletService legacyWalletService,
            ILogFactory logFactory)
        {
            _cqrsEngine                 = cqrsEngine ?? throw new ArgumentNullException(nameof(cqrsEngine));
            _walletRepository           = walletRepository ?? throw new ArgumentNullException(nameof(walletRepository));
            _blockchainSignFacadeClient = blockchainSignFacadeClient ??
                                          throw new ArgumentNullException(nameof(blockchainSignFacadeClient));
            _addressParser = addressParser ?? throw new ArgumentNullException(nameof(addressParser));
            _firstGenerationBlockchainWalletRepository = firstGenerationBlockchainWalletRepository ??
                                                         throw new ArgumentNullException(
                                                                   nameof(firstGenerationBlockchainWalletRepository));
            _assetsServiceWithCache =
                assetsServiceWithCache ?? throw new ArgumentNullException(nameof(assetsServiceWithCache));
            _blockchainExtensionsService = blockchainExtensionsService ?? throw new ArgumentNullException(nameof(blockchainExtensionsService));
            _addressService      = addressService ?? throw new ArgumentNullException(nameof(addressService));
            _legacyWalletService = legacyWalletService ?? throw new ArgumentNullException(nameof(legacyWalletService));

            if (logFactory == null)
            {
                throw new ArgumentNullException(nameof(logFactory));
            }
            _log = logFactory.CreateLog(this);
        }
 public Initech850Parser(IAddressParser addressParser, IEDIResponseReferenceRecorder recorder, IGeneric850Parser genericParser, IInitech850LineParser lineParser)
 {
     _addrParser = addressParser;
     _lineParser = lineParser;
     _recorder = recorder;
     _genericParser = genericParser;
 }
        public void can_extract_addresses()
        {
            ObjectFactory.Initialize(x =>
                                         {
                                             x.For<IAddressParser>().Use<AddressParser>();
                                         });

            _aparse = ObjectFactory.GetInstance<IAddressParser>();
            var order = new OrderRequestReceivedMessage { Customer = new Customer { CustomerIDs = new CustomerAliases() { LegacyCustomerID = "Fedex" }, CustomerName = "Fedex" } };
            var lst = new List<Segment>
                          {
                              new Segment {Contents = "N1*ST*EPS LOADING DOCK*92*SUSA", Label = "N1".GetSegmentLabel()},
                              new Segment {Contents = "N3*12825 FLUSHING MEADOWS DR FL 2*STE 280", Label = "N3".GetSegmentLabel()},
                              new Segment {Contents = "N3*Third Floor*", Label = "N3".GetSegmentLabel()},
                              new Segment {Contents = "N3*Next to the bank*", Label = "N3".GetSegmentLabel()},
                              new Segment {Contents = "N4*SAINT LOUIS*MO*638592*US", Label = "N4".GetSegmentLabel()},
                              new Segment {Contents = "N1*BT*EPS SETTLEMENTS GROUP*92*SUSA", Label = "N1".GetSegmentLabel()},
                              new Segment {Contents = "N3*12825 FLUSHING MEADOWS DR FL 2*STE 280", Label = "N3".GetSegmentLabel()},
                              new Segment {Contents = "N3*Third Floor*", Label = "N3".GetSegmentLabel()},
                              new Segment {Contents = "N3*Next to the bank*", Label = "N3".GetSegmentLabel()},
                              new Segment {Contents = "N4*SAINT LOUIS*MO*638592*US", Label = "N4".GetSegmentLabel()},
                              new Segment {Contents = "SE*16*0001~", Label = SegmentLabel.DocumentClose}
                          };
            _aparse.ProcessAddresses(lst, order);

            Assert.That(order.ShipToAddress.AddressName == "EPS LOADING DOCK");

            Assert.That(order.Customer.BillToAddress.AddressName == "EPS SETTLEMENTS GROUP");
        }
Example #5
0
 public Initech850Parser(IAddressParser addressParser, IEDIResponseReferenceRecorder recorder, IGeneric850Parser genericParser, IInitech850LineParser lineParser)
 {
     _addrParser    = addressParser;
     _lineParser    = lineParser;
     _recorder      = recorder;
     _genericParser = genericParser;
 }
Example #6
0
        public void can_extract_addresses()
        {
            ObjectFactory.Initialize(x =>
            {
                x.For <IAddressParser>().Use <AddressParser>();
            });

            _aparse = ObjectFactory.GetInstance <IAddressParser>();
            var order = new OrderRequestReceivedMessage {
                Customer = new Customer {
                    CustomerIDs = new CustomerAliases()
                    {
                        LegacyCustomerID = "Initech"
                    }, CustomerName = "Initech"
                }
            };
            var lst = new List <Segment>
            {
                new Segment {
                    Contents = "N1*ST*EPS LOADING DOCK*92*SUSA", Label = "N1".GetSegmentLabel()
                },
                new Segment {
                    Contents = "N3*12825 FLUSHING MEADOWS DR FL 2*STE 280", Label = "N3".GetSegmentLabel()
                },
                new Segment {
                    Contents = "N3*Third Floor*", Label = "N3".GetSegmentLabel()
                },
                new Segment {
                    Contents = "N3*Next to the bank*", Label = "N3".GetSegmentLabel()
                },
                new Segment {
                    Contents = "N4*SAINT LOUIS*MO*638592*US", Label = "N4".GetSegmentLabel()
                },
                new Segment {
                    Contents = "N1*BT*EPS SETTLEMENTS GROUP*92*SUSA", Label = "N1".GetSegmentLabel()
                },
                new Segment {
                    Contents = "N3*12825 FLUSHING MEADOWS DR FL 2*STE 280", Label = "N3".GetSegmentLabel()
                },
                new Segment {
                    Contents = "N3*Third Floor*", Label = "N3".GetSegmentLabel()
                },
                new Segment {
                    Contents = "N3*Next to the bank*", Label = "N3".GetSegmentLabel()
                },
                new Segment {
                    Contents = "N4*SAINT LOUIS*MO*638592*US", Label = "N4".GetSegmentLabel()
                },
                new Segment {
                    Contents = "SE*16*0001~", Label = SegmentLabel.DocumentClose
                }
            };

            _aparse.ProcessAddresses(lst, order);

            Assert.That(order.ShipToAddress.AddressName == "EPS LOADING DOCK");

            Assert.That(order.Customer.BillToAddress.AddressName == "EPS SETTLEMENTS GROUP");
        }
Example #7
0
 protected Generic860Parser(IAddressParser addressParser, IPOLineParser lineParser,
                            IEDIResponseReferenceRecorder recorder,
                            ISegmentExtractor segmentExtractor)
     : base(recorder)
 {
     _lineParser       = lineParser;
     _segmentExtractor = segmentExtractor;
 }
Example #8
0
 public ServiceBuilder(string contentRootPath)
 {
     adresaMatcher             = new Matcher(SarateniInit);
     addressParser             = new AddressParser();
     combosIndexMatchProcessor = new combosIndexMatchProcessor();
     combosIndexMatcher        = new Matcher(CadGenCombosInit);
     DXFRepo   = new FileRepo(contentRootPath, "DXF", "*.dxf");
     ExcelRepo = new FileRepo(contentRootPath, "Excel", "*.xls");
 }
Example #9
0
    public AddressParserTests()
    {
        var services = new ServiceCollection();

        services.AddAddressParser();

        var sp = services.BuildServiceProvider();

        _parser = sp.GetRequiredService <IAddressParser>();
    }
 public PvaAddressLookup(ILogger <PvaAddressLookup> logger,
                         IAddressRepository addressRepository,
                         PvaSettings settings,
                         IAddressParser addressParser)
 {
     _logger            = logger;
     _addressRepository = addressRepository;
     _settings          = settings;
     _addressParser     = addressParser;
 }
 public AddressController(
     IAddressService addressService,
     IBlockchainIntegrationService blockchainIntegrationService,
     IBlockchainExtensionsService blockchainExtensionsService,
     IAddressParser addressParser)
 {
     _addressService = addressService;
     _blockchainIntegrationService = blockchainIntegrationService;
     _blockchainExtensionsService  = blockchainExtensionsService;
     _addressParser = addressParser;
 }
Example #12
0
 public GenericDocParser(IAddressParser addressParser, string doc_id)
 {
     _doc_id     = doc_id;
     _addrParser = addressParser;
 }
Example #13
0
 public LetterPrinter(IAddressParser parser, TextWriter writer)
 {
     this.parser = parser;
     this.writer = writer;
 }
 public void RegisterAddressParser(IAddressParser addressHandler)
 {
     _addressParsers.Add(addressHandler);
 }
Example #15
0
        public static void FromDTO(this Adresa adresa, OutputProprietarAdresa adresaDTO, IEnumerable <Judet> judeteAllInclussive, IAddressParser parser, IMatcher addressMatcher, IMatchProcessor matchProcessor)
        {
            var localitate = LocalitateFromDTO(adresaDTO.Judet, adresaDTO.Localitate, judeteAllInclussive);

            if (localitate != null)
            {
                adresa.SIRSUP = localitate.UAT.SIRUTA;
                adresa.SIRUTA = localitate.SIRUTA;
            }

            if (string.IsNullOrEmpty(adresaDTO.Adresa))
            {
                adresa.AdresaNecunoscuta = true;
            }
            else
            {
                parser.Parse(adresa, adresaDTO.Adresa, addressMatcher, matchProcessor);
            }

            adresa.AdresaImport     = adresaDTO.Adresa;
            adresa.JudetImport      = adresaDTO.Judet;
            adresa.LocalitateImport = adresaDTO.Localitate;
        }
 public void RegisterAddressParser(IAddressParser addressHandler)
 {
     _addressParsers.Add(addressHandler);
 }
 public Generic850Parser(IAddressParser addressParser, IPOLineParser lineParser)
     : base(addressParser, "850")
 {
     _lineParser = lineParser;
 }
Example #18
0
 public Generic850Parser(IAddressParser addressParser, IPOLineParser lineParser) : base(addressParser, "850")
 {
     _lineParser = lineParser;
 }