Add Save function, Visuals, Stuff
This commit is contained in:
@@ -16,25 +16,16 @@ namespace Jugenddienst_Stunden.Models {
|
||||
public string aktiv;
|
||||
public string department;
|
||||
public string department_name;
|
||||
//public List<DateOnly>? timetable_begin;
|
||||
/// <summary>
|
||||
/// TimeTable Num
|
||||
/// </summary>
|
||||
public string num;
|
||||
//public List<TimeOnly>? saved_overtime;
|
||||
//public List<TimeOnly>? saved_holiday;
|
||||
//public TimeOnly overtime;
|
||||
//public TimeOnly holiday;
|
||||
public string year;
|
||||
//public List<int>? timetable;
|
||||
|
||||
|
||||
public event EventHandler<string> AlertEvent;
|
||||
|
||||
public static async Task<Operator> LoadData(string apiKey) {
|
||||
//var apiKey = Preferences.Default.Get("apiKey", "");
|
||||
|
||||
Operator OperatorVar = new Operator();
|
||||
//Operator operator = new Operator();
|
||||
|
||||
if (Connectivity.Current.NetworkAccess == NetworkAccess.None) {
|
||||
await App.Current.MainPage.DisplayAlert("Keine Internetverbindung",
|
||||
"Bitte überprüfen Sie Ihre Internetverbindung und versuchen Sie es erneut.",
|
||||
@@ -48,12 +39,11 @@ namespace Jugenddienst_Stunden.Models {
|
||||
if (data == "\"Lalala\"") {
|
||||
throw new Exception("Problem mit Token");
|
||||
}
|
||||
if (data != null) {
|
||||
if (data != "null") {
|
||||
OperatorVar = JsonConvert.DeserializeObject<Operator>(data);
|
||||
Preferences.Default.Set("name", OperatorVar.name);
|
||||
Preferences.Default.Set("surname", OperatorVar.surname);
|
||||
Preferences.Default.Set("apiUrl", tokendata.url);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user