Пример #1
0
        public IEnumerable <OrderDetailCustomerLocationItem> GetCustomerLocations(int customerId)
        {
            var result = _customerLocationRepository
                         .FindAll(x => x.CustomerId == customerId)
                         .Select(location => new OrderDetailCustomerLocationItem
            {
                CustomerLocationId   = location.Id,
                CustomerLocationName = location.Name
            });

            return(result);
        }
Пример #2
0
        public List <CheckBoxItem> GetCustomerLocations(int?customerId)
        {
            if (!customerId.HasValue)
            {
                return(new List <CheckBoxItem>());
            }

            var result = _customerLocationRepository
                         .FindAll(x => x.CustomerId == customerId.Value)
                         .Select(customer => new CheckBoxItem
            {
                Id         = customer.Id,
                Name       = customer.Name,
                IsSelected = false,
            })
                         .ToList();

            return(result);
        }