private void AuthorTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (string.IsNullOrEmpty(AuthorTextBox.Text)) { EmptyFieldError.SetError(AuthorTextBox, "This field cant be empty"); } else { EmptyFieldError.Clear(); } }
private void PhoneTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (!PhoneTextBox.MaskCompleted) { EmptyFieldError.SetError(PhoneTextBox, "Check phone number"); } else { EmptyFieldError.Clear(); } }
private void LoginTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if (String.IsNullOrEmpty(LoginTextBox.Text)) { EmptyFieldError.SetError(LoginTextBox, "This field cant be empty!"); } else if (!authorization.IsLoginExist(LoginTextBox.Text) && LoginTextBox.Text != "Admin") { EmptyFieldError.SetError(LoginTextBox, "Login is not exists"); } else { EmptyFieldError.Clear(); } }