internal bool RegexValidation()
        {
            formError = true;
            bool fname = false, lname = false, path = false;

            if (formError)
            {
                fname = RegExpressions.RegexName(txt_FirstName.Text);
                if (!fname)
                {
                    txt_FirstName.Focus();
                    formError = false;
                }
            }
            if (formError)
            {
                lname = RegExpressions.RegexName(txt_LastName.Text);
                if (!lname)
                {
                    txt_LastName.Focus();
                    formError = false;
                }
            }

            if (formError)
            {
                path = RegExpressions.RegexFilePath(txt_FilePath.Text);
                if (!path)
                {
                    formError = false;
                }
            }

            if (fname && lname && path)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        internal bool RegexValidation()
        {
            formError = true;
            bool fname = false, lname = false, phone = false, email = false, address = false, city = false, zip = false, path = false;

            if (formError)
            {
                fname = RegExpressions.RegexName(txt_FirstName.Text);
                if (!fname)
                {
                    txt_FirstName.Focus();
                    formError = false;
                }
            }
            if (formError)
            {
                lname = RegExpressions.RegexName(txt_LastName.Text);
                if (!lname)
                {
                    txt_LastName.Focus();
                    formError = false;
                }
            }
            if (formError)
            {
                phone = RegExpressions.RegexPhoneNumber(txt_PhoneNumber.Text);
                if (!phone)
                {
                    txt_PhoneNumber.Focus();
                    formError = false;
                }
            }
            if (formError)
            {
                email = RegExpressions.RegexEmail(txt_Email.Text);
                if (!email)
                {
                    txt_Email.Focus();
                    formError = false;
                }
            }
            if (formError)
            {
                address = RegExpressions.RegexAddress(txt_Address.Text);
                if (!address)
                {
                    txt_Address.Focus();
                    formError = false;
                }
            }
            if (formError)
            {
                city = RegExpressions.RegexCity(txt_City.Text);
                if (!city)
                {
                    txt_City.Focus();
                    formError = false;
                }
            }
            if (formError)
            {
                zip = RegExpressions.RegexZIP(txt_Zip.Text);
                if (!zip)
                {
                    txt_Zip.Focus();
                    formError = false;
                }
            }

            if (formError)
            {
                path = RegExpressions.RegexFilePath(txt_FilePath.Text);
                if (!path)
                {
                    formError = false;
                }
            }

            if (fname && lname && phone && email && address && city && zip && path)
            {
                return(true);
            }

            return(false);
        }