Révision e837cdf1 GES_PAC/Model/SerieAnimal.cs

Voir les différences:

GES_PAC/Model/SerieAnimal.cs
38 38
        {
39 39
            return Mesures.Last();
40 40
        }
41
        public Mesure GetFirstMeasure()
42
        {
43
            return Mesures.First();
44
        }
41 45

  
42 46
        public void AddBehaviour(Comportement newBehaviour)
43 47
        {
......
46 50

  
47 51
        public bool HasBehaviour()
48 52
        {
49
            return Comportements.Any();
53
            return Comportements.Count != 0;
54
        }
55
        public string GetTimeInChamber()
56
        {
57
            if (Mesures.Count == 0)
58
                return "";
59

  
60
            TimeSpan timeInChamber;
61
            if (IsOut)
62
                timeInChamber = GetLastMeasure().Time - GetFirstMeasure().Time;
63
            else
64
                timeInChamber = DateTime.Now - GetFirstMeasure().Time;
65

  
66
            return $"{timeInChamber.Hours:00}:{timeInChamber.Minutes:00}";
50 67
        }
51 68
    }
52 69
}

Formats disponibles : Unified diff