VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
Begin VB.Form Form_Conexionremota 
   BorderStyle     =   0  'None
   Caption         =   "Selecionando  sede"
   ClientHeight    =   6720
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   9630
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   6720
   ScaleWidth      =   9630
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame1 
      Height          =   6375
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   9375
      Begin VB.Frame frame_conectando 
         ForeColor       =   &H00FF0000&
         Height          =   4215
         Left            =   3480
         TabIndex        =   8
         Top             =   240
         Width           =   5655
         Begin VB.Frame Frame5 
            Height          =   615
            Left            =   120
            TabIndex        =   11
            Top             =   3000
            Width           =   5415
            Begin VB.Label lbl_sede 
               Alignment       =   2  'Center
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00C00000&
               Height          =   255
               Left            =   120
               TabIndex        =   12
               Top             =   240
               Width           =   5175
            End
         End
         Begin VB.Frame Frame3 
            Height          =   615
            Left            =   120
            TabIndex        =   9
            Top             =   1560
            Width           =   5415
            Begin VB.Label lbl_conectandocon 
               Alignment       =   2  'Center
               BeginProperty Font 
                  Name            =   "MS Sans Serif"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00C00000&
               Height          =   255
               Left            =   120
               TabIndex        =   10
               Top             =   240
               Width           =   5175
            End
         End
         Begin MSComctlLib.ProgressBar Prgbar_conectando 
            Height          =   375
            Left            =   360
            TabIndex        =   13
            Top             =   2400
            Width           =   4935
            _ExtentX        =   8705
            _ExtentY        =   661
            _Version        =   393216
            Appearance      =   1
            Scrolling       =   1
         End
         Begin VB.Line Line2 
            BorderColor     =   &H80000005&
            X1              =   15
            X2              =   5625
            Y1              =   1215
            Y2              =   1215
         End
         Begin VB.Line Line3 
            BorderColor     =   &H8000000C&
            X1              =   15
            X2              =   5625
            Y1              =   1200
            Y2              =   1200
         End
         Begin VB.Image Image1 
            Height          =   480
            Left            =   4920
            Picture         =   "Form_Conexionremota.frx":0000
            Top             =   360
            Width           =   480
         End
         Begin VB.Label lbl_porcentaje2 
            Alignment       =   2  'Center
            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            =   360
            TabIndex        =   14
            Top             =   2800
            Width           =   4935
         End
         Begin VB.Label Label2 
            Alignment       =   2  'Center
            Caption         =   "ESTADO DE LA CONEXIÓN"
            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            =   120
            TabIndex        =   15
            Top             =   480
            Width           =   5415
         End
      End
      Begin VB.Frame Frame2 
         Height          =   5895
         Left            =   240
         TabIndex        =   1
         Top             =   240
         Width           =   3015
         Begin VB.CommandButton btn_con_salir 
            Caption         =   "Salir"
            Height          =   375
            Left            =   1560
            TabIndex        =   3
            Top             =   4320
            Width           =   1335
         End
         Begin VB.CommandButton btn_conectar 
            Caption         =   "Conectar"
            Height          =   375
            Left            =   120
            TabIndex        =   2
            Top             =   4320
            Width           =   1335
         End
         Begin MSComctlLib.ProgressBar Pgrbar_verifica_sedes 
            Height          =   255
            Left            =   240
            TabIndex        =   4
            Top             =   600
            Width           =   2535
            _ExtentX        =   4471
            _ExtentY        =   450
            _Version        =   393216
            Appearance      =   1
            Scrolling       =   1
         End
         Begin VB.PictureBox flex_sedes 
            Height          =   2895
            Left            =   360
            ScaleHeight     =   2835
            ScaleWidth      =   2235
            TabIndex        =   5
            Top             =   1320
            Width           =   2295
         End
         Begin VB.Line Line6 
            BorderColor     =   &H80000005&
            X1              =   15
            X2              =   2965
            Y1              =   4965
            Y2              =   4965
         End
         Begin VB.Line Line4 
            BorderColor     =   &H8000000C&
            X1              =   15
            X2              =   2965
            Y1              =   4950
            Y2              =   4950
         End
         Begin VB.Label Label1 
            Alignment       =   2  'Center
            Caption         =   "Las sedes tachadas no están disponibles en este momento."
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   615
            Left            =   240
            TabIndex        =   16
            Top             =   5100
            Width           =   2535
         End
         Begin VB.Label lbl_sedes_disponibles 
            Alignment       =   2  'Center
            Caption         =   "BUSCANDO SEDES..."
            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            =   120
            TabIndex        =   7
            Top             =   240
            Width           =   2775
         End
         Begin VB.Line Line5 
            BorderColor     =   &H8000000C&
            X1              =   15
            X2              =   2980
            Y1              =   1200
            Y2              =   1200
         End
         Begin VB.Line Line1 
            BorderColor     =   &H80000005&
            X1              =   15
            X2              =   2980
            Y1              =   1215
            Y2              =   1215
         End
         Begin VB.Label lbl_porcentaje 
            Alignment       =   2  'Center
            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        =   6
            Top             =   960
            Width           =   2535
         End
      End
   End
