VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form fseguridad 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Seguridad"
   ClientHeight    =   2670
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4410
   Icon            =   "fseguridad_manual.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2670
   ScaleWidth      =   4410
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton CMD_CANCELAR 
      BackColor       =   &H00E0E0E0&
      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          =   855
      Left            =   2318
      Picture         =   "fseguridad_manual.frx":0442
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   1688
      Width           =   1935
   End
   Begin VB.CommandButton CMD_ACEPTAR 
      BackColor       =   &H00E0E0E0&
      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          =   855
      Left            =   158
      Picture         =   "fseguridad_manual.frx":074C
      Style           =   1  'Graphical
      TabIndex        =   2
      Tag             =   "R ASDASD"
      Top             =   1688
      Width           =   1815
   End
   Begin VB.TextBox txt_password 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      IMEMode         =   3  'DISABLE
      Left            =   1740
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   848
      Width           =   2295
   End
   Begin VB.TextBox txt_usuario 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   1740
      TabIndex        =   0
      Top             =   128
      Width           =   2295
   End
   Begin MSWinsockLib.Winsock Winsock1 
      Left            =   180
      Top             =   1208
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "Clave:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   300
      Left            =   885
      TabIndex        =   5
      Top             =   885
      Width           =   750
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Vendedor:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   300
      Left            =   375
      TabIndex        =   4
      Top             =   188
      Width           =   1260
   End
End
Attribute VB_Name = "fseguridad"
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_cventasgen As DB_OP_FACTURACION.C_VENTASGENERAL

Private Sub CMD_ACEPTAR_Click()
Set mobj_cseguridad = New DB_SE_MANTENIMIENTOS.c_seguridad
Set mobj_cventasgen = New DB_OP_FACTURACION.C_VENTASGENERAL
Dim qwerty As String
Dim ytrewq As String
Dim cadena As String
Dim clave As String
Dim validar As Integer
qwerty = UCase(Trim(txt_usuario.Text))
ytrewq = Trim(Encrip(Trim(UCase(txt_password.Text))))

If Len(qwerty) = 0 Then
    MsgBox ("Debe ingresar un usuario")
    txt_usuario.SetFocus
    Exit Sub
End If
If Len(ytrewq) = 0 Then
    MsgBox ("Debe ingresar un password")
    txt_password.SetFocus
    Exit Sub
End If
validar = mobj_cventasgen.Validarvendedor(qwerty, ytrewq)
Call MENSAJES_VENDEDOR(validar)
If validar <> 0 Then
    Exit Sub
End If

GstrCodigoVENDEDOR = qwerty
GCUSERID = mobj_cventasgen.obtenerusuariovendedor(qwerty)
validar = mobj_cventasgen.ValidarUsuario(GCUSERID)

Call MENSAJES_USUARIO(validar)
If validar <> 0 Then
    Exit Sub
Else
    Verifica_dias_Venc GCUSERID, ""
End If

GstrTerminal = Winsock1.LocalHostName
GstrPuntodeVenta = mobj_cventasgen.obtenernombrepv(GstrTerminal)
If Len(Trim(GstrPuntodeVenta)) = 0 Then
    MsgBox "Este terminal no tiene una caja configurada", vbExclamation, "Configuracion Erronea"
    Exit Sub
End If
        
'If mobj_cventasgen.obtenertiponegocio(GstrTerminal) <> 0 Then
'    MsgBox "Este terminal no esta configurada para acceder al modulo de ventas tienda", vbExclamation, "Configuracion Erronea"
'    Exit Sub
'End If

Call GObtenerDatosdePtoVta(GstrPuntodeVenta)
gstrtipoventas = "M" 'ventas automatica
Me.Hide
'F_inicio.Show
f_ventascstore.Show
Unload Me

End Sub
Private Sub cmd_Cancelar_Click()
    End
End Sub



Private Sub txt_password_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = vbKeyDown Then
    If Len(Trim(txt_usuario.Text)) > 0 Then
        Call CMD_ACEPTAR_Click
    End If
End If
End Sub

Private Sub txt_usuario_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Or KeyCode = vbKeyDown Then
    If Len(Trim(txt_usuario.Text)) > 0 Then
        txt_password.SetFocus
    End If
End If
End Sub

