public void Update( PowerofficeApiClient.Models.Customer powerofficeOrganisation, PowerofficeConfiguration configuration) { const int webcrmOrganisationNameMaximumLength = 50; OrganisationAddress = powerofficeOrganisation.MailAddress.ConcatenatedAddress; OrganisationCity = powerofficeOrganisation.MailAddress.City; OrganisationName = powerofficeOrganisation.Name.Truncate(webcrmOrganisationNameMaximumLength); OrganisationPostCode = powerofficeOrganisation.MailAddress.ZipCode; OrganisationTelephone = powerofficeOrganisation.PhoneNumber; OrganisationWww = powerofficeOrganisation.WebsiteUrl; if (!string.IsNullOrWhiteSpace(configuration.OrganisationNumberFieldName)) { this.SetPropertyValue(configuration.OrganisationNumberFieldName, powerofficeOrganisation.Code.ToString()); } if (!string.IsNullOrWhiteSpace(configuration.OrganisationVatNumberFieldName)) { this.SetPropertyValue(configuration.OrganisationVatNumberFieldName, powerofficeOrganisation.VatNumber); } if (!string.IsNullOrWhiteSpace(configuration.PrimaryDeliveryAddressFieldName)) { this.SetPropertyValue(configuration.PrimaryDeliveryAddressFieldName, powerofficeOrganisation.ConcatenatedPrimaryStreetAddress); } SetPowerofficeOrganisationId(configuration.OrganisationIdFieldName, powerofficeOrganisation.Id); }
public OrganisationDto( PowerofficeApiClient.Models.Customer powerofficeOrganisation, PowerofficeConfiguration configuration) { Update(powerofficeOrganisation, configuration); OrganisationStatus = configuration.FirstAcceptedOrganisationStatus; OrganisationType = configuration.FirstAcceptedOrganisationType; }
/// <summary>Check if this webCRM organisation contains any updates that should be copied to PowerOffice.</summary> public bool HasChangesRelevantToPoweroffice( PowerofficeApiClient.Models.Customer powerofficeOrganisation, PowerofficeConfiguration configuration) { return(powerofficeOrganisation.HasRelevantChanges(this, configuration)); }