private string GetValue(IOrganizationService service, string key, string defaultValue) { try { string value = SecureConfig.GetConfigValue(service, key); if (!string.IsNullOrEmpty(value)) { return(value); } return(defaultValue); } catch { return(defaultValue); } }
private decimal GetValue(IOrganizationService service, string key, decimal defaultValue) { try { string value = SecureConfig.GetConfigValue(service, key); if (!string.IsNullOrEmpty(value)) { return(defaultValue); } bool res = decimal.TryParse(value, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out decimal numberValue); if (!res) { bool res2 = decimal.TryParse(value.Replace(",", "."), NumberStyles.Any, CultureInfo.InvariantCulture, out numberValue); } return(numberValue); } catch { return(defaultValue); } }
private string GetBingMap(IOrganizationService service) { return(SecureConfig.GetConfigValue(service, "BingMapsKey")); }