' 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
Public Class DP_Attestation_info



    Private Sub DP_Attestation_info_Load(sender As Object, e As EventArgs) Handles Me.Load
        If Trace_Appel_Fonctions = True Then
            Using sw As New StreamWriter(Application.StartupPath + "\traces\appels_fonctions.txt", True)
                sw.WriteLine(Me.Name + " / " + System.Reflection.MethodInfo.GetCurrentMethod.ToString + " (called by " + (New System.Diagnostics.StackTrace).GetFrame(1).GetMethod.Name + ")")
            End Using
        End If

        RectangleShape1.Width = Me.Width - 6 '1274
        RectangleShape1.Height = Me.Height - 6 '1018
        nom_prénom_TextBox1.Text = COMPTOIR_MAIN.ComboBoxLECTURE_VITALE.Text
        né_le_TextBox2.Text = Mid(CurrentBenéficiaire.G104C12, 7, 2) + "/" + Mid(CurrentBenéficiaire.G104C12, 5, 2) + "/" + Mid(CurrentBenéficiaire.G104C12, 1, 4)
        adresse_TextBox3.Text = CurrentBenéficiaire.G104C4 + " " + CurrentBenéficiaire.G104C5 + " " + CurrentBenéficiaire.G104C6 + " " + CurrentBenéficiaire.G104C7 + " " + CurrentBenéficiaire.G104C8
        pharmacie_TextBox8.Text = Config.Titulaire_raison_sociale
        le_TextBox7.Text = Format(Now, "dd/MM/yyyy")
    End Sub

    Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click


        COMPTOIR_MAIN.DP_form.je_soussigné = je_soussigné_TextBox5.Text
        COMPTOIR_MAIN.DP_form.pharmacie = pharmacie_TextBox8.Text
        COMPTOIR_MAIN.DP_form.fait_a = fait_a_TextBox4.Text
        COMPTOIR_MAIN.DP_form.reprleg_nom_prénom = reprleg_nom_prénomTextBox12.Text
        COMPTOIR_MAIN.DP_form.reprleg_qualité = reprleg_qualité_TextBox13.Text
        COMPTOIR_MAIN.DP_form.reprleg_adresse = reprleg_adresse_TextBox14.Text
        Me.Close()
    End Sub

    Private Sub PictureBox1_MouseHover(sender As Object, e As EventArgs) Handles PictureBox1.MouseHover
        PictureBox1.BackgroundImage = officine.My.Resources.validate2
    End Sub

    Private Sub PictureBox1_MouseLeave(sender As Object, e As EventArgs) Handles PictureBox1.MouseLeave
        PictureBox1.BackgroundImage = officine.My.Resources.validate
    End Sub
End Class