示例#1
0
        public static void BtnIncreaseOnClick(String BookID)
        {
            CustomerDAO dao = new CustomerDAO();

            String   UserID   = HttpContext.Current.Session["ID"].ToString();
            Customer customer = dao.GetCustomerByUserID(UserID);

            dao.AddNewItemToCart(customer.CustomerID, BookID);
        }
示例#2
0
        public static String AddBookToCart(String BookID)
        {
            CustomerDAO dao = new CustomerDAO();

            if (HttpContext.Current.Session["Login"] != "Khách hàng")
            {
                return("Bạn chưa đăng nhập");
            }

            String   UserID   = HttpContext.Current.Session["ID"].ToString();
            Customer customer = dao.GetCustomerByUserID(UserID);

            dao.AddNewItemToCart(customer.CustomerID, BookID);

            return(JsonConvert.SerializeObject(dao.GetCustomerByUserID(UserID).Cart));
        }