Ejemplo n.º 1
0
 /// <summary>
 /// chheck if the textBoxes are valids
 /// </summary>
 /// <returns>True - if valids, False - if not</returns>
 private bool CheckTextBoxFields()
 {
     if (RegexValidations.NameValidation(textBoxManagerName.Text) &&
         RegexValidations.NumericValidation(textBoxExperience.Text) &&
         RegexValidations.NumericValidation(textBoxAge.Text) &&
         RegexValidations.NumericValidation(textBoxTitles.Text))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// check the text boxes validation
 /// </summary>
 /// <returns></returns>
 private bool CheckTextBoxFields()
 {
     if (RegexValidations.NameValidation(textBoxPlayerName.Text) &&
         RegexValidations.NumericValidation(textBoxExperience.Text) &&
         RegexValidations.NumericValidation(textBoxAge.Text) &&
         RegexValidations.NumericValidation(textBoxTitles.Text) &&
         RegexValidations.HeightAndWeightValidation(textBoxHeight.Text) &&
         RegexValidations.HeightAndWeightValidation(textBoxWeight.Text))
     {
         return(true);
     }
     else
     {
         // change the color of the specific textBox problem
         if (!RegexValidations.NameValidation(textBoxPlayerName.Text))
         {
             textBoxPlayerName.ForeColor = Color.Red;
         }
         if (!RegexValidations.NameValidation(textBoxExperience.Text))
         {
             textBoxPlayerName.ForeColor = Color.Red;
         }
         if (!RegexValidations.NameValidation(textBoxAge.Text))
         {
             textBoxPlayerName.ForeColor = Color.Red;
         }
         if (!RegexValidations.NameValidation(textBoxTitles.Text))
         {
             textBoxPlayerName.ForeColor = Color.Red;
         }
         if (!RegexValidations.NameValidation(textBoxHeight.Text))
         {
             textBoxPlayerName.ForeColor = Color.Red;
         }
         if (!RegexValidations.NameValidation(textBoxWeight.Text))
         {
             textBoxPlayerName.ForeColor = Color.Red;
         }
         return(false);
     }
 }