VERSION 5.00
Object = "{90F3D7B3-92E7-44BA-B444-6A8E2A3BC375}#1.0#0"; "actskin4.ocx"
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "mswinsck.ocx"
Begin VB.Form fSeguridad 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Seguridad Ventas Playa"
   ClientHeight    =   9795
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   15195
   Icon            =   "fseguridad_playa.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   9795
   ScaleWidth      =   15195
   StartUpPosition =   2  'CenterScreen
   WindowState     =   2  'Maximized
   Begin VB.CommandButton CMD_CANCELAR 
      BackColor       =   &H00FFFFFF&
      Cancel          =   -1  'True
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1350
      Left            =   12600
      Picture         =   "fseguridad_playa.frx":0442
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   1560
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      Caption         =   "Datos de Inicio de Sesión"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000080&
      Height          =   1815
      Left            =   6000
      TabIndex        =   3
      Top             =   3480
      Width           =   6975
      Begin VB.TextBox txt_password 
         Alignment       =   2  'Center
         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            =   2040
         PasswordChar    =   "*"
         TabIndex        =   6
         Top             =   960
         Width           =   3135
      End
      Begin VB.TextBox txt_usuario 
         Alignment       =   2  'Center
         BackColor       =   &H00FFFFFF&
         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            =   2040
         TabIndex        =   5
         Top             =   360
         Width           =   3135
      End
      Begin VB.CommandButton CMD_ACEPTAR 
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   14.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1350
         Left            =   5280
         Picture         =   "fseguridad_playa.frx":0739
         Style           =   1  'Graphical
         TabIndex        =   4
         Tag             =   "R ASDASD"
         Top             =   240
         Width           =   1335
      End
      Begin ACTIVESKINLibCtl.SkinLabel SkinLabel1 
         Height          =   495
         Left            =   120
         OleObjectBlob   =   "fseguridad_playa.frx":0CAB
         TabIndex        =   7
         Top             =   435
         Width           =   1815
      End
      Begin ACTIVESKINLibCtl.SkinLabel SkinLabel2 
         Height          =   375
         Left            =   840
         OleObjectBlob   =   "fseguridad_playa.frx":0D13
         TabIndex        =   8
         Top             =   1035
         Width           =   1095
      End
   End
   Begin ACTIVESKINLibCtl.SkinLabel SkinLabel4 
      Height          =   255
      Left            =   120
      OleObjectBlob   =   "fseguridad_playa.frx":0D75
      TabIndex        =   2
      Top             =   120
      Width           =   3855
   End
   Begin VB.PictureBox pctLogo 
      BackColor       =   &H00FFFFFF&
      Height          =   1695
      Left            =   6720
      Picture         =   "fseguridad_playa.frx":0DF9
      ScaleHeight     =   1635
      ScaleWidth      =   4035
      TabIndex        =   1
      Top             =   6600
      Width           =   4095
      Begin VB.Label lblMarketing 
         Alignment       =   2  'Center
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   0
         TabIndex        =   10
         Top             =   1080
         Width           =   4095
      End
   End
   Begin ACTIVESKINLibCtl.SkinLabel sknTitulo 
      Height          =   855
      Left            =   7200
      OleObjectBlob   =   "fseguridad_playa.frx":F32B
      TabIndex        =   0
      Top             =   240
      Visible         =   0   'False
      Width           =   10695
   End
   Begin ACTIVESKINLibCtl.Skin sknLogin 
      Left            =   1440
      OleObjectBlob   =   "fseguridad_playa.frx":F3AF
      Top             =   1560
   End
   Begin MSWinsockLib.Winsock Winsock1 
      Left            =   1800
      Top             =   3720
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin ACTIVESKINLibCtl.SkinLabel lblLicencia 
      Height          =   375
      Left            =   120
      OleObjectBlob   =   "fseguridad_playa.frx":F5E3
      TabIndex        =   9
      Top             =   480
      Width           =   3855
   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", vbExclamation + 0
    txt_usuario.SetFocus
    Exit Sub
End If
If Len(ytrewq) = 0 Then
    MsgBox "Debe ingresar un password", vbExclamation + 0
    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", vbCritical, "Configuracion Erronea"
    Exit Sub
    Unload Me
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_Activate()
txt_usuario.SetFocus
End Sub

Private Sub Form_Load()

'App.PrevInstance checkča si el programa ya esta ejecutandose.
'Obviamente ponč eso en el Load.'
If App.PrevInstance Then
        MsgBox "El programa ya se encuentra en ejecuciňn", vbCritical, "Alerta del sistema"
        End
End If

sknLogin.LoadSkin (App.Path & "\Skins\" & gstrSkin)
sknLogin.ApplySkin (Me.hWnd)

lblMarketing.Caption = gstrMarketing
lblLicencia.Caption = gstrLicencia

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


End Sub

    
Private Sub Form_Resize()
On Error GoTo eResize
sknTitulo.Left = 200
sknTitulo.Width = Me.Width - 800

pctLogo.Left = Me.Width - pctLogo.Width - 500
pctLogo.Top = Me.Height - pctLogo.Height - 700

CMD_CANCELAR.Left = Me.Width - CMD_CANCELAR.Width - 500
CMD_CANCELAR.Top = 50
Exit Sub
eResize:

End Sub


Private Sub txt_password_GotFocus()
txt_password.BackColor = &H80FFFF
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_password_LostFocus()
txt_password.BackColor = vbWhite
End Sub

Private Sub txt_usuario_GotFocus()

txt_usuario.BackColor = &H80FFFF

'Verde Claro
'txt_usuario.BackColor = RGB(150, 250, 100)
End Sub


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

Private Sub txt_usuario_LostFocus()
txt_usuario.BackColor = vbWhite
End Sub


