Beautifiing Login Process
This commit is contained in:
@@ -27,22 +27,22 @@ public partial class AboutPage : ContentPage {
|
||||
_lastDetectionTime = currentTime;
|
||||
foreach (var barcode in e.Results) {
|
||||
if (Preferences.Default.Get("apiKey", "") != barcode.Value) {
|
||||
MainThread.InvokeOnMainThreadAsync(async() => {
|
||||
MainThread.InvokeOnMainThreadAsync(async () => {
|
||||
//DisplayAlert("Barcode erkannt", $"Barcode: {barcode.Format} - {barcode.Value}", "OK");
|
||||
Preferences.Default.Set("apiKey", barcode.Value);
|
||||
|
||||
|
||||
Models.Stunde.apiKey = barcode.Value;
|
||||
|
||||
var op = await Models.Operator.LoadData(barcode.Value);
|
||||
Preferences.Default.Set("name", op.name);
|
||||
Preferences.Default.Set("surname", op.surname);
|
||||
DisplayAlert("Neuer Barcode erkannt", op.name + " " + op.surname, "OK");
|
||||
|
||||
DisplayAlert("Login erfolgreich", op.name + " " + op.surname, "OK");
|
||||
Title = op.name + " " + op.surname;
|
||||
|
||||
});
|
||||
} else {
|
||||
MainThread.InvokeOnMainThreadAsync(() => {
|
||||
DisplayAlert("Barcode bereits vorhanden",
|
||||
DisplayAlert("Bereits eingeloggt",
|
||||
Preferences.Default.Get("name", "") + " " + Preferences.Default.Get("surname", ""),
|
||||
"OK");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user