client/frmAccesoControl.vb

89 lines
3.2 KiB
VB.net

Imports System.Collections.Generic
Public Class frmAccesoControl
Private Sub frmAccesoControl_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Consultar()
'---------------
Dim ClassAud As New ClassMyUtils
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 1, 1, "Cargando Control de Accesos")
desHeader.Text = Me.Text
End Sub
Private Sub Consultar()
Dim Classcom1 As New clsComplejo
Dim OcultarCol As clOcultarColumna = New clOcultarColumna()
Dim ClassCatalogos As New ClassCatalogos
Dim SQL As String
Try
'Lleno el grid
SQL = "spCRU_AccesoControl NULL,NULL,4"
Classcom1.fdtDataSetTabla(SQL)
'-----------
GridMaster.ClearFields()
GridMaster.DataSource = Nothing
GridMaster.Columns.Clear()
GridMaster.Refresh()
'-----------
If Classcom1.ds.Tables(0).Rows.Count > 0 Then
GridMaster.SetDataBinding(Classcom1.ds, "Tabla")
GridMaster.Splits(0).DisplayColumns(0).Visible = False
GridMaster.Splits(0).DisplayColumns(1).Visible = False
End If
Catch er As Exception
MsgBox("Error en el metodo 'LlenarGrid' del formulario 'Perfil': " & er.Message)
End Try
End Sub
Private Sub btnCerrar_Click(sender As Object, e As EventArgs) Handles btnCerrar.Click
Me.Close()
End Sub
Private Sub btnActualizar_Click(sender As System.Object, e As System.EventArgs) Handles btnActualizar.Click
Consultar()
End Sub
Private Sub btnTerminarSesion_Click(sender As System.Object, e As System.EventArgs) Handles btnTerminarSesion.Click
If GridMaster.SelectedRows.Count = 0 Then
MessageBox.Show("Es necesario seleccionar un elemento de la lista", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
ElseIf GridMaster.Columns("USUARIO").Text = "" Then
MessageBox.Show("Es necesario seleccionar un elemento de la lista", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
End If
If GridMaster.SelectedRows.Count = 1 Then
Dim clscom As New clsComplejo
clscom.sbInserta("spCRU_AccesoControl " & GridMaster.Columns("IDUSUARIO").Text & "," & GridMaster.Columns("IDAPLICATIVO").Text & ",3")
Dim ClassAud As New ClassMyUtils
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 1, 1, "Liberacion de sesion (usuario: " &
GridMaster.Columns("USUARIO").Text &
" aplicativo: " & GridMaster.Columns("APLICACION").Text & ")")
MessageBox.Show("Operación satisfactoria", "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Information)
Consultar()
End If
End Sub
Private Sub frmAccesoControl_FormClosed(sender As System.Object, e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
'---------------
Dim ClassAud As New ClassMyUtils
ClassAud.RT_Auditoria(clsVaribles.varUsuario, 1, 1, "Cerrando Control de Accesos")
End Sub
End Class