Пример #1
0
        public bool CheckClientEntries()
        {
            bool allowAdd = true;

            //Name
            if (NewClient.Name == string.Empty)
            {
                ErrorMsgName     = "Please enter a name.";
                ErrorNameVisible = true;
                allowAdd         = false;
            }

            //Address
            if (NewClient.Address == string.Empty)
            {
                ErrorMsgAddress     = "Please enter an address.";
                ErrorAddressVisible = true;
                allowAdd            = false;
            }

            //Email
            if (NewClient.Email == string.Empty)
            {
                ErrorMsgEmail     = "Please enter an e-mail address.";
                ErrorEmailVisible = true;
                allowAdd          = false;
            }
            else
            if (!RegexUtil.ValidateEmailAddress().IsMatch(NewClient.Email))
            {
                ErrorMsgEmail     = "Please enter a valid e-mail address.";
                ErrorEmailVisible = true;
                allowAdd          = false;
            }

            //Phone Number
            if (NewClient.PhoneNumber == string.Empty)
            {
                ErrorMsgPhoneNum     = "Please enter a phone number.";
                ErrorPhoneNumVisible = true;
                allowAdd             = false;
            }
            else
            if (!RegexUtil.ValidatePhoneNumber().IsMatch(NewClient.PhoneNumber))
            {
                ErrorMsgPhoneNum     = "Please enter a valid 10 digit phone number.";
                ErrorPhoneNumVisible = true;
                allowAdd             = false;
            }

            return(allowAdd);
        }
        public bool CheckClientEntries()
        {
            bool allowAdd = true;

            //Name
            if (Client.Name == string.Empty)
            {
                ErrorMsgOptionName = "Please Enter ALL Entry Fields!";
                ErrorOptionNameVis = true;
                allowAdd           = false;
            }

            //Address
            if (Client.Address == string.Empty)
            {
                ErrorMsgOptionName = "Please Enter ALL Entry Fields!";
                ErrorOptionNameVis = true;
                allowAdd           = false;
            }

            //Email
            if (Client.Email == string.Empty)
            {
                ErrorMsgOptionName = "Please Enter ALL Entry Fields!";
                ErrorOptionNameVis = true;
                allowAdd           = false;
            }
            else
            if (!RegexUtil.ValidateEmailAddress().IsMatch(Client.Email))
            {
                ErrorMsgOptionName = "Please Enter ALL Entry Fields!";
                ErrorOptionNameVis = true;
                allowAdd           = false;
            }

            //Phone Number
            if (Client.PhoneNumber == string.Empty)
            {
                ErrorMsgOptionName = "Please Enter ALL Entry Fields!";
                ErrorOptionNameVis = true;
                allowAdd           = false;
            }
            else
            if (!RegexUtil.ValidatePhoneNumber().IsMatch(Client.PhoneNumber))
            {
                ErrorMsgOptionName = "Please Enter ALL Entry Fields!";
                ErrorOptionNameVis = true;
                allowAdd           = false;
            }

            return(allowAdd);
        }