/* private void doc(object sender, RoutedEventArgs e)
         * {
         *   page.listBox.SelectedIndex = page.listBox.Items.Count - 1;
         *   Add_doc win = new Add_doc(id_user, page.listBox.Items.Count - 1);
         *   win.Show();
         * }*/


        /* private void ajouter(object sender, RoutedEventArgs e)
         * {
         *   if (eve == null)
         *   {
         *       this.eve = new event_class();
         *       Alerte win = new Alerte(this, id_user,true);
         *   }
         * }*/

        private void alert_Click(object sender, RoutedEventArgs e)
        {
            if (eve == null)
            {
                if (new_eve.get_alerte() == null)
                {
                    Alerte win = new Alerte(this, id_user, true);
                    win.Show();
                    this.Hide();
                }
                else
                {
                    modif_alerte win = new modif_alerte(new_eve.get_alerte(), new_eve, id_user, this);
                    win.Show();
                    this.Hide();
                }
            }
            else
            {
                if (eve.get_alerte() != null)
                {
                    modif_alerte win = new modif_alerte(eve.get_alerte(), eve, eve.getId(), this);
                    win.Show();
                    this.Hide();
                }
                else
                {
                    Alerte win = new Alerte(this, id_user, false);
                    win.Show();
                    this.Hide();
                }
            }
        }
        private void ajouter_tache_Click(object sender, RoutedEventArgs e)
        {
            DateTime d = Convert.ToDateTime(dateDatePicker.Text + " " + débutTimePicker.Text);
            DateTime f = Convert.ToDateTime(dateDatePicker.Text + " " + finTimePicker.Text);



            t.update(designation.Text, prio.Text, d, f, "non réalisée");

            Alerte al = new Alerte(t, this, id_user);

            al.Show();
            this.Hide();
        }
 private void alert_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(designation.Text))
     {
         er.Visibility = System.Windows.Visibility.Visible;
     }
     else
     {
         if (this.t.get_alert() == null)
         {
             Alerte win = new Alerte(t, this, id_user);
             win.Show();
             this.Hide();
         }
         else
         {
             modif_alerte win = new modif_alerte(this.t, this, this.id_user);
             win.Show();
             this.Hide();
         }
     }
 }