Vorbereitungen für 1.0.6
Beachte die Einstellung ob Projekte und Gemeinden aktiv sind. Verbiete Änderungen an der Freistellung, wenn sie genehmigt wurde. Vereinfache das Speichern der Einstellungen Bessere Fehlerbehandlung, einheitlichere API
This commit is contained in:
@@ -20,18 +20,21 @@ public static class MauiProgram {
|
||||
.UseBarcodeReader();
|
||||
|
||||
#if DEBUG
|
||||
//Preferences.Default.Set("apiKey", "M3xneWlWNG85TmNIcmo1NnpxWkxVYS9JMDBFRlV8aHR0cDovL2hvdXJzLmRhdW5pLm1pbmUubnU6ODEvYXBwYXBp");
|
||||
//Preferences.Default.Set("name", "Testserver: Lea");
|
||||
//Preferences.Default.Set("surname", "Mair");
|
||||
//Preferences.Default.Set("EmployeeId", 3);
|
||||
//Preferences.Default.Set("apiUrl", "http://hours.dauni.mine.nu:81/appapi");
|
||||
HoursBase HoursBase = new HoursBase();
|
||||
HoursBase.apiKey = Preferences.Default.Get("apiKey", "MTQxfHNkdFptQkNZTXlPT3ZyMHNBZDl0UnVxNExMRXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=");
|
||||
HoursBase.name = Preferences.Default.Get("name", "Testserver: Isabell");
|
||||
HoursBase.surname = Preferences.Default.Get("surname", "Biasi");
|
||||
HoursBase.EmployeeId = Preferences.Default.Get("EmployeeId", 141);
|
||||
HoursBase.apiUrl = Preferences.Default.Get("apiUrl", "http://hours.dauni.mine.nu:81/appapi");
|
||||
|
||||
if (GlobalVar.ApiKey == null) {
|
||||
//Preferences.Default.Set("apiKey
|
||||
//Preferences.Default.Set("apiKey", "M3xneWlWNG85TmNIcmo1NnpxWkxVYS9JMDBFRlV8aHR0cDovL2hvdXJzLmRhdW5pLm1pbmUubnU6ODEvYXBwYXBp");
|
||||
//Preferences.Default.Set("name", "Testserver: Lea");
|
||||
//Preferences.Default.Set("surname", "Mair");
|
||||
//Preferences.Default.Set("EmployeeId", 3);
|
||||
//Preferences.Default.Set("apiUrl", "http://hours.dauni.mine.nu:81/appapi");
|
||||
//HoursBase HoursBase = new HoursBase();
|
||||
//HoursBase.tokendata = new TokenData("MTQxfHNkdFptQkNZTXlPT3ZyMHNBZDl0UnVxNExMRXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=");
|
||||
GlobalVar.ApiKey = Preferences.Default.Get("apiKey", "MTQxfHNkdFptQkNZTXlPT3ZyMHNBZDl0UnVxNExMRXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=");
|
||||
GlobalVar.Name = Preferences.Default.Get("name", "Testserver: Isabell");
|
||||
GlobalVar.Surname = Preferences.Default.Get("surname", "Biasi");
|
||||
GlobalVar.EmployeeId = Preferences.Default.Get("EmployeeId", 141);
|
||||
GlobalVar.ApiUrl = Preferences.Default.Get("apiUrl", "http://hours.dauni.mine.nu:81/appapi");
|
||||
}
|
||||
builder.Logging.AddDebug();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using Jugenddienst_Stunden.Types;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
|
||||
@@ -77,8 +75,9 @@ internal static class BaseFunc {
|
||||
// Lesen und Rückgabe der Antwort als String
|
||||
|
||||
string responseData = await HttpContent.ReadAsStringAsync();
|
||||
User userData = System.Text.Json.JsonSerializer.Deserialize<User>(responseData) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
return userData;
|
||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(responseData) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
//User userData = System.Text.Json.JsonSerializer.Deserialize<User>(responseData) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
return res.user;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,7 +89,7 @@ internal static class BaseFunc {
|
||||
|
||||
|
||||
|
||||
internal static HoursBase Load(string filename) {
|
||||
internal static Note Load(string filename) {
|
||||
filename = System.IO.Path.Combine(FileSystem.AppDataDirectory, filename);
|
||||
|
||||
if (!File.Exists(filename))
|
||||
@@ -98,8 +97,6 @@ internal static class BaseFunc {
|
||||
|
||||
return
|
||||
new() {
|
||||
//Filename = Path.GetFileName(filename),
|
||||
//Text = File.ReadAllText(filename),
|
||||
Date = File.GetLastWriteTime(filename)
|
||||
};
|
||||
}
|
||||
@@ -129,11 +126,11 @@ internal static class BaseFunc {
|
||||
}
|
||||
|
||||
//Gemeinde ist ein Pflichtfeld
|
||||
if (item.GemeindeAktiv == null) {
|
||||
if (item.GemeindeAktiv == null && GlobalVar.Settings.GemeindeAktivSet) {
|
||||
throw new Exception("Gemeinde nicht gewählt");
|
||||
}
|
||||
//Projekt ist ein Pflichtfeld
|
||||
if (item.ProjektAktiv == null) {
|
||||
if (item.ProjektAktiv == null && GlobalVar.Settings.ProjektAktivSet) {
|
||||
throw new Exception("Projekt nicht gewählt");
|
||||
}
|
||||
//Keine Beschreibung
|
||||
|
||||
26
Jugenddienst Stunden/Models/GlobalVar.cs
Normal file
26
Jugenddienst Stunden/Models/GlobalVar.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Jugenddienst_Stunden.Types;
|
||||
|
||||
namespace Jugenddienst_Stunden.Models;
|
||||
internal static class GlobalVar {
|
||||
public static string ApiKey {
|
||||
get => Preferences.Default.Get("apiKey", "");
|
||||
set => Preferences.Default.Set("apiKey", value);
|
||||
}
|
||||
public static int EmployeeId {
|
||||
get => Preferences.Default.Get("EmployeeId", 0);
|
||||
set => Preferences.Default.Set("EmployeeId", value);
|
||||
}
|
||||
public static string Name {
|
||||
get => Preferences.Default.Get("name", "Nicht");
|
||||
set => Preferences.Default.Set("name", value);
|
||||
}
|
||||
public static string Surname {
|
||||
get => Preferences.Default.Get("surname", "Eingeloggt");
|
||||
set => Preferences.Default.Set("surname", value);
|
||||
}
|
||||
public static string ApiUrl {
|
||||
get => Preferences.Default.Get("apiUrl", "");
|
||||
set => Preferences.Default.Set("apiUrl", value);
|
||||
}
|
||||
public static Settings Settings { get; set; }
|
||||
}
|
||||
@@ -1,106 +1,61 @@
|
||||
using Jugenddienst_Stunden.Types;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Jugenddienst_Stunden.Models;
|
||||
|
||||
internal class HoursBase {
|
||||
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public static string apiKey = Preferences.Default.Get("apiKey", "");
|
||||
public static int EmployeeId = Preferences.Default.Get("employeeId", 0);
|
||||
public static string name = Preferences.Default.Get("name", "");
|
||||
public static string surname = Preferences.Default.Get("surname", "");
|
||||
public static string apiUrl = Preferences.Default.Get("apiUrl", "");
|
||||
|
||||
internal static TokenData tokendata;
|
||||
internal static class HoursBase {
|
||||
|
||||
/// <summary>
|
||||
/// what can be: settings, hours, date=YYYY-MM-DD, id=<int>
|
||||
/// </summary>
|
||||
internal static async Task<BaseResponse> LoadBase(string what) {
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?"+what, GlobalVar.ApiKey);
|
||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Einstellungen
|
||||
/// </summary>
|
||||
internal async Task<Settings> LoadSettings() {
|
||||
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(tokendata.Url + "?settings", tokendata.ApiKey);
|
||||
|
||||
Settings _settings = JsonConvert.DeserializeObject<Settings>(data);
|
||||
|
||||
return _settings;
|
||||
internal static async Task<Settings> LoadSettings() {
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?settings", GlobalVar.ApiKey);
|
||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
return res.settings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Daten laden
|
||||
/// </summary>
|
||||
internal async Task<Hours> LoadData() {
|
||||
|
||||
Hours hours = new Hours();
|
||||
|
||||
var tokendata = new TokenData(apiKey);
|
||||
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(tokendata.Url + "?hours", tokendata.ApiKey);
|
||||
|
||||
hours = JsonConvert.DeserializeObject<Hours>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
|
||||
return hours;
|
||||
internal static async Task<Hours> LoadData() {
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?hours", GlobalVar.ApiKey);
|
||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
return res.hour;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Basisdaten: Mitarbeiterdaten, Projekte, Gemeinden, Freistellungen.
|
||||
/// </summary>
|
||||
internal static async Task<Hours> LoadBasicData() {
|
||||
|
||||
Hours hours = new Hours();
|
||||
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(tokendata.Url + "?basic", tokendata.ApiKey);
|
||||
|
||||
hours = JsonConvert.DeserializeObject<Hours>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
|
||||
return hours;
|
||||
public static async Task<User> LoadUser(string apiKey) {
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl, apiKey);
|
||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
return res.user;
|
||||
}
|
||||
|
||||
public static async Task<Operator> LoadOperator(string apiKey) {
|
||||
|
||||
Operator OperatorVar = new Operator();
|
||||
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(tokendata.Url, tokendata.ApiKey);
|
||||
|
||||
OperatorVar = JsonConvert.DeserializeObject<Operator>(data);
|
||||
Preferences.Default.Set("name", OperatorVar.name);
|
||||
Preferences.Default.Set("surname", OperatorVar.surname);
|
||||
Preferences.Default.Set("apiUrl", tokendata.Url);
|
||||
|
||||
return OperatorVar;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Zeiten eines Tages holen
|
||||
/// </summary>
|
||||
internal async Task<List<DayTime>> LoadDay(DateTime date) {
|
||||
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(tokendata.Url + "?date=" + date.ToString("yyyy-MM-dd"), tokendata.ApiKey);
|
||||
|
||||
//List<DayTime> daytimes = System.Text.Json.JsonSerializer.Deserialize<List<DayTime>>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
List<DayTime> daytimes = JsonConvert.DeserializeObject<List<DayTime>>(data);
|
||||
//List<DayTime> daytimes = JsonConvert.DeserializeObject<List<DayTime>>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
|
||||
return daytimes;
|
||||
internal static async Task<List<DayTime>> LoadDay(DateTime date) {
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?date=" + date.ToString("yyyy-MM-dd"), GlobalVar.ApiKey);
|
||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
return res.daytimes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Einzelnen Stundeneintrag holen
|
||||
/// </summary>
|
||||
internal static async Task<DayTime> LoadEntry(int id) {
|
||||
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(tokendata.Url + "?id=" + id, tokendata.ApiKey);
|
||||
|
||||
//DayTime hours = Hours.daytime.Find(x => x.id == id);
|
||||
DayTime hours = JsonConvert.DeserializeObject<DayTime>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
hours.TimeSpanVon = hours.Begin.ToTimeSpan();
|
||||
hours.TimeSpanBis = hours.End.ToTimeSpan();
|
||||
|
||||
return hours;
|
||||
string data = await BaseFunc.GetApiDataWithAuthAsync(GlobalVar.ApiUrl + "?id=" + id, GlobalVar.ApiKey);
|
||||
BaseResponse res = JsonConvert.DeserializeObject<BaseResponse>(data) ?? throw new Exception("Fehler beim Deserialisieren der Daten");
|
||||
res.daytime.TimeSpanVon = res.daytime.Begin.ToTimeSpan();
|
||||
res.daytime.TimeSpanBis = res.daytime.End.ToTimeSpan();
|
||||
return res.daytime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -111,7 +66,7 @@ internal class HoursBase {
|
||||
bool isNew = false;
|
||||
if (stunde.Id == null)
|
||||
isNew = true;
|
||||
await BaseFunc.SaveItemAsync(tokendata.Url, tokendata.ApiKey, stunde, isNew);
|
||||
await BaseFunc.SaveItemAsync(GlobalVar.ApiUrl, GlobalVar.ApiKey, stunde, isNew);
|
||||
|
||||
return stunde;
|
||||
}
|
||||
@@ -120,6 +75,6 @@ internal class HoursBase {
|
||||
/// Eintrag löschen
|
||||
/// </summary>
|
||||
internal static async Task DeleteEntry(DayTime stunde) {
|
||||
await BaseFunc.DeleteItemAsync(tokendata.Url + "/entry/" + stunde.Id, tokendata.ApiKey);
|
||||
await BaseFunc.DeleteItemAsync(GlobalVar.ApiUrl + "/entry/" + stunde.Id, GlobalVar.ApiKey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Jugenddienst_Stunden.Models;
|
||||
internal class Operator : HoursBase {
|
||||
internal class Operator {
|
||||
public string? id;
|
||||
public string? name;
|
||||
public string? surname;
|
||||
@@ -16,8 +16,6 @@ internal class Operator : HoursBase {
|
||||
public string? num;
|
||||
public string? year;
|
||||
|
||||
|
||||
public event EventHandler<string>? AlertEvent;
|
||||
|
||||
|
||||
}
|
||||
|
||||
36
Jugenddienst Stunden/Types/BaseResponse.cs
Normal file
36
Jugenddienst Stunden/Types/BaseResponse.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Jugenddienst_Stunden.Models;
|
||||
|
||||
namespace Jugenddienst_Stunden.Types;
|
||||
internal class BaseResponse {
|
||||
|
||||
public Settings settings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Monatsübersicht
|
||||
/// </summary>
|
||||
public Hours hour { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Stundenliste ... für die Katz?
|
||||
/// </summary>
|
||||
public List<Hours> hours { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Liste der Stundeneinträge
|
||||
/// </summary>
|
||||
public List<DayTime> daytimes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Einzelner Stundeneintrag
|
||||
/// </summary>
|
||||
public DayTime daytime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Auch irgendwie doppelt ...
|
||||
/// </summary>
|
||||
public Operator operatorVar { get; set; }
|
||||
public User user { get; set; }
|
||||
|
||||
public int error { get; set; }
|
||||
public string message { get; set; }
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CommunityToolkit.Mvvm.Input;
|
||||
using Jugenddienst_Stunden.Models;
|
||||
using Jugenddienst_Stunden.Types;
|
||||
using System.Windows.Input;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace Jugenddienst_Stunden.ViewModels;
|
||||
/// <summary>
|
||||
@@ -14,7 +15,7 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
public string Title { get; set; } = "Eintrag bearbeiten";
|
||||
public string SubTitle { get; set; } = DateTime.Today.ToString("dddd, d. MMMM yyyy");
|
||||
|
||||
private HoursBase HoursBase = new HoursBase();
|
||||
//private HoursBase HoursBase = new HoursBase();
|
||||
internal Settings Settings = new Settings();
|
||||
|
||||
public event EventHandler<string> AlertEvent;
|
||||
@@ -50,8 +51,9 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
set {
|
||||
if (_dayTime != value) {
|
||||
_dayTime = value;
|
||||
|
||||
}OnPropertyChanged(nameof(DayTime));
|
||||
|
||||
}
|
||||
OnPropertyChanged(nameof(DayTime));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,13 +79,14 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
//public ICommand LoadDataCommand { get; private set; }
|
||||
|
||||
|
||||
|
||||
public StundeViewModel() {
|
||||
DayTime = new DayTime();
|
||||
|
||||
SaveCommand = new AsyncRelayCommand(Save);
|
||||
//DeleteCommand = new AsyncRelayCommand(Delete);
|
||||
DeleteConfirmCommand = new Command(async () => await DeleteConfirm());
|
||||
LoadSettingsAsync();
|
||||
//LoadSettingsAsync();
|
||||
}
|
||||
|
||||
public StundeViewModel(DayTime stunde) {
|
||||
@@ -91,9 +94,11 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
|
||||
SaveCommand = new AsyncRelayCommand(Save);
|
||||
DeleteConfirmCommand = new AsyncRelayCommand(DeleteConfirm);
|
||||
LoadSettingsAsync();
|
||||
//LoadSettingsAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async void LoadSettingsAsync() {
|
||||
|
||||
try {
|
||||
@@ -105,7 +110,7 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
|
||||
GemeindeAktivSet = Settings.GemeindeAktivSet;
|
||||
ProjektAktivSet = Settings.ProjektAktivSet;
|
||||
|
||||
GlobalVar.Settings = Settings;
|
||||
OnPropertyChanged(nameof(OptionsGemeinde));
|
||||
OnPropertyChanged(nameof(OptionsFreistellung));
|
||||
OnPropertyChanged(nameof(OptionsProjekt));
|
||||
@@ -116,24 +121,15 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
AlertEvent?.Invoke(this, e.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private async Task LoadData() {
|
||||
try {
|
||||
Hours _hours = await Models.HoursBase.LoadBasicData();
|
||||
DayTime.EmployeeId = _hours.EmployeeId;
|
||||
} catch (Exception e) {
|
||||
AlertEvent?.Invoke(this, e.Message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async Task Save() {
|
||||
bool exceptionOccurred = false;
|
||||
try {
|
||||
await Models.HoursBase.SaveEntry(DayTime);
|
||||
await HoursBase.SaveEntry(DayTime);
|
||||
} catch (Exception e) {
|
||||
AlertEvent?.Invoke(this, e.Message);
|
||||
exceptionOccurred = true;
|
||||
@@ -148,7 +144,7 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
}
|
||||
|
||||
private async Task Delete() {
|
||||
await Models.HoursBase.DeleteEntry(DayTime);
|
||||
await HoursBase.DeleteEntry(DayTime);
|
||||
await Shell.Current.GoToAsync($"..?date={DayTime.Day.ToString("yyyy-MM-dd")}");
|
||||
}
|
||||
|
||||
@@ -157,9 +153,10 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
bool answer = await ConfirmEvent.Invoke("Achtung", "Löschen kann nicht ungeschehen gemacht werden. Fortfahren?");
|
||||
if (answer) {
|
||||
//Löschen
|
||||
await Models.HoursBase.DeleteEntry(DayTime);
|
||||
await HoursBase.DeleteEntry(DayTime);
|
||||
await Shell.Current.GoToAsync($"..?date={DayTime.Day.ToString("yyyy-MM-dd")}");
|
||||
} else { //nicht Löschen
|
||||
} else {
|
||||
//nicht Löschen
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,9 +174,28 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
if (query.ContainsKey("load")) {
|
||||
|
||||
//DateTime heute = DateTime.Now;
|
||||
_dayTime = await Models.HoursBase.LoadEntry(Convert.ToInt32(query["load"]));
|
||||
try {
|
||||
//_dayTime = await HoursBase.LoadEntry(Convert.ToInt32(query["load"]));
|
||||
BaseResponse dat = await HoursBase.LoadBase("id=" + Convert.ToInt32(query["load"]));
|
||||
_dayTime = dat.daytime;
|
||||
_dayTime.TimeSpanVon = dat.daytime.Begin.ToTimeSpan();
|
||||
_dayTime.TimeSpanBis = dat.daytime.End.ToTimeSpan();
|
||||
OptionsGemeinde = dat.settings.Gemeinden;
|
||||
OptionsProjekt = dat.settings.Projekte;
|
||||
OptionsFreistellung = dat.settings.Freistellungen;
|
||||
|
||||
GemeindeAktivSet = dat.settings.GemeindeAktivSet;
|
||||
ProjektAktivSet = dat.settings.ProjektAktivSet;
|
||||
|
||||
GlobalVar.Settings = dat.settings;
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
AlertEvent?.Invoke(this, e.Message);
|
||||
}
|
||||
|
||||
if (System.String.IsNullOrEmpty(DayTime.Description)) {
|
||||
AlertEvent?.Invoke(this, "Eintrag hat keine Daten zurückgegeben");
|
||||
AlertEvent?.Invoke(this, "Eintrag hat keinen Beschreibungstext");
|
||||
}
|
||||
SubTitle = DayTime.Day.ToString("dddd, d. MMMM yyyy");
|
||||
|
||||
@@ -192,33 +208,49 @@ public class StundeViewModel : ObservableObject, IQueryAttributable {
|
||||
|
||||
FreistellungEnabled = !_dayTime.Approved;
|
||||
|
||||
OnPropertyChanged(nameof(FreistellungEnabled));
|
||||
OnPropertyChanged(nameof(DayTime));
|
||||
|
||||
OnPropertyChanged(nameof(SubTitle));
|
||||
|
||||
}
|
||||
if (query.ContainsKey("date")) {
|
||||
Title = "Neuer Eintrag";
|
||||
|
||||
DateTime _date = DateTime.ParseExact((string)query["date"], "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
|
||||
|
||||
//Bei neuem Eintrag die vorhandenen des gleichen Tages anzeigen
|
||||
try {
|
||||
DayTimes = await HoursBase.LoadDay(_date);
|
||||
//DayTimes = await HoursBase.LoadDay(_date);
|
||||
BaseResponse dat = await HoursBase.LoadBase("date=" + _date.ToString("yyyy-MM-dd"));
|
||||
DayTimes = dat.daytimes;
|
||||
OptionsGemeinde = dat.settings.Gemeinden;
|
||||
OptionsProjekt = dat.settings.Projekte;
|
||||
OptionsFreistellung = dat.settings.Freistellungen;
|
||||
|
||||
GemeindeAktivSet = dat.settings.GemeindeAktivSet;
|
||||
ProjektAktivSet = dat.settings.ProjektAktivSet;
|
||||
|
||||
GlobalVar.Settings = dat.settings;
|
||||
} catch (Exception) {
|
||||
//Ein Tag ohne Einträge gibt eine Fehlermeldung,
|
||||
//die soll aber ignoriert werden, weil beim Neueintrag ist das ja Wurscht
|
||||
//In dem Fall müssen die Settings aber nochmal geholt werden, weil die dann nicht geladen wurden
|
||||
LoadSettingsAsync();
|
||||
} finally {
|
||||
DayTime.Day = _date;
|
||||
SubTitle = _date.ToString("dddd, d. MMMM yyyy");
|
||||
FreistellungEnabled = true;
|
||||
DayTime.EmployeeId = GlobalVar.EmployeeId;
|
||||
}
|
||||
|
||||
|
||||
DayTime.Day = _date;
|
||||
SubTitle = _date.ToString("dddd, d. MMMM yyyy");
|
||||
|
||||
_ = LoadData();
|
||||
OnPropertyChanged(nameof(Title));
|
||||
OnPropertyChanged(nameof(SubTitle));
|
||||
OnPropertyChanged(nameof(DayTimes));
|
||||
}
|
||||
OnPropertyChanged(nameof(FreistellungEnabled));
|
||||
OnPropertyChanged(nameof(DayTime));
|
||||
OnPropertyChanged(nameof(DayTimes));
|
||||
|
||||
OnPropertyChanged(nameof(SubTitle));
|
||||
OnPropertyChanged(nameof(Title));
|
||||
OnPropertyChanged(nameof(OptionsGemeinde));
|
||||
OnPropertyChanged(nameof(OptionsFreistellung));
|
||||
OnPropertyChanged(nameof(OptionsProjekt));
|
||||
|
||||
OnPropertyChanged(nameof(GemeindeAktivSet));
|
||||
OnPropertyChanged(nameof(ProjektAktivSet));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -25,16 +25,13 @@ internal class StundenViewModel : ObservableObject, IQueryAttributable, INotifyP
|
||||
public event EventHandler<string> AlertEvent;
|
||||
public event EventHandler<string> InfoEvent;
|
||||
|
||||
private HoursBase HoursBase = new HoursBase();
|
||||
//private HoursBase HoursBase = new HoursBase();
|
||||
internal Settings Settings = new Settings();
|
||||
|
||||
public TimeOnly Sollstunden { get; set; }
|
||||
|
||||
private string _title = HoursBase.name + " " + HoursBase.surname;
|
||||
public string Title {
|
||||
get => _title;
|
||||
set => SetProperty(ref _title, value);
|
||||
}
|
||||
|
||||
public string Title { get; set; } = GlobalVar.Name + " " + GlobalVar.Surname;
|
||||
|
||||
private Hours _hour;
|
||||
public Hours Hours {
|
||||
@@ -150,13 +147,15 @@ internal class StundenViewModel : ObservableObject, IQueryAttributable, INotifyP
|
||||
|
||||
private bool doContinue = true;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CTOR
|
||||
/// </summary>
|
||||
public StundenViewModel() {
|
||||
_hour = new Hours();
|
||||
|
||||
//LoadSettingsAsync();
|
||||
HoursBase.tokendata = new TokenData(HoursBase.apiKey);
|
||||
//HoursBase.tokendata = new TokenData(HoursBase.apiKey);
|
||||
LoadDataCommand = new AsyncRelayCommand(LoadData);
|
||||
NewEntryCommand = new AsyncRelayCommand(NewEntryAsync);
|
||||
SelectEntryCommand = new AsyncRelayCommand<DayTime>(SelectEntryAsync);
|
||||
@@ -167,6 +166,7 @@ internal class StundenViewModel : ObservableObject, IQueryAttributable, INotifyP
|
||||
|
||||
}
|
||||
|
||||
|
||||
private async Task LoadSettingsAsync() {
|
||||
try {
|
||||
Settings = await HoursBase.LoadSettings();
|
||||
@@ -226,37 +226,46 @@ internal class StundenViewModel : ObservableObject, IQueryAttributable, INotifyP
|
||||
/// </summary>
|
||||
public async Task LoadDay(DateTime date) {
|
||||
DayTotal = new TimeOnly(0);
|
||||
await LoadSettingsAsync();
|
||||
//await LoadSettingsAsync();
|
||||
//if (doContinue) {
|
||||
try {
|
||||
DayTimes = await HoursBase.LoadDay(date);
|
||||
try {
|
||||
//_dayTimes = await HoursBase.LoadDay(date);
|
||||
BaseResponse dat = await HoursBase.LoadBase("date=" + date.ToString("yyyy-MM-dd"));
|
||||
_dayTimes = dat.daytimes;
|
||||
Settings = dat.settings;
|
||||
GemeindeAktivSet = Settings.GemeindeAktivSet;
|
||||
ProjektAktivSet = Settings.ProjektAktivSet;
|
||||
|
||||
List<Sollstunden> _soll;
|
||||
TimeSpan span = TimeSpan.Zero;
|
||||
bool merker = false;
|
||||
foreach (DayTime dt in DayTimes) {
|
||||
span += dt.End - dt.Begin;
|
||||
//Nachtstunden dazurechnen
|
||||
if (dt.Night.Ticks > 0 && !merker) {
|
||||
span += dt.Night.ToTimeSpan() * .5;
|
||||
merker = true;
|
||||
}
|
||||
_soll = Settings.Nominal.Where(w => w.Timetable == dt.TimeTable && w.Wochentag == dt.Wday).ToList();
|
||||
if (_soll.Count > 0)
|
||||
Sollstunden = TimeOnly.FromTimeSpan(TimeSpan.FromHours(_soll[0].Zeit));
|
||||
OnPropertyChanged(nameof(GemeindeAktivSet));
|
||||
OnPropertyChanged(nameof(ProjektAktivSet));
|
||||
|
||||
|
||||
List<Sollstunden> _soll;
|
||||
TimeSpan span = TimeSpan.Zero;
|
||||
bool merker = false;
|
||||
foreach (DayTime dt in _dayTimes) {
|
||||
span += dt.End - dt.Begin;
|
||||
//Nachtstunden dazurechnen
|
||||
if (dt.Night.Ticks > 0 && !merker) {
|
||||
span += dt.Night.ToTimeSpan() * .5;
|
||||
merker = true;
|
||||
}
|
||||
DayTotal = TimeOnly.FromTimeSpan(span);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
DayTimes = new List<DayTime>();
|
||||
//TODO: hier könnte auch ein Fehler kommen, dann wäre InfoEvent falsch.
|
||||
InfoEvent?.Invoke(this, e.Message);
|
||||
} finally {
|
||||
OnPropertyChanged(nameof(DayTotal));
|
||||
OnPropertyChanged(nameof(Sollstunden));
|
||||
//OnPropertyChanged(nameof(DayTimes));
|
||||
_soll = Settings.Nominal.Where(w => w.Timetable == dt.TimeTable && w.Wochentag == dt.Wday).ToList();
|
||||
if (_soll.Count > 0)
|
||||
Sollstunden = TimeOnly.FromTimeSpan(TimeSpan.FromHours(_soll[0].Zeit));
|
||||
}
|
||||
DayTotal = TimeOnly.FromTimeSpan(span);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
_dayTimes = new List<DayTime>();
|
||||
//TODO: hier könnte auch ein Fehler kommen, dann wäre InfoEvent falsch.
|
||||
InfoEvent?.Invoke(this, e.Message);
|
||||
} finally {
|
||||
OnPropertyChanged(nameof(DayTotal));
|
||||
OnPropertyChanged(nameof(Sollstunden));
|
||||
OnPropertyChanged(nameof(DayTimes));
|
||||
}
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Jugenddienst_Stunden.Models;
|
||||
using ZXing.Net.Maui;
|
||||
using Jugenddienst_Stunden.Types;
|
||||
|
||||
namespace Jugenddienst_Stunden.Views;
|
||||
|
||||
@@ -8,145 +9,142 @@ namespace Jugenddienst_Stunden.Views;
|
||||
/// </summary>
|
||||
public partial class LoginPage : ContentPage {
|
||||
|
||||
private DateTime _lastDetectionTime;
|
||||
private readonly TimeSpan _detectionInterval = TimeSpan.FromSeconds(5);
|
||||
private DateTime _lastDetectionTime;
|
||||
private readonly TimeSpan _detectionInterval = TimeSpan.FromSeconds(5);
|
||||
|
||||
|
||||
internal HoursBase HoursBase = new HoursBase();
|
||||
|
||||
/// <summary>
|
||||
/// CTOR
|
||||
/// </summary>
|
||||
public LoginPage() {
|
||||
InitializeComponent();
|
||||
InitializeComponent();
|
||||
|
||||
//if (BindingContext is LoginViewModel vm) {
|
||||
// vm.AlertEvent += Vm_AlertEvent;
|
||||
// vm.InfoEvent += Vm_InfoEvent;
|
||||
// vm.MsgEvent += Vm_MsgEvent;
|
||||
//}
|
||||
|
||||
barcodeScannerView.Options = new BarcodeReaderOptions {
|
||||
Formats = BarcodeFormat.QrCode,
|
||||
AutoRotate = true,
|
||||
Multiple = false
|
||||
};
|
||||
barcodeScannerView.Options = new BarcodeReaderOptions {
|
||||
Formats = BarcodeFormat.QrCode,
|
||||
AutoRotate = true,
|
||||
Multiple = false
|
||||
};
|
||||
|
||||
}
|
||||
//if (BindingContext is LoginViewModel vm) {
|
||||
// vm.AlertEvent += Vm_AlertEvent;
|
||||
// vm.InfoEvent += Vm_InfoEvent;
|
||||
// vm.MsgEvent += Vm_MsgEvent;
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void BarcodesDetected(object sender, BarcodeDetectionEventArgs e) {
|
||||
private void BarcodesDetected(object sender, BarcodeDetectionEventArgs e) {
|
||||
|
||||
var currentTime = DateTime.Now;
|
||||
if ((currentTime - _lastDetectionTime) > _detectionInterval) {
|
||||
_lastDetectionTime = currentTime;
|
||||
foreach (var barcode in e.Results) {
|
||||
if (HoursBase.apiKey != barcode.Value) {
|
||||
_ = MainThread.InvokeOnMainThreadAsync(async () => {
|
||||
//await DisplayAlert("Barcode erkannt", $"Barcode: {barcode.Format} - {barcode.Value}", "OK");
|
||||
var currentTime = DateTime.Now;
|
||||
if ((currentTime - _lastDetectionTime) > _detectionInterval) {
|
||||
_lastDetectionTime = currentTime;
|
||||
foreach (var barcode in e.Results) {
|
||||
if (GlobalVar.ApiKey != barcode.Value) {
|
||||
_ = MainThread.InvokeOnMainThreadAsync(async () => {
|
||||
//await DisplayAlert("Barcode erkannt", $"Barcode: {barcode.Format} - {barcode.Value}", "OK");
|
||||
|
||||
try {
|
||||
var tokendata = new TokenData(barcode.Value);
|
||||
HoursBase.tokendata = tokendata;
|
||||
try {
|
||||
var tokendata = new TokenData(barcode.Value);
|
||||
GlobalVar.ApiUrl = tokendata.Url;
|
||||
User user = await HoursBase.LoadUser(barcode.Value);
|
||||
|
||||
var op = await HoursBase.LoadOperator(barcode.Value);
|
||||
HoursBase.apiKey = barcode.Value;
|
||||
HoursBase.name = op.name;
|
||||
HoursBase.surname = op.surname;
|
||||
HoursBase.EmployeeId = int.Parse(op.id);
|
||||
Title = op.name + " " + op.surname;
|
||||
ServerLabel.Text = "Server: " + tokendata.Url.Replace("/appapi", "").Replace("https://", "").Replace("http://", "");
|
||||
GlobalVar.ApiKey = barcode.Value;
|
||||
GlobalVar.Name = user.Name;
|
||||
GlobalVar.Surname = user.Surname;
|
||||
GlobalVar.EmployeeId = user.Id;
|
||||
|
||||
Title = user.Name + " " + user.Surname;
|
||||
ServerLabel.Text = "Server: " + tokendata.Url.Replace("/appapi", "").Replace("https://", "").Replace("http://", "");
|
||||
|
||||
Preferences.Default.Set("apiKey", barcode.Value);
|
||||
Preferences.Default.Set("name", op.name);
|
||||
Preferences.Default.Set("surname", op.surname);
|
||||
Preferences.Default.Set("EmployeeId", int.Parse(op.id));
|
||||
//Preferences.Default.Set("apiKey", barcode.Value);
|
||||
//Preferences.Default.Set("name", op.name);
|
||||
//Preferences.Default.Set("surname", op.surname);
|
||||
//Preferences.Default.Set("EmployeeId", int.Parse(op.id));
|
||||
|
||||
await DisplayAlert("Login erfolgreich", op.name + " " + op.surname, "OK");
|
||||
if (Navigation.NavigationStack.Count > 1)
|
||||
await Navigation.PopAsync();
|
||||
} catch (Exception e) {
|
||||
await DisplayAlert("Fehler", e.Message, "OK");
|
||||
}
|
||||
await DisplayAlert("Login erfolgreich", user.Name + " " + user.Surname, "OK");
|
||||
if (Navigation.NavigationStack.Count > 1)
|
||||
await Navigation.PopAsync();
|
||||
|
||||
});
|
||||
} else {
|
||||
MainThread.InvokeOnMainThreadAsync(() => {
|
||||
DisplayAlert("Bereits eingeloggt",
|
||||
Preferences.Default.Get("name", "") + " " + Preferences.Default.Get("surname", ""),
|
||||
"OK");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
await DisplayAlert("Fehler", e.Message, "OK");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MainThread.InvokeOnMainThreadAsync(() => {
|
||||
DisplayAlert("Bereits eingeloggt",
|
||||
Preferences.Default.Get("name", "") + " " + Preferences.Default.Get("surname", ""),
|
||||
"OK");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDisappearing() {
|
||||
base.OnDisappearing();
|
||||
}
|
||||
|
||||
barcodeScannerView.CameraLocation = CameraLocation.Front;
|
||||
barcodeScannerView.IsDetecting = false;
|
||||
protected override void OnDisappearing() {
|
||||
base.OnDisappearing();
|
||||
|
||||
}
|
||||
barcodeScannerView.CameraLocation = CameraLocation.Front;
|
||||
barcodeScannerView.IsDetecting = false;
|
||||
|
||||
protected override void OnAppearing() {
|
||||
base.OnAppearing();
|
||||
}
|
||||
|
||||
barcodeScannerView.IsDetecting = true;
|
||||
barcodeScannerView.CameraLocation = CameraLocation.Rear;
|
||||
protected override void OnAppearing() {
|
||||
base.OnAppearing();
|
||||
|
||||
}
|
||||
barcodeScannerView.IsDetecting = true;
|
||||
barcodeScannerView.CameraLocation = CameraLocation.Rear;
|
||||
|
||||
public bool IsCameraAvailable() {
|
||||
var status = Permissions.CheckStatusAsync<Permissions.Camera>().Result;
|
||||
if (status != PermissionStatus.Granted) {
|
||||
status = Permissions.RequestAsync<Permissions.Camera>().Result;
|
||||
}
|
||||
return status != PermissionStatus.Granted;
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnLoginButtonClicked(object sender, EventArgs e) {
|
||||
var username = UsernameEntry.Text;
|
||||
var password = PasswordEntry.Text;
|
||||
var server = ServerEntry.Text;
|
||||
public bool IsCameraAvailable() {
|
||||
var status = Permissions.CheckStatusAsync<Permissions.Camera>().Result;
|
||||
if (status != PermissionStatus.Granted) {
|
||||
status = Permissions.RequestAsync<Permissions.Camera>().Result;
|
||||
}
|
||||
return status != PermissionStatus.Granted;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(server)) {
|
||||
await DisplayAlert("Fehler", "Bitte alle Felder ausf<73>llen", "OK");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Types.User response = await BaseFunc.AuthUserPass(username, password, server);
|
||||
private async void OnLoginButtonClicked(object sender, EventArgs e) {
|
||||
var username = UsernameEntry.Text;
|
||||
var password = PasswordEntry.Text;
|
||||
var server = ServerEntry.Text;
|
||||
|
||||
var tokendata = new TokenData(response.Token);
|
||||
var op = await HoursBase.LoadOperator(response.Token);
|
||||
HoursBase.apiKey = response.Token;
|
||||
HoursBase.name = op.name;
|
||||
HoursBase.surname = op.surname;
|
||||
HoursBase.EmployeeId = int.Parse(op.id);
|
||||
Title = op.name + " " + op.surname;
|
||||
ServerLabel.Text = "Server: " + tokendata.Url.Replace("/appapi", "").Replace("https://", "").Replace("http://", "");
|
||||
if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(server)) {
|
||||
await DisplayAlert("Fehler", "Bitte alle Felder ausf<73>llen", "OK");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Types.User response = await BaseFunc.AuthUserPass(username, password, server);
|
||||
|
||||
Preferences.Default.Set("apiKey", response.Token);
|
||||
Preferences.Default.Set("name", op.name);
|
||||
Preferences.Default.Set("surname", op.surname);
|
||||
Preferences.Default.Set("EmployeeId", int.Parse(op.id));
|
||||
GlobalVar.ApiKey = response.Token;
|
||||
GlobalVar.Name = response.Name;
|
||||
GlobalVar.Surname = response.Surname;
|
||||
GlobalVar.EmployeeId = response.Id;
|
||||
GlobalVar.ApiUrl = server;
|
||||
|
||||
Title = response.Name + " " + response.Surname;
|
||||
ServerLabel.Text = "Server: " + server.Replace("/appapi", "").Replace("https://", "").Replace("http://", "");
|
||||
|
||||
await DisplayAlert("Login erfolgreich", op.name + " " + op.surname, "OK");
|
||||
if (Navigation.NavigationStack.Count > 1)
|
||||
await Navigation.PopAsync();
|
||||
} catch (Exception ex) {
|
||||
await DisplayAlert("Fehler", ex.Message, "OK");
|
||||
}
|
||||
}
|
||||
await DisplayAlert("Login erfolgreich", response.Name + " " + response.Surname, "OK");
|
||||
if (Navigation.NavigationStack.Count > 1)
|
||||
await Navigation.PopAsync();
|
||||
} catch (Exception ex) {
|
||||
await DisplayAlert("Fehler", ex.Message, "OK");
|
||||
}
|
||||
}
|
||||
|
||||
//private void Vm_AlertEvent(object? sender, string e) {
|
||||
// DisplayAlert("Fehler:", e, "OK");
|
||||
//}
|
||||
//private void Vm_InfoEvent(object? sender, string e) {
|
||||
// DisplayAlert("Information:", e, "OK");
|
||||
//}
|
||||
//private async Task Vm_MsgEvent(string title, string message) {
|
||||
// await DisplayAlert(title, message, "OK");
|
||||
//}
|
||||
//private void Vm_AlertEvent(object? sender, string e) {
|
||||
// DisplayAlert("Fehler:", e, "OK");
|
||||
//}
|
||||
//private void Vm_InfoEvent(object? sender, string e) {
|
||||
// DisplayAlert("Information:", e, "OK");
|
||||
//}
|
||||
//private async Task Vm_MsgEvent(string title, string message) {
|
||||
// await DisplayAlert(title, message, "OK");
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,10 @@ public partial class StundePage : ContentPage {
|
||||
vm.ConfirmEvent += ShowConfirm;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Vm_AlertEvent(object? sender, string e) {
|
||||
private void Vm_AlertEvent(object? sender, string e) {
|
||||
DisplayAlert("Fehler:", e, "OK");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Jugenddienst_Stunden.ViewModels;
|
||||
using Jugenddienst_Stunden.Models;
|
||||
|
||||
namespace Jugenddienst_Stunden.Views;
|
||||
|
||||
@@ -9,11 +10,14 @@ public partial class StundenPage : ContentPage {
|
||||
|
||||
private int heightValue;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CTOR
|
||||
/// </summary>
|
||||
public StundenPage() {
|
||||
InitializeComponent();
|
||||
|
||||
if (BindingContext is StundenViewModel vm) {
|
||||
vm.AlertEvent += Vm_AlertEvent;
|
||||
vm.InfoEvent += Vm_InfoEvent;
|
||||
@@ -21,26 +25,22 @@ public partial class StundenPage : ContentPage {
|
||||
if (!CheckLogin()) {
|
||||
NavigateToTargetPage();
|
||||
}
|
||||
//// Bildschirmh<6D>he abrufen
|
||||
//var screenHeight = DeviceDisplay.MainDisplayInfo.Height / DeviceDisplay.MainDisplayInfo.Density;
|
||||
|
||||
//// Berechnen der gew<65>nschten H<>he
|
||||
//var desiredHeight = screenHeight - 450; // Abz<62>glich der Stunden<65>bersicht
|
||||
//stundeItems.HeightRequest = desiredHeight;
|
||||
|
||||
#if ANDROID
|
||||
heightValue = 280;
|
||||
#elif IOS
|
||||
heightValue = 280;
|
||||
heightValue = 280;
|
||||
#elif WINDOWS
|
||||
heightValue = 320;
|
||||
heightValue = 320;
|
||||
#else
|
||||
heightValue = 300;
|
||||
heightValue = 300;
|
||||
#endif
|
||||
|
||||
SizeChanged += OnPageSizeChanged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void Vm_AlertEvent(object? sender, string e) {
|
||||
MainThread.BeginInvokeOnMainThread(async () => {
|
||||
await DisplayAlert("Fehler:", e, "OK");
|
||||
@@ -64,6 +64,8 @@ public partial class StundenPage : ContentPage {
|
||||
return Preferences.Default.Get("apiKey", "") != "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async void NavigateToTargetPage() {
|
||||
await Navigation.PushAsync(new LoginPage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user