1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Private Sub utilisateurs_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim connection As New SqlClient.SqlConnection
connection.ConnectionString = ""
Dim cmd As New SqlClient.SqlCommand
Dim condition1 As Boolean = Convert.ToBoolean("SELECT * FROM Agent WHERE ID_type= 1100 or ID_type= 1200")
Dim condition2 As Boolean = Convert.ToBoolean("SELECT * FROM Agent WHERE ID_type= 1300 ")
connection.Open()
cmd.CommandText = "select ID_type FROM Agent"
cmd.Connection = connection
If condition1 = True Then
GestionArchivesBureauPostalToolStripMenuItem.Enabled = True
GestionArchivesAdministratifsToolStripMenuItem.Enabled = False
ElseIf condition2 = True Then
GestionArchivesBureauPostalToolStripMenuItem.Enabled = False
GestionArchivesAdministratifsToolStripMenuItem.Enabled = True
End If
connection.Close()
End Sub |
Partager