public async Task <IHttpActionResult> EnviarQR(LlaveQR llave) { try { var mng = new LlaveQRManager(); LlaveQR c = null; c = mng.RetrieveById(llave); if (c != null) { await EnviarCorreoManager.GetInstance().ExecuteCorreoCodigoQR(llave.IdUsuario, llave); apiResp = new ApiResponse(); apiResp.Message = "Llave enviada, Por favor verifique el correo electrónico"; } else { throw new BussinessException(52); } } catch (BussinessException bex) { return(InternalServerError(new Exception(bex.AppMessage.Message))); } return(Ok(apiResp)); }
public IHttpActionResult Get(string id) { try { var mng = new LlaveQRManager(); var QR = new LlaveQR { CodigoQR = id }; QR = mng.RetrieveById(QR); apiResp = new ApiResponse(); apiResp.Data = QR; return(Ok(apiResp)); } catch (BussinessException bex) { return(InternalServerError(new Exception(bex.AppMessage.Message))); } }