VERSION 5.00
Begin VB.Form FActivarVentaCombustibleM 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Activar Venta de Combustible Manual (95.170.00)"
   ClientHeight    =   2220
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7170
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   2220
   ScaleWidth      =   7170
   Begin VB.CommandButton cmdCancelar 
      Caption         =   "&Cancelar"
      Height          =   735
      Left            =   5130
      Picture         =   "9517000.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   1125
      Width           =   1590
   End
   Begin VB.CommandButton cmdActivar 
      Caption         =   "&Activar"
      Height          =   735
      Left            =   3510
      Picture         =   "9517000.frx":030A
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   1125
      Width           =   1635
   End
   Begin VB.Label Lblestado 
      Caption         =   "Estado Actual"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   4
      Top             =   1080
      Width           =   1575
   End
   Begin VB.Label lblestadoactu 
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   3
      Top             =   1440
      Width           =   2175
   End
   Begin VB.Shape Shape1 
      Height          =   1995
      Left            =   90
      Top             =   90
      Width           =   6945
   End
   Begin VB.Label Label1 
      Caption         =   $"9517000.frx":0614
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   900
      TabIndex        =   2
      Top             =   270
      Width           =   6045
   End
   Begin VB.Image Image1 
      Height          =   600
      Left            =   225
      Picture         =   "9517000.frx":06A3
      Stretch         =   -1  'True
      Top             =   270
      Width           =   570
   End
End
Attribute VB_Name = "FActivarVentaCombustibleM"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public pb_editar As Boolean
Public pb_agregar As Boolean
Public pb_primerregistro As Boolean
Public pb_ultimoregistro As Boolean
Public pbderecho_agregar As Boolean
Public pbderecho_consultar As Boolean
Public pbderecho_editar As Boolean
Public pbderecho_borrar As Boolean
Public pbderecho_imprimir As Boolean
Public pbderecho_anular As Boolean
Public pbderecho_emitir As Boolean
Public pb_tiposcreen As String
 
Public GrecibeUbicacion As BookmarkEnum
Public GrecibeColumnaID As String
Public GrecibeColumnaOpcional As String

Public MobjSetup As UTIL_SETUP.C_SETUP

Dim MblnFlag As Boolean

'Public MobjSetup As UTIL_SETUP.C_SETUP

Private Sub cmdActivar_Click()
On Error GoTo errhandler

    If MsgBox("Está seguro de " + Mid(cmdActivar.Caption, 2, Len(cmdActivar.Caption) - 1) + " la Venta de Combustible Manual. ", vbQuestion + vbYesNo, Mid(cmdActivar.Caption, 2, Len(cmdActivar.Caption) - 1)) = vbNo Then
        Exit Sub
    Else
        Screen.MousePointer = 11
    
    MobjSetup.ActualizarEstadoVentaManual MblnFlag
'    GDatFechaProcesoVentas = MobjSetup.ObtenerFechaProcesoVentas
'    GDatFechaProceso = MobjSetup.ObtenerFechaProcesoInventarios

        Me.Hide
        Screen.MousePointer = 0
        MsgBox "Venta de Combustible Manual " + Mid(cmdActivar.Caption, 2, Len(cmdActivar.Caption) - 2) + "da con éxito. ", vbInformation, "Mensaje"
    End If

Unload Me
Exit Sub
errhandler:
    Screen.MousePointer = 0
    MsgBox MensajedeError(Err.Number, Err.Description), vbDefaultButton1 + vbCritical, "Advertencia"
    
End Sub

Private Sub cmdgrabar_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
    cmdActivar_Click
End If
End Sub

Private Sub cmdcancelar_Click()
    Unload Me
End Sub

Private Sub cmdsalir_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
    cmdcancelar_Click
End If
End Sub

Private Sub Form_Activate()
    Call gactualizaopcion(pbderecho_agregar, pbderecho_editar, pbderecho_borrar, pbderecho_imprimir)
    Call gactualiza_barra(Me)
    'lineas nuevas
    If pbderecho_consultar = False Then
        Unload Me
    End If
End Sub
Public Sub primer_registro()
End Sub
Public Sub ultimo_registro()
End Sub
Public Sub registro_anterior()
End Sub
Public Sub registro_siguiente()
End Sub


Private Sub Form_Load()
    'seguridad
    Call gseguridad(Me)
    
    If pbderecho_consultar Then

        Set MobjSetup = New UTIL_SETUP.C_SETUP
        
        If Not MobjSetup.ObtenerEstadoVentaCombustible Then
            lblestadoactu.Caption = "Activada"
            cmdActivar.Caption = "&Desactivar"
            MblnFlag = True
        Else
            lblestadoactu.Caption = "Desactivada"
            cmdActivar.Caption = "&Activar"
            MblnFlag = False
        End If
        
        
        pb_primerregistro = True
    'lineas nuevas
    Else
        'Unload Me
        MsgBox ("No tiene Derechos de Consultar en este formulario"), vbCritical + vbDefaultButton1, "Mensaje"
    End If
    
    Me.Top = 1300
    Me.Left = (Screen.Width - Me.Width) / 2
    
     
End Sub

Private Sub Salir()
    Unload Me
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If pb_editar Then
        If MsgBox("Desea Cancelar los Cambios", vbYesNo, "Esta Modificando un registro") = vbNo Then
            Cancel = True
        Else
            Call gdesactiva_barra
        End If
    Else
        Call gdesactiva_barra
    End If
End Sub

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

Public Sub salir_formulario()
    Unload Me
End Sub