End
Attribute VB_Name = "Form_Conexionremota"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Numerosedes As Integer

Private Sub btn_con_salir_Click()
Unload Me
End Sub

Private Sub btn_conectar_Click()
Dim a As Integer
a = Me.flex_sedes.ListIndex + 1
If a >= 1 Then
    If MsgBox("Este proceso finalizará su sesión actual ¿Desea continuar?", vbYesNo + vbQuestion) = vbYes Then
        If Me.flex_sedes.List.Item(a).Enabeled = True Then
            Me.lbl_conectandocon.Caption = "CONECTANDO CON"
            conexionremota = True
'           basedatosremota = Sedes(Me.flex_sedes.ListIndex + 1, 2)
            basedatosremota = "gescol"
            Me.lbl_sede.Caption = "SEDE " & Sedes(Me.flex_sedes.ListIndex + 1, 1)
            IpRemota = Sedes(Me.flex_sedes.ListIndex + 1, 3)
            Me.Refresh
            CentrarForma Me
            'conn.Close
            'Unload Me
            Call Main
        Else
            MsgBox ("Esta Sede no se encuentra disponible, seleccione nuevamente")
        End If
    End If
Else
    MsgBox ("Seleccione sede")
End If
End Sub

Private Sub Form_Load()
Dim rango As Integer
Dim ip As String
CentrarForma Me
Me.Show
Numerosedes = 6
Sedes(1, 1) = "La Florida": Sedes(1, 2) = "florida"
Sedes(2, 1) = "La Farfana": Sedes(2, 2) = "farfana"
Sedes(3, 1) = "Maipú": Sedes(3, 2) = "maipu"
Sedes(4, 1) = "San Martín": Sedes(4, 2) = "sanmartin"
Sedes(5, 1) = "Lincoln Anexo 3": Sedes(5, 2) = "lincolna3"
Sedes(6, 1) = "Lincoln Anexo 4": Sedes(6, 2) = "lincolna4"
Me.lbl_conectandocon.Caption = "CONECTAR CON"
Me.btn_conectar.Enabled = False
Me.btn_con_salir.Enabled = False

rango = Me.Pgrbar_verifica_sedes.max / Numerosedes
For t = 1 To Numerosedes
    ip = (ConectaRemota(Sedes(t, 2)))
    Sedes(t, 3) = ip
    Me.flex_sedes.AddItem Sedes(t, 1)
    If ValidarIP(ip) Then
        Me.flex_sedes.List.Item(t).Enabeled = True
    Else
        Me.flex_sedes.List.Item(t).Enabeled = False
    End If
    If (rango + Me.Pgrbar_verifica_sedes.Value) > Me.Pgrbar_verifica_sedes.max Then
        rango = Me.Pgrbar_verifica_sedes.max - Me.Pgrbar_verifica_sedes.Value
    End If
    Me.Pgrbar_verifica_sedes.Value = Me.Pgrbar_verifica_sedes.Value + rango
    Me.Pgrbar_verifica_sedes.Refresh
    Me.flex_sedes.Refresh
    Me.lbl_porcentaje = Me.Pgrbar_verifica_sedes.Value & "%"
Next t
Me.lbl_sedes_disponibles.Caption = "SEDES ENCONTRADAS"
Me.btn_con_salir.Enabled = True
Me.btn_conectar.Enabled = True
End Sub

