//TOOD: Handle exceptions;
        private ZCRMOrganization GetZCRMOrganization(JObject orgDetails)
        {
            ZCRMOrganization organization = ZCRMOrganization.GetInstance((string)orgDetails["company_name"], (long)orgDetails["id"]);

            organization.Alias          = (string)orgDetails["alias"];
            organization.PrimaryZuid    = (long)orgDetails["primary_zuid"];
            organization.Zgid           = (long)orgDetails["zgid"];
            organization.Phone          = (string)orgDetails["phone"];
            organization.Mobile         = (string)orgDetails["mobile"];
            organization.Website        = (string)orgDetails["website"];
            organization.PrimaryEmail   = (string)orgDetails["primary_email"];
            organization.EmployeeCount  = Convert.ToInt32(orgDetails["employee_count"].Type != JTokenType.Null ? orgDetails["employee_count"] : 0); //check the value is null/empty
            organization.Description    = (string)orgDetails["description"];
            organization.Timezone       = (string)orgDetails["time_zone"];
            organization.IsoCode        = (string)orgDetails["iso_code"];
            organization.CurrencyLocale = (string)orgDetails["currency_locale"];
            organization.CurrencySymbol = (string)orgDetails["currency_symbol"];
            organization.Street         = (string)orgDetails["street"];
            organization.State          = (string)orgDetails["state"];
            organization.City           = (string)orgDetails["city"];
            organization.Country        = (string)orgDetails["country"];
            organization.CountryCode    = (string)orgDetails["country_code"];
            organization.ZipCode        = (string)orgDetails["zip"];
            organization.McStatus       = (bool)orgDetails["mc_status"];
            organization.GappsEnabled   = (bool)orgDetails["gapps_enabled"];

            return(organization);
        }
Esempio n. 2
0
 /// <summary>
 /// To get ZohoCRM Organization instance.
 /// </summary>
 /// <returns>ZCRMOrganization class instance.</returns>
 public ZCRMOrganization GetOrganizationInstance()
 {
     return(ZCRMOrganization.GetInstance());
 }