Exemplo n.º 1
0
        public static int AddBookToCart(CartModel cart, BookOrderModel book)
        {
            int bookcount = CartDAL.SelectBookCountInCart(cart, book);

            if (bookcount > 0)
            {
                book.quantity += CartDAL.SelectBookQuantityInCart(cart, book);
                if (book.quantity > 99)
                {
                    book.quantity = 99;
                }
                return(CartDAL.UpdateBookInCart(cart, book));
            }
            else
            {
                return(CartDAL.InsertBookToCart(cart, book));
            }
        }