VERSION 5.00
Begin VB.Form FIngresoClave 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Ingreso de Clave"
   ClientHeight    =   2490
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4215
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2490
   ScaleWidth      =   4215
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame1 
      Height          =   2415
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   3975
      Begin VB.CommandButton CMD_CANCELAR 
         Cancel          =   -1  'True
         Caption         =   "Cancelar"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Left            =   2400
         Picture         =   "FIngresoClave.frx":0000
         Style           =   1  'Graphical
         TabIndex        =   6
         Top             =   1440
         Width           =   1335
      End
      Begin VB.CommandButton CMD_ACEPTAR 
         Caption         =   "Aceptar"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   735
         Left            =   1080
         Picture         =   "FIngresoClave.frx":030A
         Style           =   1  'Graphical
         TabIndex        =   5
         Tag             =   "R ASDASD"
         Top             =   1440
         Width           =   1335
      End
      Begin VB.TextBox txtclave 
         Height          =   285
         IMEMode         =   3  'DISABLE
         Left            =   1080
         PasswordChar    =   "*"
         TabIndex        =   4
         Top             =   840
         Width           =   2055
      End
      Begin VB.TextBox txtusuario 
         Height          =   285
         Left            =   1080
         TabIndex        =   3
         Top             =   360
         Width           =   2055
      End
      Begin VB.Label Label2 
         Caption         =   "Clave"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   840
         Width           =   1095
      End
      Begin VB.Label Label1 
         Caption         =   "Usuario"
         Height          =   375
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   1335
      End
   End
End
Attribute VB_Name = "FIngresoClave"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mobj_cseguridad As DB_SE_MANTENIMIENTOS.c_seguridad
Dim mobj_setup As UTIL_SETUP.C_SETUP
Public GintPantalla As Integer

Private Sub CMD_ACEPTAR_Click()
    
  Dim LIntValidar As Integer
  Dim LArrayDatUsuario(1, 1) As Variant
    
  LArrayDatUsuario(1, 1) = Trim(txtusuario.Text)
    
  If Trim(txtusuario.Text) = Empty Then
     MsgBox "Debe ingresar un usuario", vbDefaultButton1 + vbExclamation, "Mensaje"
     txtusuario.SetFocus
     Exit Sub
 
  End If
  
  If Trim(txtclave.Text) = Empty Then
     MsgBox "Debe ingresar un password", vbDefaultButton1 + vbExclamation, "Mensaje"
     txtclave.SetFocus
     Exit Sub
  End If
  
  
  LIntValidar = mobj_cseguridad.ValidarUsuario(Trim(txtusuario.Text), Encrip(Trim(UCase(txtclave.Text))))
  
  Call MENSAJES_USUARIO(LIntValidar)
            
  If LIntValidar = 0 Then
       
     If GintPantalla = 2 Then
       If mobj_setup.Auxiliar2(LArrayDatUsuario) = 0 Then
          MsgBox "Usuario no Autorizado", vbDefaultButton1 + vbExclamation, "Mensaje"
          txtusuario.SetFocus
          Exit Sub
       End If
     End If
     
     FFechaProceso.MintResultadoLogin = LIntValidar
     
     FFechaProceso.MstrUsuario = Trim(txtusuario.Text)
     Unload Me
  End If
  
  
End Sub

Private Sub CMD_CANCELAR_Click()
  Unload Me
End Sub

Private Sub Form_Load()
  
  Set mobj_cseguridad = New DB_SE_MANTENIMIENTOS.c_seguridad
  Set mobj_setup = New UTIL_SETUP.C_SETUP
  
  Me.Top = (Screen.Height - Me.Height) / 2
  Me.Left = (Screen.Width - Me.Width) / 2
  
  
End Sub

Private Sub Form_Unload(Cancel As Integer)
  
  Set mobj_cseguridad = Nothing
  
End Sub

Private Sub txtclave_KeyPress(KeyAscii As Integer)
 If KeyAscii = 13 Then
   If Trim(txtclave.Text) = Empty Then
       MsgBox "Debe Ingresar un password ", vbDefaultButton1 + vbExclamation, "Advertencia"
       Exit Sub
   Else
      CMD_ACEPTAR.SetFocus
      CMD_ACEPTAR_Click
   End If
 End If
End Sub

Private Sub txtusuario_KeyPress(KeyAscii As Integer)
 If KeyAscii = 13 Then
    If Trim(txtusuario.Text) = Empty Then
       MsgBox "Debe Ingresar un Usuario ", vbDefaultButton1 + vbExclamation, "Advertencia"
       Exit Sub
    Else
       txtclave.SetFocus
    End If
 End If
End Sub

