public planning(utilisateur user) { this.user = user; InitializeComponent(); PlanningSemaine.SelectedDate = DateTime.Now; PlanningMonth.SelectedDate = DateTime.Now; PlanningJour.SelectedDate = DateTime.Now; SqlConnection connexion = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\bdd.mdf;Integrated Security=True"); connexion.Open(); SqlCommand cmd = new SqlCommand("Select * from Tâche where id_utilis='" + user.getid_utilis() + "'", connexion); SqlDataReader lecteur = cmd.ExecuteReader(); while (lecteur.Read()) { Event t = new Event() { Subject = lecteur["designation"].ToString(), Priorité = lecteur["priorité"].ToString().ToUpper(), Description = lecteur["etat"].ToString(), Color = solide, Start = (DateTime)lecteur["date"], End = (DateTime)lecteur["fin"] }; PlanningSemaine.AddEvent(t); PlanningJour.AddEvent(t); PlanningMonth.AddEvent(t); } connexion.Close(); SqlConnection connex = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\bdd.mdf;Integrated Security=True"); connex.Open(); SqlCommand cmd1 = new SqlCommand("Select * from évènement where id_utilis='" + user.getid_utilis() + "'", connex); SqlDataReader lecteur1 = cmd1.ExecuteReader(); while (lecteur1.Read()) { Event t = new Event() { Subject = lecteur1["designation"].ToString(), Description = lecteur1["lieu"].ToString(), Color = sol, Start = (DateTime)lecteur1["date"], End = (DateTime)lecteur1["fin"] }; // t.setColor(); //scheduler1.AddEvent(t); PlanningSemaine.AddEvent(t); PlanningJour.AddEvent(t); PlanningMonth.AddEvent(t); } //s.WeekScheduler*/ }
private void NextMonth(object sender, RoutedEventArgs e) { PlanningMonth.NextPage(); }
private void PrevMonth(object sender, RoutedEventArgs e) { PlanningMonth.PrevPage(); }