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();
     }
 }
Example #2
0
 private void PhoneTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (!PhoneTextBox.MaskCompleted)
     {
         EmptyFieldError.SetError(PhoneTextBox, "Check phone number");
     }
     else
     {
         EmptyFieldError.Clear();
     }
 }
Example #3
0
 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();
     }
 }