Esempio n. 1
0
        /// <summary>
        /// Gets a list of VendorSpending objects.
        /// </summary>
        /// <param name="userID">String: UserID for which to retrieve VendorSpending objects.</param>
        /// <returns>IList VendorSpending objects.</returns>
        private IList <HomeViewModel.VendorSpending> GetVendorSpending(string userID)
        {
            IList <HomeViewModel.VendorSpending> vendorSpending = new List <HomeViewModel.VendorSpending>();

            foreach (var vendor in _vendorRepository.GetList(userID))
            {
                if (vendor.IsDisplayed)
                {
                    HomeViewModel.VendorSpending vendorSpendingHolder = new HomeViewModel.VendorSpending
                    {
                        Name   = vendor.Name,
                        Amount = _vendorRepository.GetAmount(vendor.VendorID, userID)
                    };

                    vendorSpending.Add(vendorSpendingHolder);
                }
            }
            return(vendorSpending);
        }