コード例 #1
0
        public ActionResult OfertaProductoDetalle(long id_producto, long?id_venta)
        {
            /*var OfertaDao = new OfertaDao();
             * var oferta = OfertaDao.GetReference<IOferta>(id);
             * return View(oferta);*/
            ViewBag.valor_producto = id_producto;



            ViewBag.IdVenta = id_venta;
            ViewBag.Message = TempData["message"];

            var ProductoDao = new ProductoDao();
            var producto    = ProductoDao.GetReference <IProducto>(id_producto);


            //NHibernateUtil.Initialize(producto.Ofertas);
            //producto.CODIGO_VENTA_WEB = Convert.ToInt64(TempData["message"]);


            return(View("OfertaProductoDetalle", producto));


            //var OfertaDao = new OfertaDao();
            //var ofertas = OfertaDao.getOfertaPorProducto(id);
            //return View(ofertas);
        }
コード例 #2
0
        public JsonResult editarPublicacion(long oferta_id)
        {
            var ProductoDao = new ProductoDao();
            var producto    = ProductoDao.GetReference <IProducto>(oferta_id);

            var ofertas = new { producto.NOMBRE_PRODUCTO, producto.Ofertas.FirstOrDefault().PRECIO, producto.Ofertas.FirstOrDefault().PRECIO_OFERTA, producto.Ofertas.FirstOrDefault().PCT_DESCUENTO, producto.Ofertas.FirstOrDefault().STOCK, producto.Ofertas.FirstOrDefault().Tienda.ID_TIENDA, producto.ID_PRODUCTO, producto.Ofertas.FirstOrDefault().DETALLE, producto.Ofertas.FirstOrDefault().ID_OFERTA, producto.Ofertas.FirstOrDefault().Imagen.ID_IMAGEN };

            return(this.Json(ofertas, JsonRequestBehavior.AllowGet));
        }