예제 #1
0
        public void BuscarPlatillo()
        {
            ObtenerToken("ADMINISTRADOR", "ASDF");
            var platillo = new Platillo()
            {
                Token = _token
            };

            platillo = platillo.ObtenerPlatillo(61);
            Assert.AreEqual(true, platillo != null);
        }
예제 #2
0
        public void ObtenerIingredientes()
        {
            ObtenerToken("ADMINISTRADOR", "ASDF");
            var platillo = new Platillo()
            {
                Token = _token
            };
            var ingredientes = platillo.ObtenerPlatillo(1).ingredienteId;

            Assert.IsNotNull(ingredientes);
        }
예제 #3
0
        public ActionResult VerDetalles(int id)
        {
            _token = Session["Token"].ToString();
            if (string.IsNullOrEmpty(_token))
            {
                RedirectToAction("Index", "Home");
            }
            var plat = new Platillo()
            {
                Token = _token
            };
            var ingredientes = plat.ObtenerPlatillo(id).ingredienteId;

            ViewData["Detalles"] = ingredientes;
            return(View());
        }
예제 #4
0
        public ActionResult EditarPlatillo(int id)
        {
            if (string.IsNullOrEmpty(_token))
            {
                RedirectToAction("Index", "Home");
            }
            _token = Session["Token"].ToString();
            var plat = new Platillo()
            {
                Token = _token
            };

            plat = plat.ObtenerPlatillo(id);
            PlatilloModel model = new PlatilloModel
            {
                Id     = plat.id,
                Nombre = plat.nombre,
                Tiempo = plat.tiempo,
            };

            return(View(model));
        }