/// <summary> /// Invoked when the Submit button is clicked. /// </summary> /// <param name="obj">The Object</param> private void SubmitClicked(object obj) { ConvertURL.Convert(NewPassword); var code = ForgotPasswordViewModel.Code; var email = ForgotPasswordViewModel.EmailR; var password = ConvertURL.Convert22(NewPassword); email = ConvertURL.Convert22(email); if (Code == code.ToString()) { if (NewPassword == ConfirmPassword) { string url = "http://v95289qa.beget.tech/UpdateVolunteer.php?email=" + email + "&password="******"Пароль успешно восстановлен.", ToastLength.Long).Show(); Application.Current.MainPage.Navigation.PushAsync(new LoginPage()); } } else { return; } } else { return; } }
/// <summary> /// Invoked when the Sign Up button is clicked. /// </summary> /// <param name="obj">The Object</param> private void SignUpClicked(object obj) { /*string lastId = "http://v95289qa.beget.tech/Last.php?last"; * id = 0; * using (var last = new WebClient()) * { * var response = last.DownloadString(lastId); * var json = JsonConvert.DeserializeObject<Person>(response); * id = json.VolunteerID + 1; * * }*/ string surname = ConvertURL.Convert(Surname); string name = ConvertURL.Convert(Name); string patronymic = ConvertURL.Convert(Patronymic); string phone = ConvertURL.Convert(Phone); string login = ConvertURL.Convert(Login); string password = ConvertURL.Convert(Password); string email = ConvertURL.Convert(Email); string age = ConvertURL.Convert(Age); string country = ConvertURL.Convert(Country); string skills = ConvertURL.Convert(Skills); if (Surname != string.Empty && Name != string.Empty && Patronymic != string.Empty && Phone != string.Empty && Login != string.Empty && Password != string.Empty && Email != string.Empty && Age != string.Empty && Country != string.Empty) { string url = "http://v95289qa.beget.tech/ValidationLogin.php?login="******"Введенный вами логин занят.", ToastLength.Long).Show(); return; } else { string reg = "http://v95289qa.beget.tech/CreateVolunteer.php?id=" + id + "&surname=" + surname + "&name=" + name + "&patr=" + patronymic + "&age=" + age + "&country=" + country + "&login="******"&phone=" + login + "&skills=" + skills + "&pass="******"Вы успешно зарегистрированы.", ToastLength.Long).Show(); } } } } else { return; } Application.Current.MainPage.Navigation.PushAsync(new LoginPage()); }
/// <summary> /// Invoked when the Log In button is clicked. /// </summary> /// <param name="obj">The Object</param> private void LoginClicked(object obj) { string login = ConvertURL.Convert(Login); string pass = ConvertURL.Convert(Password); string url = "http://v95289qa.beget.tech/Auth.php?login="******"&password=" + pass; using (var webClient = new WebClient()) { var response = webClient.DownloadString(url); Auth json = JsonConvert.DeserializeObject <Auth>(response); if (json.Login != null && json.Password != null) { Application.Current.MainPage.Navigation.PushAsync(new NavigationTileCardPage()); } else { return; } } }