コード例 #1
0
ファイル: Person.cs プロジェクト: Fonsaca/EasyVan
 private bool ValidatePhones()
 {
     if (Phones == null || !Phones.Any())
     {
         this.Notification.AddMessage(false, NotificationMessageType.ERROR, "Informe pelo menos um numero para contato");
     }
     else
     {
         return(true);
     }
     return(false);
 }
コード例 #2
0
        private Contact ExtractContact()
        {
            Contact contact = new Contact()
            {
                FormattedName      = FormattedName,
                Name1              = Prefix,
                Name2              = Surname,
                Name3              = GivenName,
                Name4              = MiddleName,
                NickName           = GivenName,
                Sortstring         = SortString,
                Birthday           = Birthday,
                Title              = Title,
                Organization       = Org,
                Note               = Note,
                EmailProgram       = Mailer,
                GlobalPositionning = Geocodage,
                LastRevision       = LastRevision,
                Logo               = Logo,
                Occupation         = Occupation,
                Photo              = Photo,
                Sound              = Sound,
                UniqueIdentifier   = UniqueIdentifier,
                Url       = Url,
                Category  = Category,
                TimeZone  = TimeZone,
                PublicKey = Key,
                Version   = Version,
            };

            if (Phones != null && Phones.Any())
            {
                contact.Phones = Phones.ToList();
            }
            if (Addresses != null && Addresses.Any())
            {
                contact.Addresses = Addresses.ToList();
            }
            if (Emails != null && Emails.Any())
            {
                contact.Mails = Emails.ToList();
            }
            contact.GeneratePhoto();
            return(contact);
        }
コード例 #3
0
        public Result <bool> AddPhone(GroupPhone groupPhone, string number)
        {
            var errors = new List <string>();

            if (Phones.Any(phone => phone.Number.Equals(number, StringComparison.OrdinalIgnoreCase)))
            {
                errors.Add("This number already exists");
            }

            if (errors.Any())
            {
                return(Result <bool> .Fail(errors));
            }

            var result = Phone.Create(groupPhone, number);

            PhoneInternal.Add(result.Value);
            return(Result <bool> .Success(true));
        }
コード例 #4
0
ファイル: Run.cs プロジェクト: rdavidson1994/NameGenerator
 public bool HasPrimaryStress()
 {
     return(Phones.Any(x => x.HasPrimaryStress()));
 }