Пример #1
0
        public ActionResult CrearPersona(Persona persona)
        {
            try
            {
                tablaGeneralBLL = new TablaGeneralBLLImpl();
                personaBll      = new PersonasBLLImpl();
            }
            catch (Exception)
            {
                return(View());
            }
            if (ModelState.IsValid)
            {
                personaBll.Agregar(persona);
                personaBll.SaveChanges();
                return(RedirectToAction("Index"));
            }
            PersonaViewModel personaVista = (PersonaViewModel)persona;

            ViewBag.idTipo = new SelectList(tablaGeneralBLL.Consulta("Persona", "tipo"), "idTablaGeneral", "descripcion", persona.idTipo);
            return(PartialView("Crear", personaVista));
        }
Пример #2
0
 public ActionResult Agregar(Persona persona)
 {
     personaBll.Agregar(persona);
     return(RedirectToAction("Index", "Department"));
 }