private void NewPasswordTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (string.IsNullOrEmpty(NewPasswordTextBox.Text)) { ErrorIcon.SetError(NewPasswordTextBox, "This field cant be empty!"); } else { ErrorIcon.Clear(); } }
private void LoginTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (string.IsNullOrEmpty(LoginTextBox.Text)) { ErrorIcon.SetError(LoginTextBox, "This field cant be empty!"); } else if (!authorization.IsLoginExist(LoginTextBox.Text)) { ErrorIcon.SetError(LoginTextBox, "Login is not exists"); } else { ErrorIcon.Clear(); } }
private void PhoneTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (!PhoneTextBox.MaskCompleted) { ErrorIcon.SetError(PhoneTextBox, "Wrong phone number"); } else if (!authorization.IsPhoneExist(PhoneTextBox.Text)) { ErrorIcon.SetError(PhoneTextBox, "Phone is not exists"); } else { ErrorIcon.Clear(); } }