public List <ModalidadDePago> EjecutarTipoModalidadPago_TT() { SqlCommand command = null; SqlDataReader reader = null; var modalidadDePagoList = new List <ModalidadDePago>(); try { command = AdministradorDeConexion.obtenerSqlComand(); command.CommandText = "TipoModalidadPago_TT"; AdministradorDeConexion.abrirConexion(command); reader = command.ExecuteReader(); while (reader.Read()) { modalidadDePagoList.Add(ParsearAModalidadDePago(reader)); } } catch (Exception ex) { log.Error(string.Format("{0}->{1}-> - Error:{2}->{3}", DateTime.Now, "EjecutarTipoModalidadPago_TT", ex.Source, ex.Message)); throw; } finally { AdministradorDeConexion.CerrarConexion(); } return(modalidadDePagoList); }
public List <TipoMotivoRecupero> Ejecutar_TipoMotivoRecupero_TT() { SqlCommand command = null; SqlDataReader reader = null; var tipoMotivoRecuperoList = new List <TipoMotivoRecupero>(); try { command = AdministradorDeConexion.obtenerSqlComand(); command.CommandText = "TipoMotivoRecupero_TT"; command.CommandType = System.Data.CommandType.StoredProcedure; AdministradorDeConexion.abrirConexion(command); reader = command.ExecuteReader(); while (reader.Read()) { tipoMotivoRecuperoList.Add(parseToTipoMotivoRecupero(reader)); } } catch (Exception ex) { log.Error(string.Format("{0}->{1}-> - Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message)); throw; } finally { AdministradorDeConexion.CerrarConexion(); } return(tipoMotivoRecuperoList); }
/// <summary> /// metodo encargado de listar los tipos de documento, si se parametriza con null lista todos /// </summary> /// <param name="id">representa el id</param> /// <returns></returns> public List <Documento> EjecutarDocumento_T(Nullable <int> id) { SqlCommand command = null; SqlDataReader reader = null; var documentos = new List <Documento>(); try { command = AdministradorDeConexion.obtenerSqlComand(); command.CommandText = "Documento_T"; command.CommandType = System.Data.CommandType.StoredProcedure; AdministradorDeConexion.abrirConexion(command); reader = command.ExecuteReader(); while (reader.Read()) { documentos.Add(parseToDocumento(reader)); } } catch (Exception ex) { log.Error(string.Format("{0}->{1}-> - Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message)); throw; } finally { AdministradorDeConexion.CerrarConexion(); } return(documentos); }
public GestionRecuperoForm Ejecutar_Recupero_T(FiltroDeRecuperos filtro) { SqlCommand command = null; SqlDataReader reader = null; var recuperoList = new List <Recupero>(); SqlParameter cantidadDeRegistros = null; try { command = AdministradorDeConexion.obtenerSqlComand(); command.CommandText = "Recupero_T"; command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@cuil", filtro.Cuil); command.Parameters.AddWithValue("@idMotivoRecupero", filtro.Motivo.Id); command.Parameters.AddWithValue("@idEstadoRecupero", filtro.Estado.Id); command.Parameters.AddWithValue("@valorResidualDesde", filtro.ValorResidualDesde); command.Parameters.AddWithValue("@valorResidualHasta", filtro.ValorResidualHasta); cantidadDeRegistros = new SqlParameter("@totalRecuperos", SqlDbType.Int); cantidadDeRegistros.Direction = System.Data.ParameterDirection.Output; command.Parameters.Add(cantidadDeRegistros); AdministradorDeConexion.abrirConexion(command); reader = command.ExecuteReader(); while (reader.Read()) { recuperoList.Add(ConvertirARecupero(reader)); } } catch (Exception ex) { log.Error(string.Format("{0}->{1}-> - Error:{2}->{3}", DateTime.Now, "Ejecutar_Recupero_T", ex.Source, ex.Message)); throw; } finally { AdministradorDeConexion.CerrarConexion(); } int registros = int.Parse(cantidadDeRegistros.Value.ToString()); return(new GestionRecuperoForm { CantidadTotalDeRegistros = registros, RecuperosList = recuperoList }); }
public RecuperoDetalleForm Ejecutar_Recupero_TXId(decimal idRecupero, out decimal valorResidualTotal) { SqlCommand command = null; SqlDataReader reader = null; var novedadesList = new List <DatosDeNovedadDeRecupero>(); var beneficioDisponibleList = new List <BeneficioDisponible>(); valorResidualTotal = 0; try { command = AdministradorDeConexion.obtenerSqlComand(); command.CommandText = "Recupero_TXId"; command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@idRecupero", idRecupero); command.Parameters.AddWithValue("@valorResidualTotal", valorResidualTotal); AdministradorDeConexion.abrirConexion(command); reader = command.ExecuteReader(); reader.NextResult(); while (reader.Read()) { novedadesList.Add(ConvertirADatosDeNovedadDeRecupero(reader)); } reader.NextResult(); while (reader.Read()) { beneficioDisponibleList.Add(ConvertirABeneficioDisponible(reader)); } } catch (Exception ex) { log.Error(string.Format("{0}->{1}-> - Error:{2}->{3}", DateTime.Now, "Ejecutar_Recupero_TXId", ex.Source, ex.Message)); throw; } finally { AdministradorDeConexion.CerrarConexion(); } return(new RecuperoDetalleForm(novedadesList, beneficioDisponibleList)); }
public decimal Ejecutar_Recupero_ValorMinimo_T(int idPrestador) { SqlCommand command = null; SqlDataReader reader = null; SqlParameter cantidadDeRegistros = null; decimal valorMinimoDeRecupero = decimal.Zero; try { command = AdministradorDeConexion.obtenerSqlComand(); command.CommandText = "Recupero_ValorMinimo_T"; command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@idPrestador", idPrestador); cantidadDeRegistros = new SqlParameter("@totalRecuperos", SqlDbType.Int); cantidadDeRegistros.Direction = System.Data.ParameterDirection.Output; command.Parameters.Add(cantidadDeRegistros); AdministradorDeConexion.abrirConexion(command); reader = command.ExecuteReader(); while (reader.Read()) { valorMinimoDeRecupero = (decimal)reader["ValorMinimo"]; } return(valorMinimoDeRecupero); } catch (Exception ex) { log.Error(string.Format("{0}->{1}-> - Error:{2}->{3}", DateTime.Now, "Ejecutar_Recupero_ValorMinimo_T", ex.Source, ex.Message)); throw; } finally { AdministradorDeConexion.CerrarConexion(); } }