Révision 957bebf1 GES_PAC/ViewModel/MainViewModel.cs
GES_PAC/ViewModel/MainViewModel.cs | ||
---|---|---|
12 | 12 |
private string _currentDayText; |
13 | 13 |
#endregion |
14 | 14 |
|
15 |
|
|
16 |
|
|
17 | 15 |
#region Commandes |
18 | 16 |
public ICommand GoToCreateDayCommand { get; } |
19 | 17 |
public ICommand ResumeDayCommand { get; } |
18 |
public ICommand ExportDataCommand { get; } |
|
20 | 19 |
#endregion |
21 | 20 |
|
22 | 21 |
#region Propriétés |
... | ... | |
53 | 52 |
public MainViewModel() |
54 | 53 |
{ |
55 | 54 |
//ONLY FOR TESTS |
56 |
//var date = DateTime.Now;
|
|
57 |
//var newDay = new Journee(date, PersonViewModel.Instance.Persons[0], PlaceViewModel.Instance.Places[0], "");
|
|
58 |
//newDay.AddSet(new Serie(date, date, 25, 25, 25));
|
|
59 |
//newDay.AddCalibration(new MesureCalibration(date, 50, 40, 500, TypeCalibration.Air, ""), PhaseCalibration.Debut);
|
|
60 |
//newDay.AddCalibration(new MesureCalibration(date, 0, 0, 1000000, TypeCalibration.Methane, "dazdazd"), PhaseCalibration.Debut);
|
|
61 |
//newDay.AddCalibration(new MesureCalibration(date, 30, 30, 3000, TypeCalibration.Melange, "deqsfsdf"), PhaseCalibration.Debut);
|
|
62 |
//newDay.GetCurrentSet().AddSerieAnimal(new SerieAnimal(1, 500, date, ""));
|
|
63 |
//newDay.GetCurrentSet().AddMeasure(new Mesure(date, 50, 50, 50), 1, false);
|
|
64 |
//JourneeViewModel.Instance.Journees.Add(newDay);
|
|
55 |
var date = DateTime.Now; |
|
56 |
var newDay = new Journee(date, PersonViewModel.Instance.Persons[0], PlaceViewModel.Instance.Places[0], ""); |
|
57 |
newDay.AddSet(new Serie(date, date, 25, 25, 25)); |
|
58 |
newDay.AddCalibration(new MesureCalibration(date, 50, 40, 500, TypeCalibration.Air, ""), PhaseCalibration.Debut); |
|
59 |
newDay.AddCalibration(new MesureCalibration(date, 0, 0, 1000000, TypeCalibration.Methane, "dazdazd"), PhaseCalibration.Debut); |
|
60 |
newDay.AddCalibration(new MesureCalibration(date, 30, 30, 3000, TypeCalibration.Melange, "deqsfsdf"), PhaseCalibration.Debut); |
|
61 |
newDay.GetCurrentSet().AddSerieAnimal(new SerieAnimal(1, 500, date, "")); |
|
62 |
newDay.GetCurrentSet().AddMeasure(new Mesure(date, 50, 50, 50), 1, false); |
|
63 |
JourneeViewModel.Instance.Journees.Add(newDay); |
|
65 | 64 |
//ONLY FOR TESTS |
66 | 65 |
|
67 | 66 |
GoToCreateDayCommand = new Command(async () => await GoToCreateDayPage()); |
68 | 67 |
ResumeDayCommand = new Command(async () => await ResumeDay()); |
68 |
ExportDataCommand = new Command(async () => await ExportData()); |
|
69 | 69 |
|
70 | 70 |
GetLastDay(); |
71 | 71 |
} |
... | ... | |
100 | 100 |
|
101 | 101 |
await Shell.Current.GoToAsync(targetView); |
102 | 102 |
IsBusy = false; |
103 |
} |
|
104 |
private async Task ExportData() |
|
105 |
{ |
|
106 |
if (IsBusy) return; |
|
107 |
IsBusy = true; |
|
108 |
await Shell.Current.GoToAsync(nameof(ExportDataView)); |
|
109 |
IsBusy = false; |
|
103 | 110 |
} |
104 | 111 |
#endregion |
105 | 112 |
} |
Formats disponibles : Unified diff