예제 #1
0
        // POST: SearchProducto/AddList
        public ActionResult AddFav(string img, string nmbre, string pr)
        {
            Random rn = new Random();
            // TODO: Add insert logic here
            Producto objP = new Producto();

            objP.nNombre = nmbre;
            objP.nPrecio = pr;
            objP.dImagen = img;
            dao.AddProducto(objP);
            var g = objP.idProducto;
            //Ingresamos a favoritos

            ListaFavoritoProducto fav = new ListaFavoritoProducto();

            fav.idProducto = g;
            fav.idUsuario  = (int)Session["idUser"];
            dao.AddRitoProducto(fav);
            return(RedirectToAction("Index", "Home"));
        }