public async Task <HttpResponseMessage> ConsultaTarjetasPersona(int IdPersona) //public HttpResponseMessage ConsultaTarjetasPersona(int IdPersona) { var respuesta = new ConsultarTodoResponse <Card> { }; var strMetodo = "WSViajes - ConsultaTarjetasPersona "; string sid = Guid.NewGuid().ToString(); try { string CustomerId = await new PersonaNegocio().ConsultarClienteIdOpenPay(IdPersona); if (string.IsNullOrEmpty(CustomerId)) { respuesta.CodigoError = 10001; respuesta.Mensaje = $"El usuario solicitado no cuenta con una relación a openpay interna."; } else { respuesta.Data = new OpenPayFunctions().GetListCardCustomers(CustomerId); if (respuesta.Data.Count > 0) { respuesta.Exito = true; respuesta.Mensaje = $"Registros cargados con éxito"; } else { respuesta.CodigoError = 10000; respuesta.Mensaje = $"No existen tarjetas con los parámetros solicitados"; } } } catch (ServiceException Ex) { respuesta.CodigoError = Ex.Codigo; respuesta.Mensaje = Ex.Message; } catch (Exception Ex) { string strErrGUI = Guid.NewGuid().ToString(); string strMensaje = "Error Interno del Servicio [GUID: " + strErrGUI + "]."; Log.Error(Ex, "[" + strMetodo + "]" + "[SID:" + sid + "]" + strMensaje); respuesta.CodigoError = 10001; respuesta.Mensaje = "ERROR INTERNO DEL SERVICIO [" + strErrGUI + "]"; } return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); }
public async Task <HttpResponseMessage> EliminarTarjetaCliente(int IdPersona, string CardId) //public HttpResponseMessage EliminarTarjetaCliente(string CustomerId, string CardId) { var respuesta = new ConsultarTodoResponse <Card> { }; var strMetodo = "WSViajes - EliminarTarjetaCliente "; string sid = Guid.NewGuid().ToString(); try { string CustomerId = await new PersonaNegocio().ConsultarClienteIdOpenPay(IdPersona); if (string.IsNullOrEmpty(CustomerId)) { respuesta.CodigoError = 10001; respuesta.Mensaje = $"El usuario solicitado no cuenta con una relación a openpay interna."; } else { new OpenPayFunctions().DeleteCustomerCard(CustomerId, CardId); respuesta.Exito = true; respuesta.Mensaje = $"Trarjeta eliminada con éxito"; } } catch (ServiceException Ex) { respuesta.CodigoError = Ex.Codigo; respuesta.Mensaje = Ex.Message; } catch (Exception Ex) { string strErrGUI = Guid.NewGuid().ToString(); string strMensaje = "Error Interno del Servicio [GUID: " + strErrGUI + "]."; Log.Error(Ex, "[" + strMetodo + "]" + "[SID:" + sid + "]" + strMensaje); respuesta.CodigoError = 10001; respuesta.Mensaje = "ERROR INTERNO DEL SERVICIO [" + strErrGUI + "]"; } return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); }
public async Task <HttpResponseMessage> BusquedaProductoByTermino(string termino = "") { var respuesta = new ConsultarTodoResponse <E_PRODUCTO_BUSQUEDA> { }; var strMetodo = "WSViajes - BusquedaProductoByTermino "; string sid = Guid.NewGuid().ToString(); try { respuesta.Data = await new ProductoNegocio().BusquedaProductoByTermino(termino.Trim()); if (respuesta.Data != null) { respuesta.Exito = true; respuesta.Mensaje = $"Registros cargados con éxito"; } else { respuesta.CodigoError = 10000; respuesta.Mensaje = $"No existen productos con los parámetros solicitados"; } } catch (ServiceException Ex) { respuesta.CodigoError = Ex.Codigo; respuesta.Mensaje = Ex.Message; } catch (Exception Ex) { string strErrGUI = Guid.NewGuid().ToString(); string strMensaje = "Error Interno del Servicio [GUID: " + strErrGUI + "]."; Log.Error(Ex, "[" + strMetodo + "]" + "[SID:" + sid + "]" + strMensaje); respuesta.CodigoError = 10001; respuesta.Mensaje = "ERROR INTERNO DEL SERVICIO [" + strErrGUI + "]"; } return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); }
public async Task <HttpResponseMessage> GetExtrasByProducto(int idProducto, byte?soloActivos = 1) { var respuesta = new ConsultarTodoResponse <E_EXTRAS_PRODUCTO> { }; var strMetodo = "WSViajes - GetExtrasByProducto "; string sid = Guid.NewGuid().ToString(); try { respuesta.Data = await new ProductoNegocio().ConsultarExtrasByProducto(idProducto, soloActivos); if (respuesta.Data != null) { respuesta.Exito = true; respuesta.Mensaje = $"Registros cargados con éxito"; } else { respuesta.CodigoError = 10000; respuesta.Mensaje = $"No existen extras con los parámetros solicitados"; } } catch (ServiceException Ex) { respuesta.CodigoError = Ex.Codigo; respuesta.Mensaje = Ex.Message; } catch (Exception Ex) { string strErrGUI = Guid.NewGuid().ToString(); string strMensaje = "Error Interno del Servicio [GUID: " + strErrGUI + "]."; Log.Error(Ex, "[" + strMetodo + "]" + "[SID:" + sid + "]" + strMensaje); respuesta.CodigoError = 10001; respuesta.Mensaje = "ERROR INTERNO DEL SERVICIO [" + strErrGUI + "]"; } return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); }
public async Task <HttpResponseMessage> Consulta(byte?soloActivos = null) { var respuesta = new ConsultarTodoResponse <E_METODO_PAGO> { }; var strMetodo = "WSViajes - ConsultaMetodosPago "; string sid = Guid.NewGuid().ToString(); try { respuesta.Data = await new MetodoPagoNegocio().ConsultarTodo(soloActivos); if (respuesta.Data.Count > 0) { respuesta.Exito = true; respuesta.Mensaje = $"Registros cargados con éxito"; } else { respuesta.CodigoError = 10000; respuesta.Mensaje = $"No existen metodos de pago con los parámetros solicitados"; } } catch (ServiceException Ex) { respuesta.CodigoError = Ex.Codigo; respuesta.Mensaje = Ex.Message; } catch (Exception Ex) { string strErrGUI = Guid.NewGuid().ToString(); string strMensaje = "Error Interno del Servicio [GUID: " + strErrGUI + "]."; Log.Error(Ex, "[" + strMetodo + "]" + "[SID:" + sid + "]" + strMensaje); respuesta.CodigoError = 10001; respuesta.Mensaje = "ERROR INTERNO DEL SERVICIO [" + strErrGUI + "]"; } return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); }
public async Task <HttpResponseMessage> ConsultaCoordenadasByIdPedido(Guid IdPedido) { var respuesta = new ConsultarTodoResponse <E_COORDENADAS_CONDUCTOR> { }; var strMetodo = "WSViajes - ConsultaCoordenadasByIdPedido "; string sid = Guid.NewGuid().ToString(); try { respuesta.Data = await new ConductorNegocio().ConsultarCoordenadas(pIdPedido: IdPedido); if (respuesta.Data.Count > 0) { respuesta.Exito = true; respuesta.Mensaje = $"Registros cargados con éxito"; } else { respuesta.CodigoError = 10000; respuesta.Mensaje = $"No existen coordenadas con los parámetros solicitados"; } } catch (ServiceException Ex) { respuesta.CodigoError = Ex.Codigo; respuesta.Mensaje = Ex.Message; } catch (Exception Ex) { string strErrGUI = Guid.NewGuid().ToString(); string strMensaje = "Error Interno del Servicio [GUID: " + strErrGUI + "]."; Log.Error(Ex, "[" + strMetodo + "]" + "[SID:" + sid + "]" + strMensaje); respuesta.CodigoError = 10001; respuesta.Mensaje = "ERROR INTERNO DEL SERVICIO [" + strErrGUI + "]"; } return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); }