Esempio n. 1
0
 private void NavigationAutorisationClick(IMenuItem menuItem)
 {
     if (DAO.User.AccessLevel == AccessLevels.Visitor)
     {
         CallAutorisationFragment();
     }
     else
     {
         var dialog = new AreYouSureDialogFragment("Are you sure do want to log out?");
         dialog.DialogResultHandler += LogOutAccept;
         dialog.Show(SupportFragmentManager, "LogOutDialogFragment");
     }
 }
Esempio n. 2
0
        private async void OnLoginButtonClick(object sender, EventArgs e)
        {
            // Small UI trick to permit OBM testers
            // interact with the staging API
            if (EmailEditText.Text == "staging")
            {
                var isStaging = !ServiceContainer.Resolve <ISettingsStore> ().IsStagingMode;
                ServiceContainer.Resolve <ISettingsStore> ().IsStagingMode = isStaging;
                var msg = !isStaging ? "You're in Normal Mode" : "You're in Staging Mode";
                new AlertDialog.Builder(this)
                .SetTitle("Staging Mode")
                .SetMessage(msg + "\nRestart the app to continue.")
                .SetPositiveButton("Ok", (EventHandler <DialogClickEventArgs>)null)
                .Show();
                return;
            }
            var authManager = ServiceContainer.Resolve <AuthManager> ();

            var settings = ServiceContainer.Resolve <ISettingsStore> ();

            if (authManager.OfflineMode && settings.HasEntries)
            {
                var confirm = new AreYouSureDialogFragment();
                confirm.Show(FragmentManager, "confirm_reset_dialog");
            }
            else if (authManager.OfflineMode)
            {
                ServiceContainer.Resolve <AuthManager> ().Forget();
                await TryLoginPasswordAsync();
            }
            else if (CurrentMode == Mode.Login)
            {
                await TryLoginPasswordAsync();
            }
            else
            {
                await TrySignupPasswordAsync();
            }
        }
Esempio n. 3
0
        private void DeleteDataButtonClick(object sender, System.EventArgs e)
        {
            var confirm = new AreYouSureDialogFragment();

            confirm.Show(FragmentManager, "confirm_reset_dialog");
        }
Esempio n. 4
0
        private async void OnLoginButtonClick (object sender, EventArgs e)
        {


            // Small UI trick to permit OBM testers
            // interact with the staging API
            if (EmailEditText.Text == "staging") {
                var isStaging = !ServiceContainer.Resolve<ISettingsStore> ().IsStagingMode;
                ServiceContainer.Resolve<ISettingsStore> ().IsStagingMode = isStaging;
                var msg = !isStaging ? "You're in Normal Mode" : "You're in Staging Mode";
                new AlertDialog.Builder (this)
                .SetTitle ("Staging Mode")
                .SetMessage (msg + "\nRestart the app to continue.")
                .SetPositiveButton ("Ok", (EventHandler<DialogClickEventArgs>)null)
                .Show ();
                return;

            }
            var authManager = ServiceContainer.Resolve<AuthManager> ();

            var settings = ServiceContainer.Resolve<ISettingsStore> ();
            if (authManager.OfflineMode && settings.HasEntries) {
                var confirm = new AreYouSureDialogFragment ();
                confirm.Show (FragmentManager, "confirm_reset_dialog");
            } else if (authManager.OfflineMode) {
                ServiceContainer.Resolve<AuthManager> ().Forget ();
                await TryLoginPasswordAsync ();
            } else if (CurrentMode == Mode.Login) {
                await TryLoginPasswordAsync ();
            } else {
                await TrySignupPasswordAsync ();
            }
        }