private void ModifySeancesBoxes(int i, Seance s) { if (s == null) { descriptionBoxes[i].Text = ""; titlesBoxes[i].Text = ""; priorityCBs[i].SelectedIndex = -1; beginPickers[i].SelectedTime = null; endPickers[i].SelectedTime = null; return; } descriptionBoxes[i].Text = s.description; titlesBoxes[i].Text = s.name; switch (s.priority) { case "Urgente": priorityCBs[i].SelectedIndex = 0; break; case "Normale": priorityCBs[i].SelectedIndex = 1; break; case "Basse": priorityCBs[i].SelectedIndex = 2; break; } beginPickers[i].SelectedTime = s.begin; endPickers[i].SelectedTime = s.end; }
public void SetSeance(DayOfWeek d, int nbSeance, Seance seance) { if (!this.user.Planning.ContainsKey(d)) { this.user.Planning[d] = new Dictionary <int, Seance>(); } this.user.Planning[d][nbSeance] = seance; }
public static Tache ConvertFromSeanceToTache(Seance s, DateTime day) { Tache t = new Tache(); t.title = s.name; t.Details = s.description; t.dateDebut = new DateTime(day.Year, day.Month, day.Day, s.begin.Hour, s.begin.Minute, s.begin.Second); t.dateFin = new DateTime(day.Year, day.Month, day.Day, s.end.Hour, s.end.Minute, s.end.Second); t.priorite = s.priority; t.Activitee = "Activité scolaire"; return(t); }
private void RetainSeances() { for (int i = 0; i < 7; ++i) { if (titlesBoxes[i].Text == "" || priorityCBs[i].SelectedIndex == -1 || beginPickers[i].SelectedTime == null || endPickers[i].SelectedTime == null) { continue; } Seance seance = new Seance() { name = titlesBoxes[i].Text, description = descriptionBoxes[i].Text, priority = (string)((ComboBoxItem)priorityCBs[i].SelectedItem).DataContext, begin = beginPickers[i].SelectedTime.Value, end = endPickers[i].SelectedTime.Value }; DataSupervisor.ds.SetSeance((DayOfWeek)((ComboBoxItem)daySelect.SelectedItem).DataContext, i + 1, seance); } }