public List <Order> GetOpenOrdersByCompany(Company company)
        {
            if (company == null)
            {
                throw new ArgumentNullException(nameof(company));
            }

            return(ExecuteFaultHandledOperation(() =>
            {
                var order_headers = new List <Order>();
                var comp = new CompanyData()
                {
                    CompanyKey = company.CompanyKey
                };
                var orders_data = _order_header_repo.GetAllOpen(comp);

                foreach (var order_data in orders_data)
                {
                    var order_header = Map(order_data);
                    order_header.Account = _account_be.GetAccountByID(order_header.AccountKey, false);
                    order_headers.Add(order_header);
                }
                return order_headers;
            }));
        }
コード例 #2
0
 public Task <List <Order> > GetOpenOrdersAsync(int companyKey)
 {
     return(Task.Factory.StartNew(() => {
         return _orderEntityService.Map(_orderRepository.GetAllOpen(companyKey));
     }));
 }