Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private async Task btnSave_Clicked(object sender, EventArgs e)
- {
- if (entNewPass.Text == null || entNewPass.Text == "")
- {
- DisplayAlert("Notice", "Please enter your new password", "OK");
- }
- else
- {
- if(entNewPass.Text.Length <8)
- {
- DisplayAlert("Notice", "Password must consist atleast 8 characters", "OK");
- }
- else
- {
- if (entNewPass.Text == entCNewPass.Text)
- {
- Users userz = new Users()
- {
- mem_acc_username = currentusername,
- mem_acc_password = entNewPass.Text
- };
- var json = JsonConvert.SerializeObject(userz);
- var content = new StringContent(json, Encoding.UTF8, "application/json");
- HttpClient client = new HttpClient();
- var result = await client.PostAsync("http://ipoladroid01-001-site1.btempurl.com/Restserver/index.php/users/forgot_password", content);
- if (result.StatusCode == System.Net.HttpStatusCode.OK)
- {
- await DisplayAlert("Success :", "Password Changed", "OK");
- Navigation.PopAsync();
- Navigation.PopAsync();
- Navigation.PopAsync();
- }
- else
- {
- await DisplayAlert("Failed", json, "OK");
- }
- }
- else
- {
- DisplayAlert("Notice", "Password confirmation is not match", "OK");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement