Example #1
0
 private void TextBoxToRed()
 {
     if (!(ValidatorService.IsLogin(Login_LogForm.Text.ToString())))
     {
         Login_LogForm.BackColor = Color.Red; IsTheUser = false;
     }
     if (!(ValidatorService.IsPassword(Password_LogForm.Text.ToString(), Login_LogForm.Text.ToString())))
     {
         Password_LogForm.BackColor = Color.Red; IsTheUser = false;
     }
 }
 private void CheakFiled()
 {
     textBox_cours.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidCours(textBox_cours.Text.ToString())))
         {
             textBox_cours.BackColor = Color.Red;
         }
         else
         {
             textBox_cours.BackColor = Color.White;
         }
     };
     textBox_email.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidEmail(textBox_email.Text.ToString())))
         {
             textBox_email.BackColor = Color.Red;
         }
         else
         {
             textBox_email.BackColor = Color.White;
         }
     };
     textBox_faculty.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidStr(textBox_faculty.Text.ToString())))
         {
             textBox_faculty.BackColor = Color.Red;
         }
         else
         {
             textBox_faculty.BackColor = Color.White;
         }
     };
     textBox_gender.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidGender(textBox_gender.Text.ToString())))
         {
             textBox_gender.BackColor = Color.Red;
         }
         else
         {
             textBox_gender.BackColor = Color.White;
         }
     };
     textBox_name.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidName(textBox_name.Text.ToString())))
         {
             textBox_name.BackColor = Color.Red;
         }
         else
         {
             textBox_name.BackColor = Color.White;
         }
     };
     textBox_group.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidStr(textBox_group.Text.ToString())))
         {
             textBox_group.BackColor = Color.Red;
         }
         else
         {
             textBox_group.BackColor = Color.White;
         }
     };
     textBox_haveGrand.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidHaveGrand(textBox_haveGrand.Text.ToString())))
         {
             textBox_haveGrand.BackColor = Color.Red;
         }
         else
         {
             textBox_haveGrand.BackColor = Color.White;
         }
     };
     textBox_lastname.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidName(textBox_lastname.Text.ToString())))
         {
             textBox_lastname.BackColor = Color.Red;
         }
         else
         {
             textBox_lastname.BackColor = Color.White;
         }
     };
     textBox_numb.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidNumber(textBox_numb.Text.ToString())))
         {
             textBox_numb.BackColor = Color.Red;
         }
         else
         {
             textBox_numb.BackColor = Color.White;
         }
     };
     textBox_university.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidStr(textBox_university.Text.ToString())))
         {
             textBox_university.BackColor = Color.Red;
         }
         else
         {
             textBox_university.BackColor = Color.White;
         }
     };
     textBox_passw.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidStr(textBox_passw.Text.ToString())))
         {
             textBox_passw.BackColor = Color.Red;
         }
         else
         {
             textBox_passw.BackColor = Color.White;
         }
     };
     textBox_studentTicket.TextChanged += (q, w) =>
     {
         if (!(ValidatorService.ValidStudentTicket(textBox_studentTicket.Text.ToString())))
         {
             textBox_studentTicket.BackColor = Color.Red;
         }
         else
         {
             textBox_studentTicket.BackColor = Color.White;
         }
     };
 }
Example #3
0
        private void CheakFiled()
        {
            IsException = false;
            textBox_Edit_Cours.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidCours(textBox_Edit_Cours.Text.ToString())))
                {
                    textBox_Edit_Cours.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_Cours.BackColor = Color.White;
                }
            };
            textBox_Edit_Email.TextChanged += (q, w) =>

            {
                if (!(ValidatorService.ValidEmail(textBox_Edit_Email.Text.ToString())))
                {
                    textBox_Edit_Email.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_Email.BackColor = Color.White;
                }
            };
            textBox_Edit_Faculty.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidStr(textBox_Edit_Faculty.Text.ToString())))
                {
                    textBox_Edit_Faculty.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_Faculty.BackColor = Color.White;
                }
            };
            textBox_Edit_Gender.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidGender(textBox_Edit_Gender.Text.ToString())))
                {
                    textBox_Edit_Gender.BackColor = Color.Red;
                }
                else
                {
                    textBox_Edit_Gender.BackColor = Color.White;
                }
            };
            textBox_Edit_Name.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidName(textBox_Edit_Name.Text.ToString())))
                {
                    textBox_Edit_Name.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_Name.BackColor = Color.White;
                }
            };
            textBox_Edit_Group.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidStr(textBox_Edit_Group.Text.ToString())))
                {
                    textBox_Edit_Group.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_Group.BackColor = Color.White;
                }
            };
            textBox_Edit_HaveGrand.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidHaveGrand(textBox_Edit_HaveGrand.Text.ToString())))
                {
                    textBox_Edit_HaveGrand.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_HaveGrand.BackColor = Color.White;
                }
            };
            textBox_Edit_LastName.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidName(textBox_Edit_LastName.Text.ToString())))
                {
                    textBox_Edit_LastName.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_LastName.BackColor = Color.White;
                }
            };
            textBox_Edit_Number.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidNumber(textBox_Edit_Number.Text.ToString())))
                {
                    textBox_Edit_Number.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_Number.BackColor = Color.White;
                }
            };
            textBox_Edit_University.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidStr(textBox_Edit_University.Text.ToString())))
                {
                    textBox_Edit_University.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_University.BackColor = Color.White;
                }
            };
            textBox_Edit_Password.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidStr(textBox_Edit_Password.Text.ToString())))
                {
                    textBox_Edit_Password.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_Password.BackColor = Color.White;
                }
            };
            textBox_Edit_StudentTicket.TextChanged += (q, w) =>
            {
                if (!(ValidatorService.ValidStudentTicket(textBox_Edit_StudentTicket.Text.ToString())))
                {
                    textBox_Edit_StudentTicket.BackColor = Color.Red;
                    IsException = true;
                }
                else
                {
                    textBox_Edit_StudentTicket.BackColor = Color.White;
                }
            };
        }