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)); }
public ActionResult Agregar(Persona persona) { personaBll.Agregar(persona); return(RedirectToAction("Index", "Department")); }