public void GetEventCustomerswithCdPurchaseTest()
        {
            int totalRecords   = 0;
            var eventCustomers = _eventCustomerRepository.GetEventCustomerswithCdPurchase(1, 20, null, out totalRecords);

            Assert.IsNotNull(eventCustomers);
            Assert.IsNotEmpty(eventCustomers.ToList());
        }
Example #2
0
        public ListModelBase <CdImageStatusModel, CdImageStatusModelFilter> GetCdImageStatusmodel(int pageNumber, int pageSize, ModelFilterBase filter, out int totalRecords)
        {
            var eventCustomers = _eventCustomerRepository.GetEventCustomerswithCdPurchase(pageNumber, pageSize, filter as CdImageStatusModelFilter, out totalRecords);

            if (eventCustomers.IsNullOrEmpty())
            {
                return(null);
            }

            var orderShippingStatus = _orderDetailRepository.GetCdImageShippingStatusfortheEventCustomers(eventCustomers.Select(ec => ec.Id).ToArray());
            var events    = _eventRepository.GetByIds(eventCustomers.Select(ec => ec.EventId).ToArray());
            var customers = _customerRepository.GetCustomers(eventCustomers.Select(ec => ec.CustomerId).ToArray());

            return(_cdImageStatusModelFactory.Create(eventCustomers, orderShippingStatus, customers, events));
        }