public static IBOClient3 UpdateClientToIboClient(Client client, IBOClient3 sageClient) { sageClient.CT_Siret = client.Siret; // check sageClient.CT_Intitule = client.CompanyName; // check sageClient.CT_Qualite = client.LegalForm; sageClient.CT_Ape = client.Naf; sageClient.CT_Classement = client.CompanyName.Length > 17 ? client.CompanyName.Substring(0, 17) : client.CompanyName; sageClient.CT_Identifiant = client.VatIdentifier; sageClient.Telecom.EMail = client.CompanyEmail; sageClient.Telecom.Telephone = client.OwnerPhoneNumber; sageClient.Telecom.EMail = client.CompanyEmail; sageClient.Telecom.Portable = client.CompanyMobile; sageClient.Telecom.Telecopie = client.CompanyFax; sageClient.Telecom.Telephone = client.CompanyMobile; sageClient.Adresse.Adresse = client.MainAddress.MainAddress; sageClient.Adresse.Complement = client.MainAddress.AdressAdditional; sageClient.Adresse.CodePostal = client.MainAddress.ZipCode; sageClient.Adresse.Ville = client.MainAddress.City; sageClient.Adresse.Pays = client.MainAddress.Country; sageClient.CT_Identifiant = client.VatIdentifier; sageClient.WriteDefault(); // To do add delivery add return(sageClient); }
public static IBOClient3 CreateClientToIboClient(Client client, IBOClient3 sageClient) { sageClient.CT_Siret = client.Siret; sageClient.CT_Intitule = client.CompanyName; sageClient.CT_Qualite = client.LegalForm; sageClient.CT_Classement = client.CompanyName.Length > 17 ? client.CompanyName.Substring(0, 17) : client.CompanyName; sageClient.CT_Identifiant = client.VatIdentifier; sageClient.CT_Ape = client.Naf; sageClient.Telecom.EMail = client.CompanyEmail; sageClient.Telecom.Portable = client.CompanyPhoneNumber; sageClient.Telecom.Telecopie = client.CompanyFax; sageClient.Telecom.Telephone = client.CompanyMobile; sageClient.Adresse.Adresse = client.MainAddress.MainAddress; sageClient.Adresse.Complement = client.MainAddress.AdressAdditional; sageClient.Adresse.CodePostal = client.MainAddress.ZipCode; sageClient.Adresse.Ville = client.MainAddress.City; sageClient.Adresse.Pays = client.MainAddress.Country; sageClient.WriteDefault(); foreach (var contact in client.Contacts) { IBOTiersContact3 sageContact = (IBOTiersContact3)sageClient.FactoryTiersContact.Create(); sageContact.CouldModified(); sageContact.Civilite = (ContactCivilite)contact.Civility; sageContact.Nom = contact.LastName; sageContact.Prenom = contact.FirstName; sageContact.Telecom.Telephone = contact.PhoneNumber; sageContact.Telecom.Portable = contact.MobileNumber; sageContact.Telecom.EMail = contact.Email; sageContact.Fonction = contact.Position; sageContact.Write(); } sageClient.Read(); return(sageClient); }