/* 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();
                }
            }
        }
Пример #2
0
        private void modifyAlert_Click(object sender, RoutedEventArgs e)
        {
            Button btn = (Button)sender;

            if (btn != null)
            {
                var st = FindParent <Grid>(btn); //stackpanel as we have added item as stackpanel.
                if (st != null)
                {
                    int          index = listBox.Items.IndexOf(st);
                    modif_alerte win   = new modif_alerte(list[index], user.getid_utilis(), this);
                    win.Show();
                }
            }
        }
 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();
         }
     }
 }