public IHttpActionResult Get(string filterBy, string orderBy, int?from, int?to) { try { if (!from.HasValue) { from = -1; } if (!to.HasValue) { to = -1; } if (string.IsNullOrEmpty(filterBy)) { filterBy = string.Empty; } if (string.IsNullOrEmpty(orderBy)) { orderBy = string.Empty; } NegocioPersona negocioPersona = new NegocioPersona(); return(Content(HttpStatusCode.OK, negocioPersona.Consultar(filterBy, orderBy, from.Value, to.Value))); } catch (Exception ex) { log.EscribirLogError("Error al obtener la lista de Persona", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
protected void Page_Load(object sender, EventArgs e) { try { NegocioPersona negocioPersona = new NegocioPersona(); Personas = negocioPersona.ListarPersonas(); } catch (Exception ex) { throw ex; } }
public IHttpActionResult Put([FromBody] Persona persona) { try { NegocioPersona negocioPersona = new NegocioPersona(); return(Content(HttpStatusCode.OK, negocioPersona.Actualizar(persona))); } catch (Exception ex) { log.EscribirLogError("Error al actualizar Persona", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
public IHttpActionResult GetById(string tipoIdentificacion, string identificacion) { try { NegocioPersona negocioPersona = new NegocioPersona(); return(Content(HttpStatusCode.OK, negocioPersona.ConsultarPorId(tipoIdentificacion, identificacion))); } catch (Exception ex) { log.EscribirLogError("Error al obtener el centro Centro", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
public IHttpActionResult Delete(string tipoIdentificacion, string identificacion) { try { NegocioPersona negocioPersona = new NegocioPersona(); return(Content(HttpStatusCode.OK, negocioPersona.Eliminar(tipoIdentificacion, identificacion))); } catch (Exception ex) { log.EscribirLogError("Error al eliminar Persona", ex); return(Content(HttpStatusCode.InternalServerError, Mensajes.DescFallo)); } }
protected void ValidarPersona_Click(object sender, EventArgs e) { try { NegocioPersona negocioPersona = new NegocioPersona(); //var code = CodigoPersona.Value; //Persona voucher = negocioPersona.BuscarPersonas(code); //if (voucher.Code != null) //{ // Response.Redirect("/frmIncripcion.aspx"); //} //else //{ // Response.Redirect("/Default.aspx"); //} } catch (Exception ex) { throw ex; } }