Beispiel #1
0
 /*
  *  Shell relativa all'utente admin
  */
 public MainPageAdmin()
 {
     InitializeComponent();
     Application.Current.Properties["logged"] = "true";
     Application.Current.Properties["Admin"]  = "true";
     Application.Current.Properties["UID"]    = DatabaseProfile.GetUid();
     Application.Current.SavePropertiesAsync();
 }
Beispiel #2
0
        public async Task Startup()
        {
            Application.Current.Properties["MyUID"] = DatabaseProfile.GetUid();
            Application.Current.Properties["ABC"]   = "A";
            await Application.Current.SavePropertiesAsync();

            if (await DatabaseProfile.GetProfile())
            {
                if (await DatabaseUser.ListUser() && await DatabaseExercise.ListExercise())
                {
                    App.Current.MainPage = new MainPageAdmin();
                    Navigation.PopAsync();
                }
                else
                {
                    await DisplayAlert("Error", "Something went wrong1", "OK");

                    Navigation.PopAsync();
                }
            }
            else
            {
                if (await DatabaseDaysInWeek.CheckDaysInWeek(DatabaseProfile.GetUid(), "A", 1) &&
                    await DatabaseDaysInWeek.CheckDaysInWeek(DatabaseProfile.GetUid(), "A", 2) &&
                    await DatabaseDaysInWeek.CheckDaysInWeek(DatabaseProfile.GetUid(), "A", 3) &&
                    await DatabaseDaysInWeek.CheckDaysInWeek(DatabaseProfile.GetUid(), "A", 4))
                {
                    App.Current.MainPage = new MainPage();
                    Navigation.PopAsync();
                }
                else
                {
                    await DisplayAlert("Error", "Something went wrong2", "OK");

                    Navigation.PopAsync();
                }
            }
        }