示例#1
0
        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.");
            }
        }
示例#2
0
        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.");
            }
        }
示例#3
0
        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);
        }
示例#4
0
 public static string GetTicketingConnectionString()
 {
     return(BMCRegistryHelper.GetExchangeRegKeyValueDecrypt(string.Empty, "TicketingSQLConnect"));
 }
示例#5
0
 public static string GetAuditConnectionString()
 {
     return(BMCRegistryHelper.GetEnterpriseRegKeyValueDecrypt("Settings", "AuditSQLConnect"));
 }