VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "C_TDTDCAMBIO"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
' Clase C_TipodeTipodeCambio
' Funciones Básicas de Mantenimiento
'               AgregarTipodeTipodeCambio
'               EliminarTipodeTipodeCambio
'               ActualizarTipodeTipodeCambio
'               ListarPorTipodeTipodeCambioID
'               ListarTiposdeTipodeCambio
'               ListarTiposdeTipodeCambioAyuda
Option Explicit

Public Sub AgregarTipodeTipodeCambio(ByVal strCURYTYPEID As String, ByVal strDESCR As String, Optional VarAux As Variant)
    Dim cmd As ADODB.Command
    Dim con As ADODB.Connection
    Dim strSQL As String

    On Error GoTo TrataError
    
    
    strSQL = " EXEC SP_InsProcCURYRATETYPE '" & strCURYTYPEID & "','" & _
                                               strDESCR & "'"
    
    Set cmd = New ADODB.Command
    cmd.CommandText = strSQL
      
      
    Set con = New ADODB.Connection
    con.Open "FILEDSN=conexionsies"
    cmd.ActiveConnection = con
       
    cmd.Execute
    
    'GetObjectContext.SetComplete
        
    Exit Sub
    
TrataError:
       
Dim LStrMensajeError As String
Dim LVarNumeroError As Variant

     If Not cmd Is Nothing Then
        Set cmd = Nothing
     End If
     If Not con Is Nothing Then
        LStrMensajeError = con.Errors(con.Errors.Count - 2).Description
        LVarNumeroError = con.Errors(con.Errors.Count - 2).NativeError
        Set con = Nothing
     End If
     
     'GetObjectContext.SetAbort
     
     Err.Raise LVarNumeroError, "DB_MA_MANTENIMIENTOS.AgregarTipodeTipodeCambio", LStrMensajeError
    
End Sub

Public Sub EliminarTipodeTipodeCambio(ByVal strCURYTYPEID As String, Optional VarAux As Variant)
    Dim con As ADODB.Connection
    Dim strSQL As String
    
    On Error GoTo TrataError
    
    strSQL = " EXEC SP_DelProcCURYRATETYPE '" & strCURYTYPEID & "'"
    
    Set con = New ADODB.Connection
    con.Open "FILEDSN=conexionsies"
    con.Execute strSQL
    
    'GetObjectContext.SetComplete
    
    Exit Sub

TrataError:
  Dim LStrMensajeError As String
  Dim LVarNumeroError As Variant

    
     If Not con Is Nothing Then
        LStrMensajeError = con.Errors(con.Errors.Count - 2).Description
        LVarNumeroError = con.Errors(con.Errors.Count - 2).NativeError
        Set con = Nothing
     End If
     
     'GetObjectContext.SetAbort
     
     Err.Raise LVarNumeroError, "DB_MA_MANTENIMIENTOS.EliminarTipodeTipodeCambio", LStrMensajeError

End Sub

Public Sub ActualizarTipodeTipodeCambio(ByVal strCURYTYPEID As String, ByVal strDESCR As String, Optional VarAux As Variant)
    Dim con As ADODB.Connection
    Dim strSQL As String
    
    On Error GoTo TrataError
    
    strSQL = " EXEC SP_UpdProcCURYRATETYPE '" & strCURYTYPEID & "','" & _
                                               strDESCR & "'"
    
    Set con = New ADODB.Connection
    con.Open "FILEDSN=conexionsies"
    con.Execute strSQL
    
    'GetObjectContext.SetComplete
    
    Exit Sub

TrataError:
Dim LStrMensajeError As String
Dim LVarNumeroError As Variant

     If Not con Is Nothing Then
        LStrMensajeError = con.Errors(con.Errors.Count - 2).Description
        LVarNumeroError = con.Errors(con.Errors.Count - 2).NativeError
        Set con = Nothing
     End If
     
     'GetObjectContext.SetAbort
     
     Err.Raise LVarNumeroError, "DB_MA_MANTENIMIENTOS.ActualizarTipodeTipodeCambio", LStrMensajeError

End Sub

Public Function ListarPorTipodeTipodeCambioID(ByVal strCURYTYPEID As String, Optional VarAux As Variant) As ADODB.Recordset
    Dim strSQL As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    
    strSQL = " EXEC SP_SelProcCURYRATETYPE '" & strCURYTYPEID & "'"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open strSQL, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
        
    Set ListarPorTipodeTipodeCambioID = rs
    
    'GetObjectContext.SetComplete
        
    Exit Function
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If
    
    'GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.ListarPorTipodeTipodeCambioID", Err.Description

End Function

Public Function ListarTiposdeTipodeCambio(Optional VarAux As Variant) As ADODB.Recordset
    Dim strSQL As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    
    strSQL = "select *  from curyratetype"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open strSQL, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified

    Set ListarTiposdeTipodeCambio = rs
    
    'GetObjectContext.SetComplete
    Exit Function
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If

    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.ListarTiposdeTipodeCambio", Err.Description

End Function

Public Function ListarTiposdeTipodeCambioAyuda(Optional VarAux As Variant) As ADODB.Recordset
    Dim strSQL As String
    Dim rs As ADODB.Recordset
    
    On Error GoTo TrataError
    
    strSQL = " SELECT CURYTYPEid,descr FROM CURYRATETYPE"
    
    Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.Open strSQL, "FILEDSN=conexionsies", adOpenUnspecified, adLockUnspecified, adCmdUnspecified
            
    Set ListarTiposdeTipodeCambioAyuda = rs
    
    'GetObjectContext.SetComplete
    
    Exit Function
    
TrataError:
    If Not rs Is Nothing Then
        Set rs = Nothing
    End If

    'GetObjectContext.SetAbort
    
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.ListarTiposdeTipodeCambioAyuda", Err.Description

End Function


Public Function Auxiliar1(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar1", Err.Description
End Function


Public Function Auxiliar2(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar2", Err.Description
End Function

Public Function Auxiliar3(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar3", Err.Description
End Function

Public Function Auxiliar4(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar4", Err.Description
End Function

Public Function Auxiliar5(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar5", Err.Description
End Function


Public Function Auxiliar6(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar6", Err.Description
End Function

Public Function Auxiliar7(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar7", Err.Description
End Function

Public Function Auxiliar8(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar8", Err.Description
End Function

Public Function Auxiliar9(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar9", Err.Description
End Function

Public Function Auxiliar10(Optional ByVal VarAux1 As Variant, Optional ByVal VarAux2 As Variant) As Variant
    ' Funcion
    
    On Error GoTo errhandler
    
    
    
    'GetObjectContext.SetComplete
    
    Exit Function
errhandler:
    'GetObjectContext.SetAbort
    Err.Raise Err.Number, "DB_MA_MANTENIMIENTOS.C_TDTDCAMBIO.Auxiliar10", Err.Description
End Function







