Exemplo n.º 1
0
        public CounterpartyOrderViewModel(Counterparty client,
                                          IUnitOfWorkFactory unitOfWorkFactory,
                                          ITdiCompatibilityNavigation tdinavigation,
                                          RouteListRepository routedListRepository,
                                          MangoManager mangoManager,
                                          int count = 5)
            : base()
        {
            this.Client               = client;
            this.tdiNavigation        = tdinavigation;
            this.routedListRepository = routedListRepository;
            this.MangoManager         = mangoManager;
            UoW = unitOfWorkFactory.CreateWithoutRoot();
            OrderSingletonRepository orderRepos = OrderSingletonRepository.GetInstance();

            LatestOrder = orderRepos.GetLatestOrdersForCounterparty(UoW, client, count).ToList();

            RefreshOrders = _RefreshOrders;
            NotifyConfiguration.Instance.BatchSubscribe(_RefreshCounterparty)
            .IfEntity <Counterparty>()
            .AndWhere(c => c.Id == client.Id)
            .Or.IfEntity <DeliveryPoint>()
            .AndWhere(d => client.DeliveryPoints.Any(cd => cd.Id == d.Id));
        }