public ActionResult EditarPlatillo(PlatilloModel model)
        {
            _token = Session["Token"].ToString();
            var plat = new Platillo()
            {
                Token  = _token,
                id     = model.Id,
                nombre = model.Nombre,
                tiempo = model.Tiempo,
            };

            plat.ActualizarPlatillo(plat);
            return(RedirectToAction("VerPlatillos"));
        }
示例#2
0
        public void ActualizarPlatillo()
        {
            ObtenerToken("ADMINISTRADOR", "ASDF");
            var platillo = new Platillo()
            {
                id            = 61,
                Token         = _token,
                nombre        = "HUMITA",
                tiempo        = 25,
                ingredienteId = new List <Ingredientes>()
                {
                    new Ingredientes()
                    {
                        cantidad   = 5,
                        productoId = new Productos()
                        {
                            id          = 41,
                            nombre      = "CHOCLO",
                            descripcion = "CHOCLO AMARILLO",
                            cantidad    = 50,
                            precio      = 200,
                            categoria   = "INGREDIENTE"
                        }
                    },
                    new Ingredientes()
                    {
                        cantidad   = 3,
                        productoId = new Productos()
                        {
                            id          = 42,
                            nombre      = "CEBOLLA",
                            descripcion = "CEBOLLA TRADICIONAL",
                            cantidad    = 50,
                            precio      = 500,
                            categoria   = "INGREDIENTE"
                        }
                    }
                }
            };

            Assert.AreEqual(true, platillo.ActualizarPlatillo(platillo));
        }