P1_TrevorGraham/MvcStoreApplication/BusinessLogic/BusinessLogic.cs
/// <summary>
/// returns order viewmodels for every order in the db for the currently logged in user
/// </summary>
/// <returns></returns>
returns order viewmodels for every order in the db for the currently logged in user
returns order viewmodels for every order in the db for the currently logged in user
public List<OrderViewModel> GetAllOrderViewModels()
        {
            if (!CurrentUserIsCustomer()) { return null; }
            var orders = _repository.GetAllCustomerOrders((Guid)SessionGetCurrentUser());
            var viewModels = new List<OrderViewModel>();
            foreach (Order order in orders)
            {
                var viewModel = GetOrderViewModel(order.OrderId);
                viewModels.Add(viewModel);
            }
            return viewModels;
        }
public List < OrderViewModel > GetAllOrderViewModels ( ) { if ( ! CurrentUserIsCustomer ( ) ) { return null ; } var orders = _repository . GetAllCustomerOrders ( ( Guid ) SessionGetCurrentUser ( ) ) ; var viewModels = new List < OrderViewModel > ( ) ; foreach ( Order order in orders ) { var viewModel = GetOrderViewModel ( order . OrderId ) ; viewModels . Add ( viewModel ) ; } return viewModels ; }
returns order viewmodels for every order in the db for the currently logged in user
returns order viewmodels for every order in the db for the currently logged in user
None