private async void btnSubmit_Clicked(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(stepTwoPicker.SelectedItem)) { MessageDialog.Show(string.Empty, "Please select a question to proceed", DialogType.Error, "Ok", null); return; } if (string.IsNullOrEmpty(stepTwoAnswer.Text)) { MessageDialog.Show(string.Empty, "Please provide an answer to the selected question to proceed", DialogType.Error, "Ok", null); return; } var question = vm.Questions.FirstOrDefault(x => x.Question == stepTwoPicker.SelectedItem); vm.QuestionAndAnswer.Add(new QuestionAndAnswer() { Answer = stepTwoAnswer.Text.Trim(), QuestionID = question.ID }); await vm.SubmitSecurityQuestions(_username, _password); } catch (Exception ex) { } }
private async void BtnStep2_OnClicked(object sender, EventArgs e) { try { var ans = stepTwoAnswer.Text; var question = QuestionTwo.Text; if (!ValidateQuestion(question, ans)) { MessageDialog.Show("OOPS", "Incorrect answer", PopUps.DialogType.Error, "OK", null); return; } //Add device to user var questModel = new CreateSecurityQuestionViewModel(Navigation); foreach (var item in vm.QuestionAndAnser) { questModel.QuestionAndAnswer.Add(new QuestionAndAnswer { Answer = item.Answer, Question = item.Question, QuestionID = item.QuestionID }); } await questModel.SubmitSecurityQuestions(email, pass); } catch (Exception ex) { await BusinessLogic.Log(ex.ToString(), "Exception on security question picker event", string.Empty, string.Empty, "Security Question Page", string.Empty); } }