'Imports System
Imports System.IO

Module Variabili
    Public rx_seriale As String = ""
    Public password As String = "12345"
    Public PWD_TEMP As String = ""  'Rappresenta la password nuova nel caso di cambio
    Public id_comando As Integer = 0
    Public CMD_Login As Integer
    Public richiesto_nome As Boolean = False
    Public memorizza_master_chiamata As Boolean = False
    Public ora_avvio_comando As DateTime
    Public comando As String = ""
    Public TIMEOUT As Integer = 40  'Timeout comando (espresso in secondi)
    Public TDG As String = ""
    Public Path_Database As String = ""
    Public Path_Software As String = ""
    Public MONITOR_STATO As Boolean = False
    Public num_inib As Integer = 0

    Public T_IN As Integer = 0
    Public T_IN1 As String = ""
    Public T_IN2 As String = ""
    Public T_OS1 As String = ""
    Public T_OS2 As String = ""
    Public T_LIV1 As String = ""
    Public T_LIV2 As String = ""
    Public T_Richiesta As Boolean = False

    Public MEX_PC As Integer = 0

    Public LOG_Esteso As Boolean = False



    Public Function Percorso_Software() As String
        Dim percorso As String
        percorso = Application.StartupPath
        If Mid(percorso, percorso.Length) <> "\" Then
            percorso = percorso & "\"
        End If
        Return percorso
    End Function

    Public Function Percorso_Database() As String
        Dim percorso As String
        'Dim directory As System.IO.File
        percorso = Path_Software & "Utenti.mdb"
        If File.Exists(percorso) = False Then
            percorso = "ERRORE"
        End If
        Return percorso
    End Function

    'Public Function Database_Nome(ByVal Numero As String) As String
    'Dim comando As String
    'Dim stringa As String
    'Conn_Apri(CONN)
    'comando = "SELECT Nominativo FROM Utente WHERE Numero='" & Numero & "'"
    'RS_Apri(RS, CONN, comando)
    'If RS_End(RS) = False Then
    'RS_Inizio(RS)
    'stringa = RS.Fields("Nominativo").Value
    'Else
    'stringa = ""
    'End If
    'RS_Chiudi(RS)
    'Conn_Chiudi(CONN)
    'Return stringa
    'End Function

    'Public Sub Database_Inserisci(ByVal Nome As String, ByVal Numero As String)
    'Dim comando As String
    'Conn_Apri(CONN)
    'comando = "INSERT INTO Utente (Nominativo, Numero) values ('" & Nome & "','" & Numero & "')"
    'RS_Apri(RS, CONN, comando)
    'Conn_Chiudi(CONN)
    'End Sub
End Module
