// DELETE api/values/5 public HttpResponseMessage Delete(string tipoTarjeta, string tipoProcesador, [FromBody] ProcesadorTarjeta procesadorTarjeta) { if (procesadorTarjeta.eliminarProcesadorTarjeta(tipoTarjeta, tipoProcesador)) { var message = string.Format("Se eliminó la tarjeta del procesador con éxito"); return(Request.CreateResponse(HttpStatusCode.OK, message)); } else { var message = string.Format("No se eliminó la tarjeta del procesador, verifique los datos."); return(Request.CreateResponse(HttpStatusCode.NotAcceptable, message)); } }
// POST api/values public HttpResponseMessage Post([FromBody] ProcesadorTarjeta procesadorTarjeta) { if (procesadorTarjeta.agregarProcesadorTarjeta("Insertar")) { var message = string.Format(" Se guardó la tarjeta en el procesador"); return(Request.CreateResponse(HttpStatusCode.OK, message)); } else { var message = string.Format("No se guardó la tarjeta en el procesador, verifique los datos."); return(Request.CreateResponse(HttpStatusCode.NotAcceptable, message)); } }