Beispiel #1
0
        public ErrorDataCollection CheckPerson(Person person)
        {
            //todo should not be empty or invalid
            ErrorDataCollection ed = new ErrorDataCollection();


            if (person == null)
            {
                ed.AppendError(new ValidationError("Value Empty"));
            }
            else
            {
                ed.AppendError(CheckEmail(person.Email));
                ed.AppendError(IsValidPhoneNumber(person.Phone));
            }

            return(ed);
        }
Beispiel #2
0
        public ErrorDataCollection checkCompany(Company company)
        {
            ErrorDataCollection se = new ErrorDataCollection();

            if (company == null)
            {
                se.AppendError(new ValidationError("Value Empty"));
            }
            else
            {
                se.AppendError(CheckCpyName(company.CpyName));
                se.AppendError(CheckAddress(company.CpyAdress));
                se.AppendError(CheckCity(company.CpyAdress));
                se.AppendError(CheckCountry(company.CpyAdress));
                se.AppendError(CheckZipcode(company.CpyAdress));
            }
            return(se);
        }