예제 #1
0
파일: Basket.cs 프로젝트: datt265/C-Sharp
        /// <summary>
        /// Calculates the basket totals.
        /// </summary>
        /// <param name="customerId">The customer id.</param>
        public DataAccess.Basket CalculateBasketTotals(int customerId)
        {
            // Retrieve the basket
            DataAccess.Basket basket = _basketDal.GetBasket(customerId);

            // Get the customer name
            string customerName = _basketDal.GetCustomerName(customerId);

            // Set the customer name
            basket.CustomerName = customerName;

            // Add the shipping price to the basket.
            basket.Total += basket.ShippingPrice;

            return(basket);
        }