Exemplo n.º 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"));
        }
Exemplo n.º 2
0
        public ActionResult AddProducto(string Nombre, string imagen, string precio)
        {
            Producto obj = new Producto();

            obj.nNombre = Nombre;
            obj.nPrecio = precio;
            obj.dImagen = imagen;
            dao.AddProducto(obj);
            ProductoXTienda obj2 = new ProductoXTienda();

            obj2.Producto        = obj;
            obj2.Tienda_idTienda = (Int32)Session["idUser"];
            obj2.tDisponibilidad = 1;
            dao.AddProductoTienda(obj2);
            return(View("AgregarProducto"));
        }