/// <summary> /// Method to navigate to reset pin page /// </summary> private void OKResetPIN() { IsOkEnabled = true; if (Utilities.IsConnectedToNetwork()) { ProgressBarVisibilty = Visibility.Visible; App.PIN = string.Empty; EnterPinModel enterPinModel = new EnterPinModel(this, "reset"); } else { MessageBox.Show("No Internet Connectivity"); } }
/// <summary> /// Method to navigate to signup screen /// </summary> private void NavigateBack() { IsOkEnabled = false; HitVisibility = true; INavigationService navigationService = this.GetService <INavigationService>(); if (string.IsNullOrWhiteSpace(App.PIN) || string.IsNullOrEmpty(App.PIN) || App.IsFromLoginScreen) { if (string.IsNullOrWhiteSpace(Pin) || string.IsNullOrEmpty(Pin)) { IsPinValidatorVisible = Visibility.Visible; PinLengthMessage = "Please enter a PIN"; } else { PinLengthMessage = string.Empty; if (Pin.Length < 4) { IsPinValidatorVisible = Visibility.Visible; PinLengthMessage = "Pin should be 4 digits"; Pin = string.Empty; } else { App.PIN = Pin; if (App.TombStonedPageURL == PageURL.navigateToResetPinLoginURL) { navigationService.Navigate(App.TombStonedPageURL); } else { navigationService.Navigate(PageURL.navigateToLoginPanelURL); } } } } else { if (!string.IsNullOrEmpty(Pin) || !string.IsNullOrWhiteSpace(Pin)) { PinLengthMessage = string.Empty; if (App.NoofTriesLeft > 0) { if (Pin.Length < 4) { IsPinValidatorVisible = Visibility.Visible; PinLengthMessage = "Pin should be 4 digits"; Pin = string.Empty; } else if ((App.PIN == Pin)) { App.IsToombStoned = false; App.IsApplicationInstancePreserved = false; if ((!string.IsNullOrEmpty(App.TombStonedPageURL)) && (!string.IsNullOrWhiteSpace(App.TombStonedPageURL))) { if (App.TombStonedPageURL.Equals(PageURL.navigateToMapServicesURL)) { navigationService.Navigate(PageURL.navigateToMapServicesURL + "?action=drawPushpin"); } else { navigationService.Navigate(App.TombStonedPageURL); } } else if (!App.IsUserRegistered) { navigationService.Navigate(PageURL.navigateToYourDetailsLoginURL); } else if (App.IsPageHomePanorama) { navigationService.Navigate(PageURL.navigateToHomePanoramaURL); } else if (App.IsVerifiedByEmail) { navigationService.Navigate(PageURL.navigateToVerificationByEmailURL); } else if (App.IsVerifiedBySms) { navigationService.Navigate(PageURL.navigateToVerificationBySMSURL); } else if (App.IsPageUpdateYourDetailsafterLogin) { navigationService.Navigate(PageURL.navigateToYourDetailswithTCURL); } App.NoofTriesLeft = 9; } else { if (App.IsFromLoginScreen) { App.PIN = Pin; navigationService.Navigate(PageURL.navigateToLoginPanelURL); } else { if (Utilities.IsConnectedToNetwork()) { HitVisibility = false; EnterPinModel enterPinModel = new EnterPinModel(this, "invalidPin"); } else { IsIncorrectPinPopupOpen = true; IncorrectPinMessage = "Incorrect PIN entered please try again.\nYou have " + App.NoofTriesLeft + " tries left before your data is wiped."; HitVisibility = false; App.NoofTriesLeft = App.NoofTriesLeft - 1; Pin = string.Empty; } } } } else { IsPreventAccessPopupOpen = true; PreventAccessText = "You have exceeded your limit of 10 tries.\n Your app will now exit,\n your saved information will be cleared."; HitVisibility = false; Utilities.ClearAllAppVariables(); } } else { IsPinValidatorVisible = Visibility.Visible; PinLengthMessage = "Please enter a PIN"; } } }