Beispiel #1
0
 internal Contact(ContactId id,
                  string firstName,
                  string lastName,
                  string organisationName,
                  string websiteUrl,
                  string notes,
                  IList <Phone> phones,
                  IList <Address> addresses,
                  IList <Email> emails,
                  IList <Category> categories,
                  IList <Tag> tags,
                  IList <CustomField> customFields)
 {
     CreateOrUpdate(id,
                    firstName,
                    lastName,
                    organisationName,
                    websiteUrl,
                    notes,
                    phones,
                    addresses,
                    emails,
                    categories,
                    tags,
                    customFields
                    );
 }
Beispiel #2
0
        private void CreateOrUpdate(ContactId id,
                                    string firstName,
                                    string lastName,
                                    string organisationName,
                                    string websiteUrl,
                                    string notes,
                                    IList <Phone> phones,
                                    IList <Address> addresses,
                                    IList <Email> emails,
                                    IList <Category> categories,
                                    IList <Tag> tags,
                                    IList <CustomField> customFields)
        {
            Id               = id;
            FirstName        = firstName;
            LastName         = lastName;
            OrganisationName = organisationName;
            WebsiteUrl       = websiteUrl;
            Notes            = notes;
            Phones           = phones ?? new List <Phone>();
            Addresses        = addresses ?? new List <Address>();
            Emails           = emails ?? new List <Email>();
            Categories       = categories ?? new List <Category>();
            Tags             = tags ?? new List <Tag>();
            CustomFields     = customFields ?? new List <CustomField>();

            CheckRule(new ContactNameMustBeFilledRule(this));
            CheckRule(new ContactNotesMustBelow200CharsRule(this));
            CheckRule(new ContactWebSiteUrlMustBeValidRule(this));
        }