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_DERECHOSACCESO"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'Clase Derechos de Acceso
'Funciones Básicas de Mantenimiento
'Propiedades : AgregarDerechoCabecera
'              AgregarDerechoDetalle

Public Sub AgregarDerechoDetalle(ByVal StrCodigoUsuario As String, ByVal StrCodigoPantalla As String, _
                                 ByVal BytVisualizar As Byte, ByVal BytInsertar As Byte, _
                                 ByVal BytActualizar As Byte, ByVal BytEliminar As Byte, _
                                 ByVal Bytimprimir As Byte, ByVal Bytanular As Byte, ByVal Bytcerrar As Byte, Optional VarAux As Variant)
       
Dim cmd As ADODB.Command
Dim con As ADODB.Connection

On Error GoTo ErrorHandler
 
Set cmd = New ADODB.Command
cmd.CommandText = " SP_InsProcSE_ACCESSDETRIGHTS '" & StrCodigoUsuario & "','" & StrCodigoPantalla & "','" & _
                                BytVisualizar & "','" & BytInsertar & "','" & BytActualizar & "','" & _
                                BytEliminar & "','" & Bytimprimir & "','" & Bytanular & "','" & Bytcerrar & "'" & ",1,0,0,0,0"

Set con = New ADODB.Connection
con.Open "FILEDSN=conexionsies"

Set cmd.ActiveConnection = con
cmd.Execute
    
'GetObjectContext.SetComplete
    
Exit Sub
    
ErrorHandler:

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_SE_MANTENIMIENTOS.AgregarDerechoDetalle", LStrMensajeError
    
End Sub
Public Sub EliminarDerecho(ByVal StrCodigoUsuario As String, Optional VarAux As Variant)
       
Dim cmd As ADODB.Command
Dim con As ADODB.Connection

On Error GoTo ErrorHandler
 
Set cmd = New ADODB.Command
cmd.CommandText = " SE_BORRARDERECHOSPROC '" & StrCodigoUsuario & "'"

Set con = New ADODB.Connection
con.Open "FILEDSN=conexionsies"

Set cmd.ActiveConnection = con
cmd.Execute
    
'GetObjectContext.SetComplete
    
Exit Sub
    
ErrorHandler:
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_SE_MANTENIMIENTOS.EliminarDerechoDetalle", LStrMensajeError
               
End Sub

Public Sub AGREGARTODOSLOSDERECHOS(ByVal struserid As String, Optional VarAux As Variant)
       
Dim cmd As ADODB.Command
Dim con As ADODB.Connection

On Error GoTo ErrorHandler
 
Set cmd = New ADODB.Command
cmd.CommandText = " AGREGARTODOSLOSDERECHOS_PROC  '" & struserid & "'"
                                
Set con = New ADODB.Connection
con.Open "FILEDSN=conexionsies"

Set cmd.ActiveConnection = con
cmd.Execute
    
'GetObjectContext.SetComplete
    
Exit Sub
    
ErrorHandler:

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_SE_MANTENIMIENTOS.Agregartodoslosderechos ", LStrMensajeError
    
End Sub

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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.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_SE_MANTENIMIENTOS.C_DERECHOSACCESO.Auxiliar10", Err.Description
End Function




