private async void sendUserName_Click(object sender, RoutedEventArgs e) { log.Username = usernameBox.Text; try { ringOring.IsActive = true; ringOring.Visibility = Visibility.Visible; sendUserName.Visibility = Visibility.Collapsed; var res = await LoginVerifyCall.LoginVerifyAsync(log, null); if (res.response.Equals("Success")) { ToastyToast.ShowToastNotification("Success", "Yay!!!"); usernameBox.Visibility = Visibility.Collapsed; ringOring.Visibility = Visibility.Collapsed; ringOring.IsActive = false; otpBox.Visibility = Visibility.Visible; sendOtp.Visibility = Visibility.Visible; } else { ToastyToast.ShowToastNotification("No", "noooooooooo!!!"); ringOring.Visibility = Visibility.Collapsed; ringOring.IsActive = false; sendUserName.Visibility = Visibility.Visible; } } catch (Exception) { } }
private async void sendOtp_Click(object sender, RoutedEventArgs e) { string otp = otpBox.Text; ringOring.IsActive = true; ringOring.Visibility = Visibility.Visible; sendOtp.Visibility = Visibility.Collapsed; try { var res = await LoginVerifyCall.LoginVerifyAsync(null, otp); if (res.response.Equals("Success")) { var keepTemp = ApplicationData.Current.LocalSettings; keepTemp.Values["user"] = log.Username; keepTemp.Values["type"] = log.TypeLogin; if (log.TypeLogin.Equals("Doctor")) { Frame.Navigate(typeof(DocProfile), log); } else { Frame.Navigate(typeof(UserProfile), log); } } else { ToastyToast.ShowToastNotification("No", "Wrong OTP :("); ringOring.Visibility = Visibility.Collapsed; ringOring.IsActive = false; sendOtp.Visibility = Visibility.Visible; } } catch (Exception) { } }