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 loadRdvasupp() { ConnexionBDD Datab = new ConnexionBDD(); Datab.connecter(); String Command = @"select Id_RDV,Date_Rdv from [Rendez-vous]"; SqlCommand Macmd = new SqlCommand(Command, Datab.cnx); SqlDataReader dr = Macmd.ExecuteReader(); DateTime dt; int id; while (dr.Read()) { id = int.Parse(dr[0].ToString()); dt = DateTime.Parse(dr[1].ToString()); RdvAsuppr rdv = new RdvAsuppr(id, dt); listasupp.Add(rdv); } Datab.deconnecter(); }