public static string GetConnectionString(BMCCategorizedInstallationTypes installationType) { switch (installationType) { case BMCCategorizedInstallationTypes.Exchange: return(BMCRegistryHelper.GetRegKeyValueDecrypt(BMCInstallationType.ExchangeClient, string.Empty, "SQLConnect")); case BMCCategorizedInstallationTypes.Enterprise: return(BMCRegistryHelper.GetRegKeyValueDecrypt(BMCInstallationType.EnterpriseClient, "Settings", "SQLConnect")); default: throw new InvalidDataException("Registry key does not Exist. Please check if Registry key is set."); } }
public static string GetRegKeyValueByInstallationType(string keyName, string defaultValue) { switch (ActiveInstallationType) { //case BMCInstallationType.ExchangeServer: //case BMCInstallationType.ExchangeClient: case BMCCategorizedInstallationTypes.Exchange: return(BMCRegistryHelper.GetRegKeyValue(BMCInstallationType.ExchangeClient, string.Empty, keyName, defaultValue)); //case BMCInstallationType.EnterpriseServer: //case BMCInstallationType.EnterpriseClient: case BMCCategorizedInstallationTypes.Enterprise: return(BMCRegistryHelper.GetRegKeyValue(BMCInstallationType.EnterpriseClient, "Settings", keyName, defaultValue)); default: throw new InvalidDataException("Registry key does not Exist. Please check if Registry key is set."); } }
private static bool _StoreConnectionString(string connectionString, string database) { //BMCInstallationType installationType = BMCRegistryHelper.GetInstallationType(); switch (BMCRegistryHelper.ActiveInstallationType) { //case BMCInstallationType.ExchangeServer: //case BMCInstallationType.ExchangeClient: case BMCCategorizedInstallationTypes.Exchange: { if (database.ToLower() == "ticketing") { BMCRegistryHelper.SetRegKeyValueEncrypt(BMCInstallationType.ExchangeClient, string.Empty, "TicketingSQLConnect", RegistryValueKind.String, connectionString); } else { BMCRegistryHelper.SetRegKeyValueEncrypt(BMCInstallationType.ExchangeClient, string.Empty, "SQLConnect", RegistryValueKind.String, connectionString); } } break; case BMCCategorizedInstallationTypes.Enterprise: { if (database == "Audit") { BMCRegistryHelper.SetRegKeyValueEncrypt(BMCInstallationType.EnterpriseClient, "Settings", "AuditSQLConnect", RegistryValueKind.String, connectionString); } else { BMCRegistryHelper.SetRegKeyValueEncrypt(BMCInstallationType.EnterpriseClient, "Settings", "SQLConnect", RegistryValueKind.String, connectionString); } } break; default: break; } return(true); }
public static string GetTicketingConnectionString() { return(BMCRegistryHelper.GetExchangeRegKeyValueDecrypt(string.Empty, "TicketingSQLConnect")); }
public static string GetAuditConnectionString() { return(BMCRegistryHelper.GetEnterpriseRegKeyValueDecrypt("Settings", "AuditSQLConnect")); }