Exemplo n.º 1
0
        private IEnumerable <OrderBriefInfoDto> RetrieveNewOrders()
        {
            IEnumerable <OrderBriefInfoDto> instances = new List <OrderBriefInfoDto>();

            using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
            {
                OrderFacade facade = new OrderFacade(uow);
                if (CurrentUserContext.IsSuperAdmin)
                {
                    instances = facade.RetrieveOrdersByStatus(OrderStatuses.Open, new OrderBriefInfoConverter());
                }
                else if (CurrentUserContext.IsSupplier)
                {
                    instances = facade.RetrieveOrdersBySupplierAndStatus(CurrentUserContext.User.MatchId, OrderStatuses.Open, new OrderBriefInfoConverter());
                }
            }
            return(instances);
        }