' 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/>.
Public Class Création_TypeContrat

    Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        If intitulé_TextBox.Text = "" Then
            MyMsg_Box.Presentation("Officine !", "intitulé obligatoire", False, "", False, "", True, "OK")
            MyMsg_Box.ShowDialog()
            Exit Sub
        End If
        If Not IsNumeric(PH2_TextBox1.Text) Or Not IsNumeric(PH1_TextBox1.Text) Or Not IsNumeric(PH4_TextBox2.Text) _
            Or Not IsNumeric(PH7_TextBox3.Text) Or Not IsNumeric(Autres_TextBox4.Text) Then
            MyMsg_Box.Presentation("Officine !", "valeur non numérique...", False, "", False, "", True, "OK")
            MyMsg_Box.ShowDialog()
            Exit Sub
        End If
        Choix_AMC_TypeContrat.AmC_Contrat_TypeTableAdapter1.Insert(Format(Now, "yyyyMMddHHmmss"), intitulé_TextBox.Text, Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), _
                                                                   Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), _
                                                                   Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(PH7_TextBox3.Text), _
                                                                   Val(PH1_TextBox1.Text), Val(PH2_TextBox1.Text), Val(PH4_TextBox2.Text), Val(PH7_TextBox3.Text), Val(Autres_TextBox4.Text), 0, _
                                                                   Val(Autres_TextBox4.Text), Val(PH2_TextBox1.Text), Val(PH4_TextBox2.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), _
                                                                   Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), _
                                                                   Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), _
                                                                   Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), _
                                                                   Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), Val(Autres_TextBox4.Text), _
                                                                   Val(Autres_TextBox4.Text), "0", 100)
        Me.Close()
    End Sub
End Class