Exemplo n.º 1
0
        private bool IsValidMember()
        {
            bool isValid = true;

            NewMember.ErrorNames    = string.IsNullOrEmpty(NewMember.Names) ? AppResources.NameRequired : string.Empty;
            NewMember.ErrorSurnames = string.IsNullOrEmpty(NewMember.Surnames) ? AppResources.SunamesRequired : string.Empty;

            if (NewMember.IsVisiblePersonalData)
            {
                if (string.IsNullOrEmpty(NewMember.Email))
                {
                    NewMember.ErrorEmail = AppResources.MailRequired;
                }
                else
                {
                    NewMember.ErrorEmail = ValidatorHelper.IsValidEmail(NewMember.Email) ? string.Empty : AppResources.WriteValidEmail;
                }

                if (string.IsNullOrEmpty(NewMember.Phone))
                {
                    NewMember.ErrorPhone = AppResources.CellPhoneRequired;
                }
                else
                {
                    NewMember.ErrorPhone = ValidatorHelper.IsValidCellPhone(NewMember.Phone) ? string.Empty : AppResources.InvalidPhone;
                }
                isValid = string.IsNullOrEmpty(NewMember.ErrorEmail) && string.IsNullOrEmpty(NewMember.ErrorPhone);
            }

            return(isValid && string.IsNullOrEmpty(NewMember.ErrorNames) && string.IsNullOrEmpty(NewMember.ErrorSurnames));
        }
Exemplo n.º 2
0
        private bool ValidatePerson()
        {
            ErrorNames    = string.IsNullOrEmpty(Names) ? AppResources.NameRequired : string.Empty;
            ErrorSurnames = string.IsNullOrEmpty(Surnames) ? AppResources.SunamesRequired : string.Empty;

            if (IsVisiblePersonalData)
            {
                ErrorEmail = ValidatorHelper.IsValidEmail(Email) ? string.Empty : AppResources.WriteValidEmail;
                ErrorPhone = ValidatorHelper.IsValidCellPhone(Phone) ? string.Empty : AppResources.InvalidPhone;
            }

            return(string.IsNullOrEmpty(ErrorNames) && string.IsNullOrEmpty(ErrorSurnames) && string.IsNullOrEmpty(ErrorPhone) && string.IsNullOrEmpty(ErrorEmail));
        }
        private bool ValidateData()
        {
            ErrorCellPhone = string.IsNullOrEmpty(CellPhoneNumber) ? AppResources.CellPhoneRequired : string.Empty;
            ErrorEmail     = string.IsNullOrEmpty(Email) ? AppResources.MailRequired : string.Empty;
            ErrorPhone     = string.IsNullOrEmpty(Email) ? AppResources.PhoneRequired : string.Empty;

            if (string.IsNullOrEmpty(ErrorCellPhone) && string.IsNullOrEmpty(ErrorEmail))
            {
                ErrorEmail     = ValidatorHelper.IsValidEmail(Email) ? string.Empty : AppResources.WriteValidEmail;
                ErrorCellPhone = ValidatorHelper.IsValidCellPhone(CellPhoneNumber) ? string.Empty : AppResources.InvalidPhone;
                //ErrorPhone = ValidatorHelper.IsValidPhone(Phone) ? string.Empty : AppResources.InvalidPhone;
            }

            return(string.IsNullOrEmpty(ErrorEmail) && string.IsNullOrEmpty(ErrorCellPhone));
        }
        private void ValidateCellPhoneNumbers()
        {
            if (string.IsNullOrEmpty(Phone))
            {
                ErrorPhone = string.Empty;
            }
            else
            {
                ErrorPhone = ValidatorHelper.IsValidPhone(Phone) ? string.Empty : AppResources.InvalidPhone;
            }

            if (string.IsNullOrEmpty(CellPhone))
            {
                ErrorCellPhone = AppResources.CellPhoneRequired;
                return;
            }

            ErrorCellPhone = ValidatorHelper.IsValidCellPhone(CellPhone) ? string.Empty : AppResources.InvalidPhone;
        }