Example #1
0
        public bool Validation()
        {
            // Return true if validation fails
            List <string> list = new List <string>
            {
                this.FirstName, this.LastName, this.Phone, this.Email
            };

            if (ValidationClass.CheckIfNull(list))
            {
                MessageBox.Show("Please make sure all fields are filled out.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(true);
            }

            if (ValidationClass.CheckPhone(this.Phone))
            {
                MessageBox.Show("Please enter a valid phone number.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(true);
            }

            if (ValidationClass.CheckEmail(this.Email))
            {
                MessageBox.Show("Please enter a valid email address.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(true);
            }

            return(false);
        }
Example #2
0
        private bool Validation()
        {
            List <string> list = new List <string>
            {
                this.FirstName,
                this.LastName,
                this.Street,
                this.Suburb,
                this.State,
                this.Postcode,
                this.Email,
                this.Phone,
                this.AccName,
                this.AccBSB,
                this.AccNumber
            };

            if (ValidationClass.CheckEmail(this.Email))
            {
                MessageBox.Show("Please enter a valid email address.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(true);
            }

            if (ValidationClass.CheckPhone(this.Phone))
            {
                MessageBox.Show("Please enter a valid phone number.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(true);
            }
            if (ValidationClass.CheckIfNull(list))
            {
                MessageBox.Show("Please make sure all fields are filled out.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(true);
            }



            if (ValidationClass.CheckPostcode(this.Postcode))
            {
                MessageBox.Show("Please enter a valid postcode.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(true);
            }


            return(false);
        }