Exemple #1
0
        public MicrosoftDynamicsCRMadoxioLicences GetLicenceByIdWithChildren(string id)
        {
            MicrosoftDynamicsCRMadoxioLicences result;

            try
            {
                // adoxio_Licencee,adoxio_establishment
                // Note that adoxio_Licencee is the Account linked to the licence
                var expand = new List <string> {
                    "adoxio_Licencee", "adoxio_establishment", "adoxio_LicenceType", "adoxio_ThirdPartyOperatorId",
                    "adoxio_adoxio_licences_adoxio_application_AssignedLicence", "adoxio_ProposedOperator", "adoxio_ProposedOwner"
                };
                result = Licenceses.GetByKey(adoxioLicencesid: id, expand: expand);
            }
            catch (HttpOperationException)
            {
                // return null if we can't get results.
                result = null;
            }

            if (result != null && result.AdoxioLicencee != null)
            {
                if (!string.IsNullOrEmpty(result.AdoxioLicencee._primarycontactidValue))
                {
                    // get the contact.
                    var runner = GetContactById(Guid.Parse(result.AdoxioLicencee._primarycontactidValue));
                    runner.Wait();
                    result.AdoxioLicencee.Primarycontactid = runner.Result;
                }
            }

            return(result);
        }
Exemple #2
0
        public MicrosoftDynamicsCRMadoxioLicences GetLicenceById(string id)
        {
            MicrosoftDynamicsCRMadoxioLicences result;

            try
            {
                result = Licenceses.GetByKey(adoxioLicencesid: id);
            }
            catch (HttpOperationException)
            {
                result = null;
            }

            return(result);
        }