Пример #1
0
        public ActionResult Edit(Nutriologo model)
        {
            var newNutriologo = repo.LeerNutriologo(model.Correo, model.Nombre);

            if (model == null)
            {
                return(NotFound());
            }

            try
            {
                // TODO: Add update logic here

                newNutriologo.Pacientes = model.Pacientes;
                newNutriologo.Telefono  = model.Telefono;
                newNutriologo.Direccion = model.Direccion;

                var resultado = repo.ActualizarNutriologo(newNutriologo);
                System.Threading.Thread.Sleep(800);
                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
Пример #2
0
 public ActionResult Create(Nutriologo model)
 {
     try
     {
         var resultado = repo.CrearNutriologo(model);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
Пример #3
0
        // GET: Nutriologo/Create
        public ActionResult Create()
        {
            var model = new Nutriologo();

            return(View(model));
        }