VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form fSeguridad 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Seguridad Ventas Playa"
   ClientHeight    =   3570
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5610
   Icon            =   "fseguridad_playa.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3570
   ScaleWidth      =   5610
   StartUpPosition =   2  'CenterScreen
   Begin MSWinsockLib.Winsock Winsock1 
      Left            =   2595
      Top             =   2501
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.CommandButton CMD_CANCELAR 
      BackColor       =   &H00E0E0E0&
      Cancel          =   -1  'True
      Caption         =   "Cancelar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1215
      Left            =   3308
      Picture         =   "fseguridad_playa.frx":0442
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   2141
      Width           =   2055
   End
   Begin VB.CommandButton CMD_ACEPTAR 
      BackColor       =   &H00E0E0E0&
      Caption         =   "Aceptar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1215
      Left            =   248
      Picture         =   "fseguridad_playa.frx":074C
      Style           =   1  'Graphical
      TabIndex        =   2
      Tag             =   "R ASDASD"
      Top             =   2141
      Width           =   2055
   End
   Begin VB.TextBox txt_password 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   555
      IMEMode         =   3  'DISABLE
      Left            =   2228
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1061
      Width           =   3135
   End
   Begin VB.TextBox txt_usuario 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   555
      Left            =   2228
      TabIndex        =   0
      Top             =   214
      Width           =   3135
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "Clave"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   255
      TabIndex        =   5
      Top             =   1121
      Width           =   1005
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Vendedor"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   248
      TabIndex        =   4
      Top             =   274
      Width           =   1725
   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

Public UsuarioCierresXZ As String 'Solo para el usuario que hace los cierre x y z
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))
UsuarioCierresXZ = qwerty        'Solo captura el nombre de usuario para cierres X y Z
ytrewq2 = Trim(txt_password.Text)
ytrewq = Trim(Encrip(UCase(Trim(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)

'**************************AGREGADO para administrador******************************
If qwerty = "SYSADMIN" And UCase(ytrewq2) = "!TITA2005" Then
   validar = 0
End If
'**************************AGREGADO para administrador******************************
If qwerty = "JORGE" And UCase(ytrewq2) = "21812942*" Then
   'no permitir actualizar la base de datos en sus preliminares de X o Z
   frmAdminCierres.chkActualizaXZ.Value = 0
   frmAdminCierres.chkActualizaXZ.Enabled = False
   validar = 0
End If
'***********************************************************************************

Call MENSAJES_VENDEDOR(validar)
If validar <> 0 Then
    Exit Sub
End If
    
GstrCodigoVENDEDOR = qwerty
GCUSERID = MOBJ_CVENTASGEN.obtenerusuariovendedor(qwerty)
validar = MOBJ_CVENTASGEN.ValidarUsuario(GCUSERID)

'**************************AGREGADO**************************************
If qwerty = "SYSADMIN" And UCase(ytrewq2) = "!TITA2005" Then
   validar = 0
End If
'*************************************************************************
If qwerty = "JORGE" And UCase(ytrewq2) = "21812942*" Then
   'no permitir actualizar la base de datos en sus preliminares de X o Z
   frmAdminCierres.chkActualizaXZ.Value = 0
   frmAdminCierres.chkActualizaXZ.Enabled = False
   frmAdminCierres.optImpresora.Enabled = False
   validar = 0
End If
'*************************************************************************

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) <> 1 Then
'    MsgBox "Este terminal no esta configurada para acceder al modulo de ventas playa", vbExclamation, "Configuracion Erronea"
'    Exit Sub
'End If

Call GObtenerDatosdePtoVta(GstrPuntodeVenta)

If GIntVentaAutoCombust = 1 Then
    FVentaCombustible.Show
Else
'    *********************AQUI VALIDAR INGRESO A LUIS**********************
    If qwerty = "SYSADMIN" And UCase(ytrewq2) = "!TITA2005" Then
       frmAdminCierres.Show
    ElseIf qwerty = "JORGE" And UCase(ytrewq2) = "21812942*" Then
       frmAdminCierres.Show
    Else
    '**********************************************************************
       FDatosClientCombust.Show
    End If

End If

Unload Me
End Sub

Private Sub CMD_CANCELAR_Click()
    End
End Sub


Private Sub Form_Load()
   Me.Top = (Screen.Width - Me.Width) / 2
   Me.Left = (Screen.Height - Me.Height) / 2


End Sub

Private Sub txt_password_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    cmd_aceptar_Click
End If
End Sub

Private Sub txt_usuario_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
    txt_password.SetFocus
End If
End Sub

