public List <Tarjeta> GetData() { TarjetaManager bm = new TarjetaManager(); var Ret = bm.GetTarjetas(); return(Ret); }
public IHttpActionResult ListCardsByUser(string userMail) { try { var mng = new TarjetaManager(); _apiResponse = new ApiResponse(); _apiResponse.Data = mng.GeTarjetasByUser(userMail); _apiResponse.Message = "Execution Success"; return(Ok(_apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
public IHttpActionResult GetCardByUniqueCode(string uniqueCode) { try { var mng = new TarjetaManager(); _apiResponse = new ApiResponse(); _apiResponse.Data = mng.GeTarjetaByUniquecode(uniqueCode); _apiResponse.Message = "Execution Success"; return(Ok(_apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
public IHttpActionResult AprobarReposicion(Tarjeta card) { try { var mng = new TarjetaManager(); mng.AprobarReposicion(card); _apiResponse = new ApiResponse(); _apiResponse.Message = "Tarjeta repuesta"; return(Ok(_apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
public IHttpActionResult InitializeCard(Tarjeta card) { try { var mng = new TarjetaManager(); mng.InitializeCard(card); _apiResponse = new ApiResponse(); _apiResponse.Message = "Se ha enviado un correo a " + card.Usuario.Email + " con el link de activación de la tarjeta"; return(Ok(_apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
public IHttpActionResult UpdateEstadoCard(Tarjeta card) { try { var mng = new TarjetaManager(); _apiResponse = new ApiResponse(); mng.UpdateEstadoTarjeta(card); _apiResponse.Message = "Estado Actualizado"; return(Ok(_apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
public IHttpActionResult GetRepositionCardsByTerminal(int terminal) { try { var mng = new TarjetaManager(); _apiResponse = new ApiResponse(); _apiResponse.Data = mng.GetRequestedRepositionCardsByTerm(terminal); _apiResponse.Message = "Execution Success"; return(Ok(_apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }
public IHttpActionResult DeleteCard(Tarjeta card) { try { var mng = new TarjetaManager(); _apiResponse = new ApiResponse(); mng.Delete(card); _apiResponse.Message = "Tarjeta eliminada"; return(Ok(_apiResponse)); } catch (BusinessException bex) { return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message))); } }