public DeliveryPointViewModel GetForOpenDeliveryPointViewModel(int id)
        {
            var controller = new NomenclatureFixedPriceController(
                new NomenclatureFixedPriceFactory(),
                new WaterFixedPricesGenerator(
                    new NomenclatureRepository(
                        new NomenclatureParametersProvider(
                            new ParametersProvider()))));

            var dpViewModel = new DeliveryPointViewModel(
                new UserRepository(),
                new GtkTabsOpener(),
                new PhoneRepository(),
                ContactParametersProvider.Instance,
                new CitiesDataLoader(OsmWorker.GetOsmService()),
                new StreetsDataLoader(OsmWorker.GetOsmService()),
                new HousesDataLoader(OsmWorker.GetOsmService()),
                new NomenclatureSelectorFactory(),
                controller,
                new DeliveryPointRepository(),
                new DeliveryScheduleSelectorFactory(),
                EntityUoWBuilder.ForOpen(id),
                UnitOfWorkFactory.GetDefaultFactory,
                ServicesConfig.CommonServices);

            return(dpViewModel);
        }
예제 #2
0
 private List <OsmCity> GetOsmCities(string searchString, int limit, CancellationToken token)
 {
     try
     {
         Task.Delay(Delay, token).Wait();
         logger.Info($"Запрос городов... Строка поиска : {searchString} , Кол-во записей {limit}");
         return(OsmWorker.GetOsmService().GetCitiesByCriteria(searchString, limit));
     }
     catch (AggregateException ae)
     {
         ae.Handle(ex =>
         {
             if (ex is TaskCanceledException)
             {
                 logger.Info("Запрос городов отменен");
             }
             return(ex is TaskCanceledException);
         });
         return(new List <OsmCity>());
     }
 }