Esempio n. 1
0
        public ActionResult Nuevo(Articulos articulos)
        {
            var category  = _contex.categorias.ToList();
            var viewmodel = new ArtiulosModelView
            {
                Articulos  = new Articulos(),
                categorias = category
            };

            return(View("Nuevo", viewmodel));
        }
Esempio n. 2
0
        public ActionResult Edit(int?id)
        {
            var articulos = _contex.articulos.SingleOrDefault(c => c.Id == id);

            if (articulos == null)
            {
                return(HttpNotFound());
            }
            var viewmodel = new ArtiulosModelView
            {
                Articulos  = articulos,
                categorias = _contex.categorias.ToList()
            };

            return(View(viewmodel));
        }