private void add_rdv(ref int idrdv) { verifier(ref boool); idrdv = -1; if (boool) { this.Dte_rdv = DateTime.Parse(Daterdv_Datepicker.Text); this.heur_rdv = int.Parse(heur_combo.Text); this.min_rdv = int.Parse(min_combo.Text); DateTime abc = new DateTime(Dte_rdv.Year, Dte_rdv.Month, Dte_rdv.Day, heur_rdv, min_rdv, 00); Dte_rdv = abc; this.lieu_rdv = lieu_textbox.Text; this.cmnt_rdv = cmnt_textbox.Text; if (import_checkbox.IsChecked == true) { this.important = 1; } else { this.important = 0; } Rdv = new Rendez_Vous(abc, important, cmnt_rdv, lieu_rdv); RdvAsuppr rdvasup = new RdvAsuppr(Rdv.get_Id_RDV(), Dte_rdv); App.acc.listasupp.Add(rdvasup); recherche_rdv(ref count); if (!count) { Rdv.Ajouter_RDV(); Insert_av_rdv(); idrdv = Rdv.get_Id_RDV(); } else if (count) { rdv_exst.Visibility = System.Windows.Visibility.Visible; Recrdv_exst.Visibility = System.Windows.Visibility.Visible; RdvGrd.IsEnabled = false; heur_combo.Text = null; min_combo.Text = null; Daterdv_Datepicker.Text = null; } } else { Stacknonremp.Visibility = System.Windows.Visibility.Visible; RecStacknonremp.Visibility = System.Windows.Visibility.Visible; RdvGrd.IsEnabled = false; } }
private void add_rdv() { verifier(ref boool); if (boool) { this.Dte_rdv = DateTime.Parse(date_rdv.Text); this.heur_rdv = int.Parse(heur_combo.Text); this.min_rdv = int.Parse(min_combo.Text); DateTime abc = new DateTime(Dte_rdv.Year, Dte_rdv.Month, Dte_rdv.Day, heur_rdv, min_rdv, 00); Dte_rdv = abc; this.lieu_rdv = lieu_box.Text; this.cmnt_rdv = cmnt_box.Text; if (imp_checkbox.IsChecked == true) { this.important = 1; } else { this.important = 0; } Rdv = new Rendez_Vous(Dte_rdv, important, cmnt_rdv, lieu_rdv); recherche_rdv(ref count); if (!count) { Rdv.Ajouter_RDV(); Insert_av_rdv(); } else if (count) { rdv_exst.Visibility = System.Windows.Visibility.Visible; Recrdv_exst.Visibility = System.Windows.Visibility.Visible; Stack_rdv.IsEnabled = false; } } else { Stacknonremp.Visibility = System.Windows.Visibility.Visible; RecStacknonremp.Visibility = System.Windows.Visibility.Visible; Stack_rdv.IsEnabled = false; AffichageStack.IsEnabled = false; } }