Example #1
0
        private IEnumerable <OrderBriefInfoDto> RetrieveInProcessOrders()
        {
            IEnumerable <OrderBriefInfoDto> instances = new List <OrderBriefInfoDto>();

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

            return(instances);
        }