VERSION 5.00
Object = "{62EC3EC3-A75A-11D1-AB74-004F4C006808}#1.0#0"; "MARCHOSO.OCX"
Object = "{4F1E23CB-AD57-11D2-B62A-00201853CFCC}#5.0#0"; "ButtonCollection.ocx"
Begin VB.Form Form_Bloq 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   0  'None
   Caption         =   " "
   ClientHeight    =   2865
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   7095
   Icon            =   "Form_Bloq_ses.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   2865
   ScaleWidth      =   7095
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame1 
      BackColor       =   &H00FFFFFF&
      Height          =   2970
      Left            =   0
      TabIndex        =   0
      Top             =   -85
      Width           =   7095
      Begin ButtonCollection.GrayButton BtnAceBloq 
         Height          =   615
         Left            =   6000
         TabIndex        =   8
         Top             =   1200
         Width           =   615
         _ExtentX        =   1085
         _ExtentY        =   1085
         BackColor       =   16777215
         Picture         =   "Form_Bloq_ses.frx":2A8B2
      End
      Begin VB.TextBox txtUserName 
         Height          =   345
         Left            =   3225
         TabIndex        =   1
         Top             =   1050
         Width           =   1725
      End
      Begin VB.TextBox txtPassword 
         Height          =   345
         IMEMode         =   3  'DISABLE
         Left            =   3225
         PasswordChar    =   "*"
         TabIndex        =   2
         Top             =   1515
         Width           =   1725
      End
      Begin MARCHOSOLib.Marchoso Marchoso1 
         Height          =   1575
         Left            =   480
         TabIndex        =   7
         Top             =   720
         Width           =   1455
         _Version        =   65536
         _ExtentX        =   2566
         _ExtentY        =   2778
         _StockProps     =   1
         FileName        =   ""
      End
      Begin VB.Line Line1 
         BorderColor     =   &H00FF0000&
         BorderStyle     =   6  'Inside Solid
         X1              =   120
         X2              =   6960
         Y1              =   2340
         Y2              =   2340
      End
      Begin VB.Line Line3 
         BorderColor     =   &H00FF0000&
         BorderStyle     =   6  'Inside Solid
         X1              =   120
         X2              =   6960
         Y1              =   480
         Y2              =   480
      End
      Begin VB.Label lblWarning 
         BackColor       =   &H00E0E0E0&
         Caption         =   "  El equipo solo puede ser desbloqueado por el usuario o por el usuario o por el administrador."
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   435
         Left            =   120
         TabIndex        =   6
         Top             =   2400
         Width           =   6855
      End
      Begin VB.Label Label1 
         BackColor       =   &H00FFFFFF&
         Caption         =   "Usuario"
         ForeColor       =   &H00FF0000&
         Height          =   375
         Left            =   2265
         TabIndex        =   5
         Top             =   1050
         Width           =   855
      End
      Begin VB.Label Label2 
         BackColor       =   &H00FFFFFF&
         Caption         =   "Password"
         ForeColor       =   &H00FF0000&
         Height          =   375
         Left            =   2265
         TabIndex        =   4
         Top             =   1530
         Width           =   930
      End
      Begin VB.Label lblLicenseTo 
         Alignment       =   2  'Center
         BackColor       =   &H00E0E0E0&
         Caption         =   "GES - COL  BLOQUEADO"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   120
         TabIndex        =   3
         Top             =   180
         Width           =   6855
      End
   End
End
Attribute VB_Name = "Form_Bloq"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub BtnAceBloq_Click()
Consulta = "SELECT * FROM usuarios where aut_nombre_usuario = " & "'" & txtUserName & "'" '& " order by nombre_completo_usu ASC"
            Set rs_Usu = New ADODB.Recordset
            rs_Usu.CursorLocation = adUseClient
            rs_Usu.Open Consulta, conn
            If Not rs_Usu.EOF Then
                    
                If txtUserName = rs_Usu("aut_nombre_usuario") Then
                    If rs_Usu("tip_usu") <> "A" Then
                      MsgBox "Usted no es un usuario administrador", vbExclamation + vbOKOnly, "Bloqueo de Sesión"
                      Me.txtUserName.SetFocus
                      SendKeys "{Home}+{End}"
                      Exit Sub
                    End If
                    
                    
                    If txtPassword = rs_Usu("pas_usu") Then
                        DerUsuario = rs_Usu("priv_usu")
                        LoginSucceeded = True
                        Form_main.Show
                        Unload Me
                    Else
                        MsgBox "La contraseña no es válida. Vuelva a intentarlo", , "Inicio de sesión"
                        txtPassword.SetFocus
                        SendKeys "{Home}+{End}"
                    End If
            
                End If
             Else
                    MsgBox "El Nombre de Usuario no es valido para el sistema. Vuelva a intentarlo", , "Inicio de sesión"
                    Me.txtUserName.SetFocus
                    SendKeys "{Home}+{End}"
             End If

            rs_Usu.Close

End Sub

Private Sub Form_Activate()
Form_main.Hide
CentrarForma Me
txtPassword = ""
txtUserName = ""

'Marchoso1.filename = App.Path + "\objetos\bloq_1.gif"
'habilitar linea anterior; programa se cae por que no encuentra el archivo
Marchoso1.FileName = "C:\Util\Desarrollo\GesCol_VB\V_1.7\Objetos\bloq_1.gif"
Marchoso1.GifLoop = True

End Sub

Private Sub Form_Unload(Cancel As Integer)
Call menuhabilitado(True)
End Sub

