private void valider_Click(object sender, RoutedEventArgs e) { if (Date.Text != "" && music.Text != "") { if (Date.Value <= DateTime.Now) { System.Windows.Forms.MessageBox.Show("Vous ne pouvez pas insérer une alerte avec une date antérieure"); } else { methodes m = new methodes(); alerte_class alerte = new alerte_class(music.Text, id_user, 0, Convert.ToDateTime(Date.Text), true); if (t == null) { if (new_event) { eve.set_alarm_tonew_event(alerte); } else { eve.set_alarm_event(alerte); } eve.Show(); this.Close(); } else { if (this.m == null) { page.set_alarm(alerte); page.Show(); this.Close();/*ajouter une tacha*/ } else { alerte.setidtach(this.t.get_id()); this.m.set_alarm(alerte); this.m.Show(); this.Close(); /*modifier une tache*/ } } // System.Windows.Forms.MessageBox.Show(alerte.gettemps().ToString("yyyy-MM-ddTHH:mm:ss")+" " + ta.textBox.Text+" "+ Convert.ToDateTime(ta.temps_tache.Text).ToString("yyyy-MM-ddTHH:mm:ss")); } } else { System.Windows.Forms.MessageBox.Show("Veuillez donner des informations"); } }
private void valid_alert_event(alerte_class alerte) { methodes meth = new methodes(); if (addev == null) { /* if (evenements == null) * { * * page.Show(); page.set_alarm(alerte); this.Close(); * } * else * {*/ alerte.setidalerte((eve.get_alerte()).getidalerte()); alerte.setidutilis(eve.getIdUtilis()); alerte.setidévèn(eve.getId()); eve.set_alerte(alerte); (eve.get_alerte()).Modifier_aler_even_bdd((eve.get_alerte()).getidalerte(), (eve.get_alerte())); meth.supprimer_alerte_planifiée(eve.getDesig()); meth.Creer_tache_planif(alerte, eve.getDesig(), eve.getDate(), "e"); evenements.clear_listbox(); evenements.afficher(evenements.get_list()); this.Close(); //} } else { if (eve.getId() > 0) { alerte.setidalerte((eve.get_alerte()).getidalerte()); alerte.setidévèn(eve.getId()); addev.set_alarm_event(alerte); addev.Show(); } else { addev.Show(); addev.set_alarm_event(alerte); this.Close(); } this.Close(); } }
private void modif_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); AddEvent win = new AddEvent(list[index], this); win.Show(); } } }
private void add_Click(object sender, RoutedEventArgs e) { AddEvent win = new AddEvent(user.getid_utilis(), this); win.Show(); }