' Copyright (C) 2025  P4pillon.org
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero General Public License as
' published by the Free Software Foundation, either version 3 of the
' License, or (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU Affero General Public License for more details.
'
' You should have received a copy of the GNU Affero General Public License
' along with this program.  If not, see <https://www.gnu.org/licenses/>.
Imports System.IO
Imports System.Text



Public Class Convention_form

    Private old_convention As Convention
    Private new_convention As Convention

    Private Sub Convention_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MAJ_Datagrid()
    End Sub

    Private Sub MAJ_Datagrid()
        DataGridView_Conventions.Rows.Clear()
        DataGridView_Conventions.Columns.Clear()

        Dim Conventions_Datatable As DataTable = Me.Convention_Table_ConventionsTableAdapter.GetData


        'ajout des colonnes dans le datagridview-----------------------------------------
        For c = 0 To Conventions_Datatable.Columns.Count - 1
            DataGridView_Conventions.Columns.Add(Conventions_Datatable.Columns.Item(c).ColumnName, Conventions_Datatable.Columns.Item(c).ColumnName)
        Next
        '--------------------------------------------------------------------------------

        For r = 0 To Conventions_Datatable.Rows.Count - 1 'parcours des conventions 
            DataGridView_Conventions.Rows.Add()
            For c = 0 To Conventions_Datatable.Columns.Count - 1
                DataGridView_Conventions.Item(c, r).Value = Conventions_Datatable(r).Item(c).ToString
            Next
        Next

    End Sub

    Private Sub Button_Importer_Table_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Importer_Table.Click

        OpenFileDialog1.InitialDirectory = Config.POP3_RepBAL + "Conventions\"
        OpenFileDialog1.FileName = ""
        OpenFileDialog1.ShowDialog()
        If OpenFileDialog1.FileName = "" Then Exit Sub

        Using sr As New StreamReader(OpenFileDialog1.FileName, Encoding.Default)
            Dim line As String
            Dim tab_data() As String
            ReDim tab_data(22)
            line = sr.ReadLine
            Do
                For i = 0 To 20
                    tab_data(i) = Mid(line, 1, InStr(line, ";") - 1)
                    line = Mid(line, InStr(line, ";") + 1)
                Next
                tab_data(21) = line
                If (tab_data(1).ToString = "2" Or tab_data(1).ToString = "") And (tab_data(2).ToString = "50" Or tab_data(2).ToString = "") Then
                    If tab_data(0) = "C" Or tab_data(0) = "M" Or tab_data(0) = "I" Then 'CDC annexe3 §5.3
                        MyMsg_Box.Presentation("Officine ?", "MAJ CONVENTION: " + tab_data(5) + ";" + tab_data(6) + ";" + tab_data(8) + ";" + tab_data(9) + ";" + tab_data(10) + ";" + tab_data(11) + " ?", True, "OUI", True, "NON", False, "")
                        If MyMsg_Box.ShowDialog() = Windows.Forms.DialogResult.Yes Then
                            If Me.Convention_Table_ConventionsTableAdapter.Select_Count_By_Composite(tab_data(5), tab_data(8), tab_data(9), tab_data(10), tab_data(11)) = 0 Then
                                Me.Convention_Table_ConventionsTableAdapter.Insert(tab_data(0), tab_data(1), tab_data(2), tab_data(3), tab_data(4), tab_data(5), tab_data(6), _
                                                                                   tab_data(7), tab_data(8), tab_data(9), tab_data(10), tab_data(11), tab_data(12), _
                                                                                   tab_data(13), tab_data(14), tab_data(15), tab_data(16), tab_data(17), tab_data(18), _
                                                                                   tab_data(19), tab_data(20), tab_data(21))
                            Else
                                Me.Convention_Table_ConventionsTableAdapter.Delete_By_Composite(tab_data(5), tab_data(8), tab_data(9), tab_data(10), tab_data(11))
                                Me.Convention_Table_ConventionsTableAdapter.Insert(tab_data(0), tab_data(1), tab_data(2), tab_data(3), tab_data(4), tab_data(5), tab_data(6), _
                                                                                   tab_data(7), tab_data(8), tab_data(9), tab_data(10), tab_data(11), tab_data(12), _
                                                                                   tab_data(13), tab_data(14), tab_data(15), tab_data(16), tab_data(17), tab_data(18), _
                                                                                   tab_data(19), tab_data(20), tab_data(21))
                            End If
                        End If
                    ElseIf tab_data(0) = "S" Then 'CDC annexe3 §5.3
                        If Me.Convention_Table_ConventionsTableAdapter.Select_Count_By_Composite(tab_data(5), tab_data(8), tab_data(9), tab_data(10), tab_data(11)) > 0 Then
                            MyMsg_Box.Presentation("Officine ?", "SUPPRIMER CONVENTION: " + tab_data(5) + ";" + tab_data(6) + ";" + tab_data(8) + ";" + tab_data(9) + ";" + tab_data(10) + ";" + tab_data(11) + " ?", True, "OUI", True, "NON", False, "")
                            If MyMsg_Box.ShowDialog() = Windows.Forms.DialogResult.Yes Then
                                Me.Convention_Table_ConventionsTableAdapter.Delete_By_Composite(tab_data(5), tab_data(8), tab_data(9), tab_data(10), tab_data(11))
                            End If
                        End If
                    End If
                End If

                    line = sr.ReadLine
            Loop Until line Is Nothing
        End Using
        MAJ_Datagrid()
    End Sub





    Private Sub DataGridView_Conventions_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView_Conventions.CellClick
        old_convention.clear()
        new_convention.clear()

        For c = 0 To DataGridView_Conventions.Columns.Count - 1
            Select Case DataGridView_Conventions.Columns.Item(c).Name
                Case "Code_action"
                    old_convention.Code_action = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Code_actionTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Code_catégorie"
                    old_convention.Code_catégorie = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Code_catégorieTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Spécialité"
                    old_convention.Spécialité = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    SpécialitéTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Référence_de_convention"
                    old_convention.Référence_de_convention = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Référence_de_conventionTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Message"
                    old_convention.Message = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    MessageTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Identifiant_org_signataire"
                    old_convention.Identifiant_org_signataire = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Identifiant_org_signataireTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Libellé_org_signataire"
                    old_convention.Libellé_org_signataire = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Libellé_org_signataireTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "indicateur_convention_groupée"
                    old_convention.indicateur_convention_groupée = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Indicateur_convention_groupéeTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "type_Identifiant_org_signataire"
                    old_convention.type_Identifiant_org_signataire = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Type_Identifiant_org_signataireTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "critère_secondaire"
                    old_convention.critère_secondaire = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Critère_secondaireTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "type_Accord"
                    old_convention.type_Accord = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Type_AccordTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Num_AMC"
                    old_convention.Num_AMC = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Num_AMCTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "libellé_Org_complémentaire"
                    old_convention.libellé_Org_complémentaire = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Libellé_Org_complémentaireTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "indic_desactivation_STS"
                    old_convention.indic_desactivation_STS = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Indic_desactivation_STSTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Code_aiguillage_STS"
                    old_convention.Code_aiguillage_STS = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Code_aiguillage_STSTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "usage_attestation_papier"
                    old_convention.usage_attestation_papier = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Usage_attestation_papierTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Accepatation_DRE_Annulation"
                    old_convention.Accepatation_DRE_Annulation = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Accepatation_DRE_AnnulationTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Acceptation_DRE_Rectification"
                    old_convention.Acceptation_DRE_Rectification = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Acceptation_DRE_RectificationTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Identifiant_Opérateur_règlement"
                    old_convention.Identifiant_Opérateur_règlement = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Identifiant_Opérateur_règlementTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "Code_routage"
                    old_convention.Code_routage = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Code_routageTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "identifiant_hôte"
                    old_convention.identifiant_hôte = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Identifiant_hôteTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                Case "nom_domaine"
                    old_convention.nom_domaine = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
                    Nom_domaineTextBox.Text = DataGridView_Conventions.Item(c, DataGridView_Conventions.CurrentRow.Index).Value
            End Select
        Next
        Identifiant_org_signataireTextBox.Enabled = False
        Type_Identifiant_org_signataireTextBox.Enabled = False
        Critère_secondaireTextBox.Enabled = False
        Num_AMCTextBox.Enabled = False
        Type_AccordTextBox.Enabled = False


    End Sub


    Private Sub Button_Modifier_Convention_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Modifier_Convention.Click
        'If old_convention.Code_action <> "" Then
        If Code_actionTextBox.Text = "C" Or Code_actionTextBox.Text = "M" Or Code_actionTextBox.Text = "I" Then 'CDC annexe3 §5.3
            MyMsg_Box.Presentation("Officine ?", "MAJ CONVENTION?", True, "OUI", True, "NON", False, "")
            If MyMsg_Box.ShowDialog() = Windows.Forms.DialogResult.Yes Then
                Me.Convention_Table_ConventionsTableAdapter.Delete1(old_convention.Code_action, old_convention.Code_catégorie, old_convention.Spécialité, _
                                                                    old_convention.Référence_de_convention, old_convention.Message, old_convention.Identifiant_org_signataire, _
                                                                    old_convention.Libellé_org_signataire, old_convention.indicateur_convention_groupée, _
                                                                    old_convention.type_Identifiant_org_signataire, old_convention.critère_secondaire, old_convention.type_Accord, _
                                                                    old_convention.Num_AMC, old_convention.libellé_Org_complémentaire, old_convention.indic_desactivation_STS, _
                                                                    old_convention.Code_aiguillage_STS, old_convention.usage_attestation_papier, old_convention.Accepatation_DRE_Annulation, _
                                                                    old_convention.Acceptation_DRE_Rectification, old_convention.Identifiant_Opérateur_règlement, old_convention.Code_routage, _
                                                                    old_convention.identifiant_hôte, old_convention.nom_domaine)

                Me.Convention_Table_ConventionsTableAdapter.Delete1(Code_actionTextBox.Text, Code_catégorieTextBox.Text, SpécialitéTextBox.Text, Référence_de_conventionTextBox.Text, _
                                                           MessageTextBox.Text, Identifiant_org_signataireTextBox.Text, Libellé_org_signataireTextBox.Text, _
                                                           Indicateur_convention_groupéeTextBox.Text, Type_Identifiant_org_signataireTextBox.Text, Critère_secondaireTextBox.Text, _
                                                           Type_AccordTextBox.Text, Num_AMCTextBox.Text, Libellé_Org_complémentaireTextBox.Text, Indic_desactivation_STSTextBox.Text, _
                                                           Code_aiguillage_STSTextBox.Text, Usage_attestation_papierTextBox.Text, Accepatation_DRE_AnnulationTextBox.Text, _
                                                           Acceptation_DRE_RectificationTextBox.Text, Identifiant_Opérateur_règlementTextBox.Text, Code_routageTextBox.Text, _
                                                           Identifiant_hôteTextBox.Text, Nom_domaineTextBox.Text)

                Me.Convention_Table_ConventionsTableAdapter.Insert(Code_actionTextBox.Text, Code_catégorieTextBox.Text, SpécialitéTextBox.Text, Référence_de_conventionTextBox.Text, _
                                                                   MessageTextBox.Text, Identifiant_org_signataireTextBox.Text, Libellé_org_signataireTextBox.Text, _
                                                                   Indicateur_convention_groupéeTextBox.Text, Type_Identifiant_org_signataireTextBox.Text, Critère_secondaireTextBox.Text, _
                                                                   Type_AccordTextBox.Text, Num_AMCTextBox.Text, Libellé_Org_complémentaireTextBox.Text, Indic_desactivation_STSTextBox.Text, _
                                                                   Code_aiguillage_STSTextBox.Text, Usage_attestation_papierTextBox.Text, Accepatation_DRE_AnnulationTextBox.Text, _
                                                                   Acceptation_DRE_RectificationTextBox.Text, Identifiant_Opérateur_règlementTextBox.Text, Code_routageTextBox.Text, _
                                                                   Identifiant_hôteTextBox.Text, Nom_domaineTextBox.Text)

                MAJ_Datagrid()
            End If
        End If
    End Sub

    Private Sub Button_Ajouter_Convention_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Ajouter_Convention.Click
        old_convention.clear()
        For Each truc In Me.Controls
            If truc.GetType.ToString = "System.Windows.Forms.TextBox" Then
                truc.Clear()
            End If
        Next
        Identifiant_org_signataireTextBox.Enabled = True
        Type_Identifiant_org_signataireTextBox.Enabled = True
        Critère_secondaireTextBox.Enabled = True
        Num_AMCTextBox.Enabled = True
        Type_AccordTextBox.Enabled = True
        Button_Ajouter_Convention.Enabled = False
        Button_Modifier_Convention.Enabled = False
        Button_Supprimer_Convention.Enabled = False
        Button_Importer_Table.Enabled = False
        Button_Ajout_OK.Visible = True
        Button_Ajout_Annuler.Visible = True

    End Sub
    Private Sub Button_Ajout_OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Ajout_OK.Click
        If Code_actionTextBox.Text = "C" Or Code_actionTextBox.Text = "M" Or Code_actionTextBox.Text = "I" Then 'CDC annexe3 §5.3
            MyMsg_Box.Presentation("Officine ?", "MAJ CONVENTION?", True, "OUI", True, "NON", False, "")
            If MyMsg_Box.ShowDialog() = Windows.Forms.DialogResult.Yes Then
                Insert_Convention()
            End If
            Identifiant_org_signataireTextBox.Enabled = False
            Type_Identifiant_org_signataireTextBox.Enabled = False
            Critère_secondaireTextBox.Enabled = False
            Num_AMCTextBox.Enabled = False
            Type_AccordTextBox.Enabled = False
            Button_Ajouter_Convention.Enabled = True
            Button_Modifier_Convention.Enabled = True
            Button_Supprimer_Convention.Enabled = True
            Button_Importer_Table.Enabled = True
            Button_Ajout_OK.Visible = False
            Button_Ajout_Annuler.Visible = False
        End If
    End Sub
    Private Sub Button_Ajout_Annuler_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Ajout_Annuler.Click
        Identifiant_org_signataireTextBox.Enabled = False
        Type_Identifiant_org_signataireTextBox.Enabled = False
        Critère_secondaireTextBox.Enabled = False
        Num_AMCTextBox.Enabled = False
        Type_AccordTextBox.Enabled = False
        Button_Ajouter_Convention.Enabled = True
        Button_Modifier_Convention.Enabled = True
        Button_Supprimer_Convention.Enabled = True
        Button_Importer_Table.Enabled = True
        Button_Ajout_OK.Visible = False
        Button_Ajout_Annuler.Visible = False
    End Sub
    Private Sub Insert_Convention()
        Me.Convention_Table_ConventionsTableAdapter.Delete1(Code_actionTextBox.Text, Code_catégorieTextBox.Text, SpécialitéTextBox.Text, Référence_de_conventionTextBox.Text, _
                                                           MessageTextBox.Text, Identifiant_org_signataireTextBox.Text, Libellé_org_signataireTextBox.Text, _
                                                           Indicateur_convention_groupéeTextBox.Text, Type_Identifiant_org_signataireTextBox.Text, Critère_secondaireTextBox.Text, _
                                                           Type_AccordTextBox.Text, Num_AMCTextBox.Text, Libellé_Org_complémentaireTextBox.Text, Indic_desactivation_STSTextBox.Text, _
                                                           Code_aiguillage_STSTextBox.Text, Usage_attestation_papierTextBox.Text, Accepatation_DRE_AnnulationTextBox.Text, _
                                                           Acceptation_DRE_RectificationTextBox.Text, Identifiant_Opérateur_règlementTextBox.Text, Code_routageTextBox.Text, _
                                                           Identifiant_hôteTextBox.Text, Nom_domaineTextBox.Text)
        Me.Convention_Table_ConventionsTableAdapter.Insert(Code_actionTextBox.Text, Code_catégorieTextBox.Text, SpécialitéTextBox.Text, Référence_de_conventionTextBox.Text, _
                                                           MessageTextBox.Text, Identifiant_org_signataireTextBox.Text, Libellé_org_signataireTextBox.Text, _
                                                           Indicateur_convention_groupéeTextBox.Text, Type_Identifiant_org_signataireTextBox.Text, Critère_secondaireTextBox.Text, _
                                                           Type_AccordTextBox.Text, Num_AMCTextBox.Text, Libellé_Org_complémentaireTextBox.Text, Indic_desactivation_STSTextBox.Text, _
                                                           Code_aiguillage_STSTextBox.Text, Usage_attestation_papierTextBox.Text, Accepatation_DRE_AnnulationTextBox.Text, _
                                                           Acceptation_DRE_RectificationTextBox.Text, Identifiant_Opérateur_règlementTextBox.Text, Code_routageTextBox.Text, _
                                                           Identifiant_hôteTextBox.Text, Nom_domaineTextBox.Text)
        MAJ_Datagrid()
    End Sub
    Private Sub Button_Supprimer_Convention_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Supprimer_Convention.Click
        MyMsg_Box.Presentation("Officine ?", "Attention, Suppression definitive," + Chr(10) + "continuer?", True, "OUI", True, "NON", False, "")
        If MyMsg_Box.ShowDialog() = MsgBoxResult.Yes Then
            Me.Convention_Table_ConventionsTableAdapter.Delete1(Code_actionTextBox.Text, Code_catégorieTextBox.Text, SpécialitéTextBox.Text, Référence_de_conventionTextBox.Text, _
                                                    MessageTextBox.Text, Identifiant_org_signataireTextBox.Text, Libellé_org_signataireTextBox.Text, _
                                                    Indicateur_convention_groupéeTextBox.Text, Type_Identifiant_org_signataireTextBox.Text, Critère_secondaireTextBox.Text, _
                                                    Type_AccordTextBox.Text, Num_AMCTextBox.Text, Libellé_Org_complémentaireTextBox.Text, Indic_desactivation_STSTextBox.Text, _
                                                    Code_aiguillage_STSTextBox.Text, Usage_attestation_papierTextBox.Text, Accepatation_DRE_AnnulationTextBox.Text, _
                                                    Acceptation_DRE_RectificationTextBox.Text, Identifiant_Opérateur_règlementTextBox.Text, Code_routageTextBox.Text, _
                                                    Identifiant_hôteTextBox.Text, Nom_domaineTextBox.Text)
        End If
        MAJ_Datagrid()
    End Sub

    Private Sub Code_aiguillage_STSTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Code_aiguillage_STSTextBox.TextChanged

    End Sub
    'code aiguillage STS
    Private Sub Code_aiguillage_STSTextBox_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Code_aiguillage_STSTextBox.Validated

        If Code_aiguillage_STSTextBox.Text = "m" Then
            Code_aiguillage_STSTextBox.Text = "M"
        End If
        If Code_aiguillage_STSTextBox.Text = "r" Then
            Code_aiguillage_STSTextBox.Text = "R"
        End If
        If Code_aiguillage_STSTextBox.Text <> "4" And Code_aiguillage_STSTextBox.Text <> "8" And _
        Code_aiguillage_STSTextBox.Text <> "M" And Code_aiguillage_STSTextBox.Text <> "R" And Code_aiguillage_STSTextBox.Text <> "" Then
            MyMsg_Box.Presentation("Officine !", "CODE STS INCOHERENT", False, "", False, "", True, "OK")
            MyMsg_Box.ShowDialog()
            Code_aiguillage_STSTextBox.Text = ""
        End If
    End Sub


 
    Private Sub DataGridView_Conventions_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView_Conventions.CellContentClick

    End Sub
End Class