public void OnChangePasswordConfirmPressed() { // TODO: Finish password change logic flow string newPassword = model.newPasswordField.value; string confirmPassword = model.confirmPasswordField.value; if (model.newPasswordField.defaultText == newPassword || string.IsNullOrEmpty(newPassword)) { ModalPopupOK.Spawn("Please enter a new password."); } else if (model.confirmPasswordField.defaultText == confirmPassword || string.IsNullOrEmpty(newPassword)) { ModalPopupOK.Spawn("Please confirm your password."); } else if (string.Compare(newPassword, confirmPassword) != 0) { ModalPopupOK.Spawn("Check that your passwords match."); } else { HelperMethods.ChangePasswordRequestObject passwordRequest = new HelperMethods.ChangePasswordRequestObject(); passwordRequest.password = newPassword; ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder() .SetEventCategory("Profile - Settings Screen") .SetEventAction("Click - Confirm Button Change Password Screen") .SetEventLabel("User has clicked on the confirm button from the change password screen")); ITTDataCache.Instance.ChangePassword(passwordRequest, OnChangePasswordSuccess, OnChangePasswordFailure); } }
public void OnChangePasswordConfirmPressed() { // TODO: Finish password change logic flow string newPassword = model.newPasswordField.value; string confirmPassword = model.confirmPasswordField.value; if (model.newPasswordField.defaultText == newPassword || string.IsNullOrEmpty(newPassword)) { ModalPopupOK.Spawn("Please enter a new password."); } else if (model.confirmPasswordField.defaultText == confirmPassword || string.IsNullOrEmpty(newPassword)) { ModalPopupOK.Spawn("Please confirm your password."); } else if (string.Compare(newPassword, confirmPassword) != 0) { ModalPopupOK.Spawn("Check that your passwords match."); } else { HelperMethods.ChangePasswordRequestObject passwordRequest = new HelperMethods.ChangePasswordRequestObject(); passwordRequest.password = newPassword; ITTGoogleAnalytics.Instance.googleAnalytics.LogEvent(new EventHitBuilder() .SetEventCategory("Profile - Settings Screen") .SetEventAction("Click - Confirm Button Change Password Screen") .SetEventLabel("User has clicked on the confirm button from the change password screen")); ITTDataCache.Instance.ChangePassword(passwordRequest, OnChangePasswordSuccess, OnChangePasswordFailure); } }