예제 #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string action = context.Request["action"];

            if (action == "edit")
            {
                int             count       = Convert.ToInt32(context.Request["count"]);
                int             cartId      = Convert.ToInt32(context.Request["cartId"]);
                BLL.CartManager cartManager = new BLL.CartManager();
                Model.Cart      cartModel   = cartManager.GetModel(cartId);
                cartModel.Count = count;
                cartManager.Update(cartModel);
                context.Response.Write("ok");
            }
            else if (action == "delete")
            {
                int             cartId      = Convert.ToInt32(context.Request["cartId"]);
                BLL.CartManager cartManager = new BLL.CartManager();
                cartManager.Delete(cartId);
                context.Response.Write("ok");
            }
            else
            {
                context.Response.Write("no");
            }
        }
예제 #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int cartId = Convert.ToInt32(context.Request["cartId"]);

            BLL.CartManager cartManager = new BLL.CartManager();
            cartManager.Delete(cartId);
            context.Response.Write("yes");
        }