using projet.Controller;
using projet.modele;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace projet.View
{
    public partial class ConfirmeSupressionPersonnel : Form
    {
        private ConfirmeSupressionPersonnelController controller;
        private Personnel personne;
        public ConfirmeSupressionPersonnel(Personnel personne)
        {
            Init();
            InitializeComponent();
            this.personne = personne;
            labelTitle.Text = $"Voulez vous vraiment supprimer : {personne} ?";
        }

        public void Init()
        {
            controller = new ConfirmeSupressionPersonnelController();
        }

        private void buttonAnnuler_Click(object sender, EventArgs e)
        {
            this.Hide();
            this.Close();
            Admin admin = new Admin();
            admin.ShowDialog();
        }

        private void buttonConfirmer_Click(object sender, EventArgs e)
        {
            controller.deletePersonnel(personne);
            this.Hide();
            this.Close();
            Admin admin = new Admin();
            admin.ShowDialog();
        }
    }
}
