Exemplo n.º 1
0
        public JsonResult GetProduct(int Id)
        {
            var prod = productProcess.BuscarProductoPorId(Id);

            prod.art = prod.Artist.Id;
            return(Json(prod, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Items()
        {
            List <CartItem> cartItemList = new List <CartItem>();

            if (Request.Cookies["cookieCart"] != null)
            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("cookieCart");

                cartItemList = cartItemProcess.ListarItemsCarritos().Where(x => x.CartId == Convert.ToInt32(cookie.Value)).ToList();

                foreach (var item in cartItemList)
                {
                    item.Product = productProcess.BuscarProductoPorId(item.ProductId);
                }
            }
            return(Json(cartItemList, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetItems(int Id)
        {
            List <OrderDetail> Items = new List <OrderDetail>();

            Items = orderDetailProcess.ListarDetalleOrden().Where(x => x.OrderId == Id).ToList();

            foreach (OrderDetail item in Items)

            {
                var tempItem = productProcess.BuscarProductoPorId(item.ProductId);
                item.Titulo = tempItem.Title;
            }

            return(Json(Items, JsonRequestBehavior.AllowGet));
        }