Ejemplo n.º 1
0
        private bool Validation()
        {
            List <string> list = new List <string>
            {
                this.Name,
                this.Street,
                this.Suburb,
                this.State,
                this.Postcode,
                this.Branch,
                this.Description,
                this.Location.Description
            };

            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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        private bool Validation(int ContractorId)
        {
            List <int> list = new List <int> {
                this.LocationId, ContractorId
            };

            if (ValidationClass.CheckIfNull(list))
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 4
0
        private bool Validation()
        {
            List <string> list = new List <string> {
                this.Description, this.City
            };

            if (ValidationClass.CheckIfNull(list))
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 5
0
        private bool Validation(int ContractorId)
        {
            List <string> list = new List <string> {
                this.Description
            };

            if (ValidationClass.CheckIfNull(list))
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 6
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);
        }