/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { if ((this._parent.StreetAddress == null)) { IStreetAddress streetAddressCasted = item.As <IStreetAddress>(); if ((streetAddressCasted != null)) { this._parent.StreetAddress = streetAddressCasted; return; } } if ((this._parent.ElectronicAddress == null)) { IElectronicAddress electronicAddressCasted = item.As <IElectronicAddress>(); if ((electronicAddressCasted != null)) { this._parent.ElectronicAddress = electronicAddressCasted; return; } } if ((this._parent.PostalAddress == null)) { IPostalAddress postalAddressCasted = item.As <IPostalAddress>(); if ((postalAddressCasted != null)) { this._parent.PostalAddress = postalAddressCasted; return; } } if ((this._parent.Phone1 == null)) { ITelephoneNumber phone1Casted = item.As <ITelephoneNumber>(); if ((phone1Casted != null)) { this._parent.Phone1 = phone1Casted; return; } } if ((this._parent.Phone2 == null)) { ITelephoneNumber phone2Casted = item.As <ITelephoneNumber>(); if ((phone2Casted != null)) { this._parent.Phone2 = phone2Casted; return; } } IMarketRole marketRolesCasted = item.As <IMarketRole>(); if ((marketRolesCasted != null)) { this._parent.MarketRoles.Add(marketRolesCasted); } IBusinessRole businessRolesCasted = item.As <IBusinessRole>(); if ((businessRolesCasted != null)) { this._parent.BusinessRoles.Add(businessRolesCasted); } }
public SimplePostalAddress(string addressee, IStreetAddress streetAddress, ILocality locality, IAdministrativeRegion administrativeRegion, IPostalCode postalCode, RegionInfo country, double?latitude, double?longtitude) { Addressee = addressee; StreetAddress = streetAddress; Locality = locality; AdministrativeRegion = administrativeRegion; PostalCode = postalCode; Country = country; Latitude = latitude; Longtitude = longtitude; }
public static bool HaveSameValues(this IStreetAddress from, IStreetAddress to) { if (from.FullName != to.FullName) { return(false); } if (from.ContactPhoneNumber != to.ContactPhoneNumber) { return(false); } if (from.AddressLine1 != to.AddressLine1) { return(false); } if (from.AddressLine2 != to.AddressLine2) { return(false); } if (from.AddressLine3 != to.AddressLine3) { return(false); } if (from.Postcode != to.Postcode) { return(false); } if (from.City != to.City) { return(false); } if (from.Country != to.Country) { return(false); } if (from.IsDefault != to.IsDefault) { return(false); } if (from.Type != to.Type) { return(false); } if (from.OtherInformation != to.OtherInformation) { return(false); } return(true); }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { if ((this._parent.Address == null)) { IStreetAddress addressCasted = item.As <IStreetAddress>(); if ((addressCasted != null)) { this._parent.Address = addressCasted; return; } } if ((this._parent.CallBack == null)) { ICallBack callBackCasted = item.As <ICallBack>(); if ((callBackCasted != null)) { this._parent.CallBack = callBackCasted; return; } } if ((this._parent.MeetingInterval == null)) { IDateTimeInterval meetingIntervalCasted = item.As <IDateTimeInterval>(); if ((meetingIntervalCasted != null)) { this._parent.MeetingInterval = meetingIntervalCasted; return; } } IErpPerson erpPersonsCasted = item.As <IErpPerson>(); if ((erpPersonsCasted != null)) { this._parent.ErpPersons.Add(erpPersonsCasted); } }