Beispiel #1
0
 public bool validate()
 {
     if (string.IsNullOrWhiteSpace(std_name.Text))
     {
         MessageBox.Show(Properties.Resources.validname, "St. Anne's Admin DashBoard", MessageBoxButton.OK, MessageBoxImage.Stop);
         Keyboard.Focus(std_name);
         return(false);
     }
     else if (string.IsNullOrWhiteSpace(reg_no.Text) || (!ValidationFile.IsAlphaNumeric(reg_no.Text)))
     {
         MessageBox.Show(Properties.Resources.validusername, "St. Anne's Admin DashBoard", MessageBoxButton.OK, MessageBoxImage.Stop);
         Keyboard.Focus(reg_no);
         return(false);
     }
     else if (string.IsNullOrWhiteSpace(ph_no.Text) || (!ValidationFile.IsNumeric(ph_no.Text)))
     {
         MessageBox.Show(Properties.Resources.validphoneno, "St. Anne's Admin DashBoard", MessageBoxButton.OK, MessageBoxImage.Stop);
         Keyboard.Focus(ph_no);
         return(false);
     }
     else if (string.IsNullOrWhiteSpace(email.Text) || (!ValidationFile.IsValidEmail(email.Text)))
     {
         MessageBox.Show(Properties.Resources.validemail, "St. Anne's Admin DashBoard", MessageBoxButton.OK, MessageBoxImage.Stop);
         Keyboard.Focus(email);
         return(false);
     }
     else if (gender.SelectedIndex == 0)
     {
         MessageBox.Show(Properties.Resources.validgender, "St. Anne's Admin DashBoard", MessageBoxButton.OK, MessageBoxImage.Stop);
         Keyboard.Focus(gender);
         return(false);
     }
     return(true);
 }
Beispiel #2
0
 private bool validate()
 {
     if (string.IsNullOrWhiteSpace(txtusername.Text))
     {
         MessageBox.Show("Please enter the valid username", "St. Anne's Admin DashBoard", MessageBoxButton.OK, MessageBoxImage.Information);
         return(false);
     }
     else if (string.IsNullOrWhiteSpace(txtemail.Text) || (!ValidationFile.IsValidEmail(txtemail.Text)))
     {
         MessageBox.Show("Please enter the valid Email-ID", "St. Anne's Admin DashBoard", MessageBoxButton.OK, MessageBoxImage.Information);
         return(false);
     }
     return(true);
 }