Révision a7fee243

Voir les différences:

GES_PAC/GES_PAC.csproj
29 29
		<ApplicationId>fr.inrae.GES_PAC</ApplicationId>
30 30

  
31 31
		<!-- Versions -->
32
		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
32
		<ApplicationDisplayVersion>0.1.0</ApplicationDisplayVersion>
33 33
		<ApplicationVersion>1</ApplicationVersion>
34 34

  
35 35
		<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
......
140 140
	</ItemGroup>
141 141

  
142 142
	<ItemGroup>
143
	  <Folder Include="Libs\" />
144
	</ItemGroup>
145

  
146
	<ItemGroup>
147 143
	  <Reference Include="SicpaJWT">
148 144
	    <HintPath>Libs\SicpaJWT.dll</HintPath>
149 145
	  </Reference>
146
	  <Reference Include="SicpaMAUIDevice">
147
	    <HintPath>Libs\SicpaMAUIDevice.dll</HintPath>
148
	  </Reference>
150 149
	</ItemGroup>
151 150

  
152 151
</Project>
GES_PAC/View/CreateDayView.xaml
92 92

  
93 93
                <VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Center">
94 94
                    <ActivityIndicator IsRunning="True" Color="White" />
95
                    <Label Text="Chargement..."
95
                    <Label Text="Téléchargement des données..."
96 96
                            FontSize="14"
97 97
                            TextColor="white"
98 98
                            HorizontalOptions="Center"/>
GES_PAC/View/EnterAnimalView.xaml
43 43
                                    Text="Charger"
44 44
                                    Command="{Binding LoadWeightCommand}"
45 45
                                    Style="{StaticResource btnNormal}"
46
                                    IsEnabled="{Binding IsFormValid}"
46
                                    IsEnabled="{Binding IsLoadEnable}"
47 47
                                    VerticalOptions="End"/>
48 48
                            </Grid>
49 49
                            <Label Text="{Binding DatePesee}"
50
                                HorizontalOptions="Center" />
50
                                TextColor="{Binding DateColor}"
51
                                Margin="75,0,0,0"
52
                                HorizontalOptions="Start" />
51 53
                        </VerticalStackLayout>
52 54

  
53 55
                        
GES_PAC/ViewModel/CreateDayViewModel.cs
100 100
                    IsBusy = false;
101 101
                    return;
102 102
                }
103
                App.Db.Animal.RemoveRange(App.Db.Animal);
103 104
                    
104 105
            }
105 106

  
GES_PAC/ViewModel/EnterAnimalViewModel.cs
15 15
        private double? _poids;
16 16
        private DateOnly? _datePesee;
17 17
        private bool _isFormValid;
18
        private bool _isLoadEnable;
19
        private Color _dateColor;
18 20
        #endregion
19 21

  
20 22
        #region Commandes
......
43 45
            {
44 46
                _numrfid = value;
45 47
                OnPropertyChanged();
48
                DatePesee = null;
46 49
                ValidateForm();
47 50
            }
48 51
        }
......
77 80
                OnPropertyChanged();
78 81
            }
79 82
        }
83
        public bool IsLoadEnable
84
        {
85
            get => _isLoadEnable;
86
            set
87
            {
88
                _isLoadEnable = value;
89
                OnPropertyChanged();
90
            }
91
        }
92
        public Color DateColor
93
        {
94
            get => _dateColor;
95
            set
96
            {
97
                _dateColor = value;
98
                OnPropertyChanged();
99
            }
100
        }
80 101

  
81 102
        public bool NumRFIDError { get; private set; } = true;
82 103
        public string Titre => $"Informations animal chambre {ChamberId}";
......
112 133
        {
113 134
            NumRFIDError = NumRFID == null || NumRFID.Length < 5;
114 135

  
136
            IsLoadEnable = !NumRFIDError && App.Db.Animal.Any(a => a.Rfid.EndsWith(NumRFID));
137

  
115 138
            OnPropertyChanged(nameof(NumRFIDError));
116 139

  
117 140
            IsFormValid = !NumRFIDError;
......
125 148
            NumRFID = animal?.Rfid ?? "";
126 149
            Poids = animal?.Poids / 1000;
127 150
            DatePesee = DateOnly.FromDateTime(animal?.DateDernierePesee ?? default);
151
            DateColor = animal?.DateDernierePesee >= DateTime.Now.AddDays(-14) ? Colors.Green : Colors.Orange;
128 152
        }
129 153

  
130 154
        #endregion
GES_PAC/ViewModel/JourneeViewModel.cs
55 55
        }
56 56
        public Journee? GetCurrentDay()
57 57
        {
58
            DateTime today = DateTime.Today;
59
            var lastDay = Journees.LastOrDefault(j => j.Date.Date == today);
58
            var lastDay = Journees.LastOrDefault();
60 59
            if (lastDay == null || lastDay.IsComplete())
61 60
                return null;
62 61
            return lastDay;

Formats disponibles : Unified diff