Play Console and others

This commit is contained in:
2024-09-15 23:51:32 +02:00
parent d54c71a037
commit 17bc9ed190
17 changed files with 325 additions and 98 deletions

View File

@@ -15,23 +15,18 @@ namespace Jugenddienst_Stunden.ViewModels {
public string Surname => AppInfo.VersionString;
public string MoreInfoUrl => "https://aka.ms/maui";
public string Message => "Hier werden deine geleisteten Arbeitsstunden aufgelistet";
public string LoadOverview => "Lade Summen für " + DateTime.Today.ToString("MMMM");
public static DateTime GetDay = DateTime.Today;
public string ShowDay => "Zeit an Tag " + GetDay.ToString("ddd d. MMM") + ": ";
public int id { get; set; }
public ICommand SelectEntryCommand { get; }
public ICommand LoadDataCommand { get; private set; }
public object Stunden { get; }
public static int GetDay = DateTime.Today.Day;
public string ShowDay => "Zeit an Tag " + GetDay + ": ";
/* Nicht gemergte Änderung aus Projekt "Jugenddienst Stunden (net8.0-ios)"
Vor:
private Models.Hours _hour;
public Models.Hours Hours {
get => _hour;
Nach:
private Hours _hour;
public Hours Hours {
get => _hour;
*/
private Types.Hours _hour;
public Types.Hours Hours {
get => _hour;
@@ -52,6 +47,10 @@ namespace Jugenddienst_Stunden.ViewModels {
get => _hour.overtime_month;
}
public List<DayTime> DayTimes {
get => _hour.daytime;
}
public DateTime MinimumDate {
//get => _hour.MinDate;
//get => DateTime.Today.AddDays(-21);
@@ -69,12 +68,13 @@ namespace Jugenddienst_Stunden.ViewModels {
set {
if (dateToday != value) {
dateToday = value;
GetDay = dateToday.Day;
GetDay = value;
OnPropertyChanged();
_ = LoadDay(value); // Use discard operator to explicitly ignore the returned Task
//RefreshProperties();
//RefreshProperties();
OnPropertyChanged(nameof(TimeDay));
OnPropertyChanged(nameof(ShowDay));
OnPropertyChanged(nameof(DayTimes));
}
}
}
@@ -83,9 +83,6 @@ namespace Jugenddienst_Stunden.ViewModels {
get => _hour.Date;
}
//public Dictionary<int, decimal> ZeitTotalDaily {
// get => _hour.zeit_total_daily;
//}
public List<TimeDay> ZeitTotalDaily {
get => _hour.zeit_total_daily_api;
@@ -133,20 +130,24 @@ namespace Jugenddienst_Stunden.ViewModels {
_hour = new Types.Hours();
LoadDataCommand = new AsyncRelayCommand(LoadData);
SelectEntryCommand = new AsyncRelayCommand<ViewModels.StundeViewModel>(SelectEntryAsync);
}
//protected void OnPropertyChanged(string propertyName) {
// PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
//}
private async Task SelectEntryAsync(ViewModels.StundeViewModel entry) {
if (entry != null)
await Shell.Current.GoToAsync($"{nameof(Views.StundePage)}?load={entry.id}");
}
//public async Task LoadData() =>
// await Models.Stunde.LoadData();
public event EventHandler<string> AlertEvent;
public async Task LoadData() {
try {
_hour = await Models.Stunde.LoadData();
RefreshProperties();
} catch (Exception e) {
AlertEvent?.Invoke(this, e.Message);
}
@@ -156,8 +157,11 @@ namespace Jugenddienst_Stunden.ViewModels {
try {
_hour = await Models.Stunde.LoadDay(date);
if (_hour.zeit_total_daily_api != null) {
TimeDay = _hour.zeit_total_daily_api.Where(static p => p.Day == GetDay).ToList() ?? new List<TimeDay> { new TimeDay { Day = GetDay, Hours = 0 } };
RefreshProperties();
TimeDay = _hour.zeit_total_daily_api.Where(static p => p.Day == GetDay.Day).ToList() ?? new List<TimeDay> { new TimeDay { Day = GetDay.Day, Hours = 0 } };
//RefreshProperties();
OnPropertyChanged(nameof(ShowDay));
OnPropertyChanged(nameof(TimeDay));
OnPropertyChanged(nameof(DayTimes));
}
} catch (Exception e) {
AlertEvent?.Invoke(this, e.Message);