Exemple #1
0
        public ActionResult Form(int id = 0, bool readOnly = false, bool delete = false)
        {
            var usuario = new Docente();

            ViewBag.Title = "Nueva Docente";

            if (id != 0)
            {
                usuario = servicio.ObtenerDocentePorId(usuarioLogueado, id);
                if (delete)
                {
                    ViewBag.Title = "Eliminar Docente";
                }
                else
                {
                    ViewBag.Title = "Editar Docente";
                }
            }

            if (usuario == null)
            {
                return(RedirectToAction("Index"));
            }

            ViewBag.ReadOnly = readOnly;
            ViewBag.Delete   = delete;

            return(View(usuario));
        }