コード例 #1
0
        async void SubmitButton_TouchUpInside(object sender, EventArgs e)
        {
            //if (Settings.Password != oldPassEdt.Text)
            //{
            //	HelperMethods.SendBasicAlert("Validation", "Invalid Password");
            //	return;
            //}


            if (confirmpassEdt.Text != nPassEdt.Text)
            {
                HelperMethods.SendBasicAlert("Validation", "Password doesn't match");
                return;
            }



            try {
                //AuthResponse response1 = await AuthResponse.GetAuthResponseAsync(0, Settings.Username, Settings.Password);

                APIManager manager = new APIManager();

                var response = await manager.ChangePassword(Settings.AppID, Settings.Username, Settings.AuthToken, oldPassEdt.Text, nPassEdt.Text);

                if (response == null)
                {
                    HelperMethods.SendBasicAlert("Change Password", "Failed");
                }
                else
                {
                    if (response.Status.Equals("Success"))
                    {
                        Settings.Password = nPassEdt.Text;
                        HelperMethods.SendBasicAlert("Change Password", "Done");
                    }
                    else
                    {
                        HelperMethods.SendBasicAlert("Change Password", response.ResponseMsg);
                    }
                }
            }
            catch (Exception exc) {
                HelperMethods.SendBasicAlert("Change Password", "Failed");
            }
        }