Beispiel #1
0
        protected of.data.Contact Get_or_create_of_contact(crm.Contact crm_contact)
        {
            of.data.Contact of_contact = null;

            if (crm_contact.nrq_of_id.HasValue)
            {
                of_contact = _of_connection.Contact.Get(crm_contact.nrq_of_id.Value);
            }
            else
            {
                of_contact = new of.data.Contact();
                Mapping.Contact.To_of(crm_contact, of_contact);

                of.data.IdResponse response = _of_connection.Contact.Post(of_contact);

                crm.Contact update_crm_contact = new crm.Contact(_service, _tracingService)
                {
                    nrq_of_id = response.Id,
                    Id        = crm_contact.Id
                };
                update_crm_contact.Update();
            }

            return(of_contact);
        }
Beispiel #2
0
        private void Create_of_abonnement(crm.Abonnement crm_abonnement)
        {
            of.data.Subscription of_abonnement = new of.data.Subscription();

            Mapping.Subscription.To_of(crm_abonnement, of_abonnement);

            Attach_of_contact_if_missing(crm_abonnement);

            of.data.IdResponse id_response = _of_connection.Subscription.Post(of_abonnement);

            crm.Abonnement crm_abonnement_update = new crm.Abonnement(_service, _tracingService)
            {
                Id        = crm_abonnement.Id,
                Nrq_of_id = id_response.Id
            };
            crm_abonnement_update.Update();
        }