private async void btnConfirm_Clicked(object sender, EventArgs e) { var pd = await ProgressDialog.Show("Sending Request. Please Wait..."); try { if (IsEntryValidated() == true) { SpectaProcess.otp = otp; SpectaProcess.isTermsAccepted = IsAcceptLicence.ToString(); var processModel = new SpectaProcess2() { firstName = SpectaProcess.firstName, lastName = SpectaProcess.lastName, dateOfBirth = SpectaProcess.dateOfBirth, isTermsAccepted = SpectaProcess.isTermsAccepted, acctNo = SpectaProcess.acctNo, accomodationType = SpectaProcess.accomodationType, address = SpectaProcess.address, bvn = SpectaProcess.bvn, channelId = SpectaProcess.channelId, eligibleAmt = SpectaProcess.eligibleAmt, email = SpectaProcess.email, empAddress = SpectaProcess.empAddress, empName = SpectaProcess.empName, gender = SpectaProcess.gender, howLongInResidence = SpectaProcess.howLongInResidence, isCustomer = SpectaProcess.isCustomer == "Yes" ? SpectaProcess.isCustomer = "1" : SpectaProcess.isCustomer = "0", jobChangeCount = SpectaProcess.jobChangeCount, loanPurpose = SpectaProcess.loanPurpose, maritalStatus = SpectaProcess.maritalStatus, numberOfDependants = SpectaProcess.numberOfDependants, otp = SpectaProcess.otp, phoneNumber = SpectaProcess.phoneNumber, reqAmt = SpectaProcess.reqAmt, salaryAmt = SpectaProcess.salaryAmt, Salary_Act_No = SpectaProcess.Salary_Act_No == null ? SpectaProcess.Salary_Act_No = SpectaProcess.acctNo : SpectaProcess.Salary_Act_No, tenor = SpectaProcess.tenor }; var response = await SpectaService.SpectaFinal(processModel); if (!string.IsNullOrEmpty(response)) { if (response == "1") { // it is successful. Give a MessageDialog.Show("SUCCESS", "Your Loan application was successful.", DialogType.Success, "OK", null); Application.Current.MainPage = new AnimationNavigationPage(new Dashboard.Dashboard()); } else { MessageDialog.Show("OOPS", "Sorry, we are unable to place your request at the moment.\n Kindly try again later or contact our customer care", DialogType.Success, "OK", null); return; // Unsuccessful } } } } catch (Exception ex) { await pd.Dismiss(); // catch any exception } }
public void DoLoanBooking() { Device.BeginInvokeOnMainThread(async() => { var pd = await ProgressDialog.Show("Sending Request. Please Wait..."); try { var accSplitted = Utilities.SplitBeneficiaryDetailsByTab(acctNo); string AcctToDebit = accSplitted[0].Trim(); SpectaProcess.firstName = GlobalStaticFields.Customer?.FirstName; SpectaProcess.lastName = GlobalStaticFields.Customer?.LastName; SpectaProcess.gender = GlobalStaticFields.Customer?.Gender; SpectaProcess.empName = empName; SpectaProcess.bvn = GlobalStaticFields.Customer?.BVN; SpectaProcess.dateOfBirth = GlobalStaticFields.Customer?.BirthDate.ToString("yyyy-MM-dd"); //model.dob; SpectaProcess.email = empEmail; if (!string.IsNullOrEmpty(GlobalStaticFields.Customer.BVN)) { isCustomer = "Yes"; } else { isCustomer = "No"; } SpectaProcess.isCustomer = isCustomer; SpectaProcess.phoneNumber = GlobalStaticFields.Customer?.PhoneNumber; SpectaProcess.acctNo = AcctToDebit; SpectaProcess.reqAmt = amount.ToString(); SpectaProcess.loanPurpose = loanPurpose; SpectaProcess.empAddress = empAddress; SpectaProcess.address = address; SpectaProcess.salaryAmt = salaryAmt; SpectaProcess.accomodationType = getAccomodationId(accomodationType); SpectaProcess.jobChangeCount = getjobChangeCount(jobChangeCount); SpectaProcess.maritalStatus = getMaritalStatus(maritalStatus); SpectaProcess.numberOfDependants = getDependent(numberOfDependants); SpectaProcess.tenor = getTenor(tenor); SpectaProcess.howLongInResidence = getResidence(howLongInResidence); // there wont be need to validate NUBAN, since its coming from a list of all customer account.... // since Nuban Passed, lets get Customer's Eligible Amount var eResponse = await SpectaService.GetEligibleAmount(SpectaProcess.accomodationType, SpectaProcess.maritalStatus, SpectaProcess.numberOfDependants, SpectaProcess.jobChangeCount, SpectaProcess.howLongInResidence, SpectaProcess.empName, SpectaProcess.empAddress, SpectaProcess.gender, SpectaProcess.tenor, SpectaProcess.reqAmt, SpectaProcess.firstName, SpectaProcess.lastName, SpectaProcess.address, SpectaProcess.dateOfBirth, SpectaProcess.salaryAmt, SpectaProcess.phoneNumber, SpectaProcess.bvn, SpectaProcess.email, SpectaProcess.isCustomer, SpectaProcess.acctNo); if (!string.IsNullOrEmpty(eResponse) && eResponse == "Success") { var otpResponse = await SpectaService.GetOtpSpectaOTP(SpectaProcess.acctNo, SpectaProcess.email); // call otp method. if (otpResponse == true) { await pd.Dismiss(); MessageDialog.Show("SUCCESS", $"An OTP has been sent to your registered phone number {GlobalStaticFields.Customer.PhoneNumber.Substring(0,5)}##### and email {SpectaProcess.email}", DialogType.Error, "DISMISS", null); await Navigation.PushAsync(new FinishQuickLoan(SpectaProcess.eligibleAmount)); } else { await pd.Dismiss(); MessageDialog.Show("OOPS", "Sorry, we are unable to process your request at the moment. Kindly try again later", DialogType.Error, "DISMISS", null); return; } } else { await pd.Dismiss(); MessageDialog.Show("OOPS", "Sorry, you are not eligible for this request. Kindly contact our customer care", DialogType.Error, "DISMISS", null); return; } await pd.Dismiss(); } catch (Exception ex) { await pd.Dismiss(); } }); }
private async void GetPaymentCategories() { await Task.Run(() => SpectaService.GetSpectaDropdoown()); }