Statistiques
| Branche: | Révision:

root / GES_PAC / ViewModel / JourneeViewModel.cs @ 09d4a0de

Historique | Voir | Annoter | Télécharger (1,025 ko)

1 65ad7e66 Lucas Bihannic
using GES_PAC.Model;
2
using System;
3
using System.Collections.Generic;
4
using System.Collections.ObjectModel;
5
using System.Linq;
6
using System.Text;
7
using System.Threading.Tasks;
8
9
namespace GES_PAC.ViewModel
10
{
11
    public class JourneeViewModel
12
    {
13 18f910c6 Lucas Bihannic
        #region Attributs
14 65ad7e66 Lucas Bihannic
        private static JourneeViewModel _instance;
15 18f910c6 Lucas Bihannic
        #endregion
16
17
        #region Propriétés
18
        public ObservableCollection<Journee> Journees { get; set; } = new();
19 65ad7e66 Lucas Bihannic
        public static JourneeViewModel Instance => _instance ??= new JourneeViewModel();
20 18f910c6 Lucas Bihannic
        #endregion
21 65ad7e66 Lucas Bihannic
22 5d673ce0 Lucas Bihannic
        #region Constructeurs
23 65ad7e66 Lucas Bihannic
        private JourneeViewModel() { }
24 18f910c6 Lucas Bihannic
        #endregion
25 5d673ce0 Lucas Bihannic
26
        #region Méthodes
27
        public Journee GetCurrentDay()
28
        {
29
            DateTime today = DateTime.Today;
30
            return Journees.FirstOrDefault(j => j.Date.Date == today);
31
        }
32 09d4a0de lbihannic
        public PhaseCalibration GetCurrentPhase()
33
        {
34
            var journeeActuelle = GetCurrentDay();
35
            return journeeActuelle.GetCurrentPhase();
36
        }
37 5d673ce0 Lucas Bihannic
        #endregion
38 65ad7e66 Lucas Bihannic
    }
39
}