Exemplo n.º 1
0
 private void RetrieveCart()
 {
     if (Session["Cart"] == null)
     {
         cart = new ShoppingCart();
         PersistCart(cart);
     }
     else
     {
         using (manager = new ShoppingCartManager())
         {
             cart = (ShoppingCart)Session["Cart"];
             if (cart != null)
             {
                 cart.ITEM_PRICE = manager.CalculateTotal(cart.Items);
                 cart.SalesTax   = Math.Round(manager.CalculateSalesTax(cart.ITEM_PRICE), 2);
                 cart.Cost       = Math.Round(cart.ITEM_PRICE + cart.SalesTax, 2);
             }
         }
     }
 }