2019-01-19 11:04:17 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using ProjetTheAlone.Classes;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
|
|
|
|
namespace ProjetTheAlone.ViewModel
|
|
|
|
|
{
|
|
|
|
|
public class RepaModel : INotifyPropertyChanged
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private string quand;
|
|
|
|
|
private ObservableCollection<C_T_plat> listPlat = new ObservableCollection<C_T_plat>();
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<C_T_plat> ListPlat { get => listPlat; set { listPlat = value; OnPropertyChanged("ListPlat"); OnPropertyChanged("Plat1"); OnPropertyChanged("Plat2"); OnPropertyChanged("Plat3"); } }
|
2019-01-24 22:24:05 +01:00
|
|
|
|
private C_T_plat plat1, plat2, plat3;
|
|
|
|
|
public C_T_plat Plat1 { get => plat1; set { plat1 = value; OnPropertyChanged("Plat1"); } }
|
|
|
|
|
public C_T_plat Plat2 { get => plat2; set { plat2 = value; OnPropertyChanged("Plat2"); } }
|
|
|
|
|
public C_T_plat Plat3 { get => plat3; set { plat3 = value; OnPropertyChanged("Plat3"); } }
|
2019-01-19 11:04:17 +01:00
|
|
|
|
public string Quand { get => quand; set { quand = value; OnPropertyChanged("Quand"); } }
|
|
|
|
|
|
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
|
protected void OnPropertyChanged(string name)
|
|
|
|
|
{
|
|
|
|
|
PropertyChangedEventHandler handler = PropertyChanged;
|
|
|
|
|
if (handler != null)
|
|
|
|
|
{
|
|
|
|
|
handler(this, new PropertyChangedEventArgs(name));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public RepaModel()
|
|
|
|
|
{
|
|
|
|
|
|
2019-01-24 22:24:05 +01:00
|
|
|
|
}
|
|
|
|
|
public RepaModel(DateTime d)
|
|
|
|
|
{
|
|
|
|
|
ListPlat = new ObservableCollection<C_T_plat>(new Gestion.G_T_repa(Config.Settings1.Default.schCon).Lire(d) as List<C_T_plat>);
|
2019-01-27 10:22:31 +01:00
|
|
|
|
Plat1 = (ListPlat.Count > 0) ? ListPlat[0] : new C_T_plat();
|
|
|
|
|
Plat2 = (ListPlat.Count > 1) ? ListPlat[1] : new C_T_plat();
|
|
|
|
|
Plat3 = (ListPlat.Count > 2) ? ListPlat[2] : new C_T_plat();
|
|
|
|
|
Quand = d.ToShortDateString();
|
2019-01-19 11:04:17 +01:00
|
|
|
|
}
|
|
|
|
|
public RepaModel(ObservableCollection<C_T_plat> ListPlat, string quand)
|
|
|
|
|
{
|
|
|
|
|
this.ListPlat = ListPlat;
|
|
|
|
|
this.Quand = quand;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|