110
if (string.IsNullOrWhiteSpace(TbPhone.Text) ||
(!string.IsNullOrWhiteSpace(TbPhone.Text) &&
Regex.IsMatch(TbPhone.Text, phonePattern))){
string birthdayPattern = @"^([0-9]{2}).([0-9]{2}).([0-9]{4})$";
if (string.IsNullOrWhiteSpace(TbBirthday.Text) ||
(!string.IsNullOrWhiteSpace(TbBirthday.Text) &&
Regex.IsMatch(TbBirthday.Text, birthdayPattern))){
string postData =
$"action=updateAccInfo&firstname={TbFirstName.Text}&middlena
me={TbMiddleName.Text}&lastname={TbLastName.Text}&phone=
{TbPhone.Text}&birthday={TbBirthday.Text}&apikey={Tools.apiK
ey}";
string response = Http.Post("http://h146736.s31.test-
hf.su/flyone/api.php", postData);
if (response.Contains("Личные данные изменены")){
MaterialMessageBox.Show("Ваши личные данные
успешно изменены", "Успешно");
}
else{
MaterialMessageBox.Show(response, "Ошибка");
}
}
else{
MaterialMessageBox.Show("Проверьте корректность даты
дня рождения. Пример ДД.ММ.ГГГГ", "Ошибка");
}
}
else{
MaterialMessageBox.Show("Проверьте корректность телефона.
Пример 79123456789", "Ошибка");