using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using ProjetTheAlone.Classes; using ProjetTheAlone.Gestion; namespace ProjetTheAlone.ViewModel { public class EventDGV_VM : BasePropriete { string chConn = Config.Settings1.Default.schCon; string date; ObservableCollection bcpEvent; public ObservableCollection BcpEvent { get => bcpEvent; set => bcpEvent = value; } public string Date { get => date; set => base.AssignerChamp(ref date, value, "Date"); } public EventDGV_VM() { BcpEvent = chargerEventOfTheDay(DateTime.Now); } public EventDGV_VM(DateTime date) { BcpEvent = chargerEventOfTheDay(date); Date = date.ToShortDateString(); } private ObservableCollection chargerEventOfTheDay(DateTime date) { ObservableCollection rep = new ObservableCollection(); List lTmp = new G_T_event(chConn).Lire(date); foreach (C_T_event Tmp in lTmp) rep.Add(Tmp); return rep; } } public class unEvent : BasePropriete { C_T_event evenment; public unEvent() { } public C_T_event Evenment { get => evenment; set => evenment = value; } public string AffichageDetail { get => $"{new G_T_typeEvenement(Config.Settings1.Default.schCon).Lire_ID(Evenment.ID_typeEvenement.Value)} " + $"le {Evenment.E_date} pandant {Evenment.E_duree}"; } } }