Esempio n. 1
0
        public EPGCheck()
        {
            try
            {
                var beIMGDatasource = DBConfig.GetDBs().Where(x => x.Type == DSType.TSQL && x.Role == FiOSRole.AdminConsole).First();

                this.beIMGAppConnectionStr   = beIMGDatasource.CreateConnectionString(beIMGDatasource.Databases.Where(x => x.Location == FiOSLocation.VHE && x.Function == DbFunction.Application).FirstOrDefault());
                this.beIMGAdminConnectionStr = beIMGDatasource.CreateConnectionString(beIMGDatasource.Databases.Where(x => x.Location == FiOSLocation.VHE && x.Function == DbFunction.Admin).FirstOrDefault());

                if (string.IsNullOrEmpty(this.beIMGAppConnectionStr))
                {
                    throw new Exception("IMG Application connection string cannot be null.");
                }

                if (string.IsNullOrEmpty(this.beIMGAdminConnectionStr))
                {
                    throw new Exception("IMG Admin connection string cannot be null.");
                }

                hruCol            = new HealthRollupCollection(() => new HealthRollup());
                isCancelRequested = false;
            }
            catch (Exception ex)
            {
                throw new Exception("No SQL datasources could be found in the configuration for Admin Console. " + ex.Message);
            }
        }