' 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 Dp_recueil_consentement



    Private Sub Dp_recueil_consentement_Load(sender As Object, e As EventArgs) Handles Me.Load
        Label1.Text = "STATUT DP: " & Chr(10) & COMPTOIR_MAIN.DP_LinkLabel.Text & Chr(10) & COMPTOIR_MAIN.DP_ToolTip.GetToolTip(COMPTOIR_MAIN.DP_LinkLabel)
        Label1.Focus()

    End Sub

    Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        Dim answer As DialogResult
        Dim confirmation As New DP_Confirmation
        confirmation.label_text = "Confirmez-vous l’ACCEPTATION de création du DP par ce patient ?"
        answer = confirmation.ShowDialog
        If answer = Windows.Forms.DialogResult.Yes Then
            DP.Write_Trace_Fonc("Proposition de création d’un DP", "", "Création acceptée", DP.Identifiant_patient_function)
            Me.DialogResult = Windows.Forms.DialogResult.Yes
            Me.Close()
        End If
    End Sub

    Private Sub LinkLabel2_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked
        Me.DialogResult = Windows.Forms.DialogResult.Cancel
        DP.Write_Trace_Fonc("Proposition de création d’un DP", "", "Création reportée", DP.Identifiant_patient_function)
        Me.Close()
    End Sub

    Private Sub LinkLabel3_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel3.LinkClicked
        Dim answer As DialogResult
        Dim confirmation As New DP_Confirmation
        confirmation.label_text = "Confirmez-vous le REFUS de création du DP par ce patient ?"
        answer = confirmation.ShowDialog
        If answer = Windows.Forms.DialogResult.Yes Then
            DP.Write_Trace_Fonc("Proposition de création d’un DP", "", "Création refusée", DP.Identifiant_patient_function)
            Me.DialogResult = Windows.Forms.DialogResult.No
            Me.Close()
        End If
    End Sub
End Class