private async void TapGestureRecognizer_Tapped(object sender, EventArgs e) { DependencyService.Get <RegistertionNotify>().onStartRegistration("Attempting To Verify OTP "); DAL.Services.ApiServices services = new DAL.Services.ApiServices(); try { OtpResponse otpResponse = await services.ValidateOtp(double.Parse(Pin.Trim()), EmailId, MobileNbr); DependencyService.Get <RegistertionNotify>().onRegistrationFail(otpResponse.message); DependencyService.Get <RegistertionNotify>().onCompleteRegistration(); if ((otpResponse.message.Trim()).Equals("OTP Verified")) { DependencyService.Get <RegistertionNotify>().onCompleteRegistration(); await Navigation.PopAsync(); await PopupNavigation.Instance.PopAsync(true); await Navigation.PopToRootAsync(); //await Navigation.PushModalAsync(new LoginPage()); } } catch (Exception ex) { Debug.WriteLine(ex); DependencyService.Get <RegistertionNotify>().onRegistrationFail("Server Problem !"); DependencyService.Get <RegistertionNotify>().onCompleteRegistration(); } }
private async void TapGestureRecognizer_ReSendOTP(object sender, EventArgs e) { bool OTPResend = false; DependencyService.Get <RegistertionNotify>().onStartRegistration("Attempting To Rsend OTP "); DAL.Services.ApiServices services = new DAL.Services.ApiServices(); try { OTPResend = await services.ReSendOtpOtp(EmailId, MobileNbr); if (OTPResend) { DependencyService.Get <RegistertionNotify>().onCompleteRegistration(); DependencyService.Get <RegistertionNotify>().onRegistrationFail("OTP Resent,Plese check Your Mail!"); } else { DependencyService.Get <RegistertionNotify>().onRegistrationFail("Something went wrong,In order to send OTP!"); DependencyService.Get <RegistertionNotify>().onCompleteRegistration(); } } catch (Exception ex) { Debug.WriteLine(ex); DependencyService.Get <RegistertionNotify>().onRegistrationFail("Server Problem !"); DependencyService.Get <RegistertionNotify>().onCompleteRegistration(); } }
private async void Button_Clicked(object sender, EventArgs e) { if (callValidation()) { DAL.Services.ApiServices services = new DAL.Services.ApiServices(); //bool RegistrationStatus = await services.RegisterUser(entName.Text, entPhNbr.Text.ToString(), // Int32.Parse(entEmpId.Text), entEmail.Text); await Navigation.PushAsync(new OtpVerify()); } }
private async void Button_Clicked(object sender, EventArgs e) { if (callValidation()) { DependencyService.Get <RegistertionNotify>().onStartRegistration("Attempting to Register User"); bool RegistrationStatus = false; DAL.Services.ApiServices services = new DAL.Services.ApiServices(); try { RegistrationStatus = await services.RegisterUser(entName.Text, entPhNbr.Text.ToString(), Int32.Parse(entEmpId.Text), entEmail.Text, entCnfPassword.Text.Trim()); } catch (Exception ex) { Debug.WriteLine(ex); DependencyService.Get <RegistertionNotify>().onRegistrationFail("Server Down !"); } //bool RegistrationStatus = true; if (RegistrationStatus) { DependencyService.Get <RegistertionNotify>().onCompleteRegistration(); DependencyService.Get <RegistertionNotify>().onRegistrationSucces("User Registered !"); ////await DisplayAlert("Hi", "User Registered...", "Okay"); await Navigation.PushAsync(new OtpVerify(entEmail.Text, entPhNbr.Text.ToString())); } else { DependencyService.Get <RegistertionNotify>().onRegistrationFail("Something Went Wrong !"); DependencyService.Get <RegistertionNotify>().onCompleteRegistration(); //await DisplayAlert("Alert", "Something went wrong...", "Cancel"); } } }