public ActionResult Edit(int?id) { if (!IApp.UsuarioSesion.IdUsuario.HasValue) { return(Redirect("/Login")); } var entity = new EmpleadoEdit() { empleado = new EmpleadoEntity() }; try { ViewBag.Form = false; if (id.HasValue) { ViewBag.Form = true; entity.empleado = EmpleadoService.ObtenerDetalle(id); } entity.ddlTipoIdentificacion = TipoIdentificacionService.Obtenerddl(); entity.ddlEmpresa = EmpresaService.Obtenerddl(); } catch (Exception ex) { return(Content(ex.Message)); } return(View(entity)); }
public ActionResult Edit(int?id) { this.SessionOnline(); var entity = new EmpleadoEdit() { empleado = new EmpleadoEntity() }; try { ViewBag.Form = false; if (id.HasValue) { //editar ViewBag.Form = true; entity.empleado = EmpleadoService.ObtenerDetalle(id); } //entity.ddlPuestos = puestosService.Obtenerddl(); //entity.ddlContratos = tiposContratos.Obtenerddl(id); } catch (Exception ex) { return(Content(ex.Message)); } return(View(entity)); }