private static bool ShowUpdateProductNotification(string productTag) { ModuleInfo moduleInfo = ModulesCollector.GetModuleInfo(productTag); if (string.IsNullOrEmpty(moduleInfo.get_ValidateUpdateNotification())) { return(true); } try { using (IInformationServiceProxy2 iinformationServiceProxy2 = ((IInformationServiceProxyCreator)SwisConnectionProxyPool.GetSystemCreator()).Create()) { CoreHelper._log.DebugFormat("Calling SWQL query: {0}", (object)moduleInfo.get_ValidateUpdateNotification()); DataTable dataTable = ((IInformationServiceProxy)iinformationServiceProxy2).Query(moduleInfo.get_ValidateUpdateNotification()); if (dataTable.Columns.Count == 1 || dataTable.Rows.Count == 1) { return(dataTable.Rows[0][0] == null || Convert.ToBoolean(dataTable.Rows[0][0])); } CoreHelper._log.WarnFormat("Invalid query: {0}", (object)moduleInfo.get_ValidateUpdateNotification()); return(true); } } catch (Exception ex) { CoreHelper._log.ErrorFormat("Execution of ValidateUpdateNotification '{0}' has failed. Exception: {1}", (object)moduleInfo.get_ValidateUpdateNotification(), (object)ex); return(true); } }
public static CustomerEnvironmentInfoPack GetEnvironmentInfoPack() { CustomerEnvironmentInfoPack environmentInfoPack = new CustomerEnvironmentInfoPack(); environmentInfoPack.OSVersion = Environment.OSVersion.VersionString; MaintenanceRenewalsCheckStatusDAL checkStatus = MaintenanceRenewalsCheckStatusDAL.GetCheckStatus(); DateTime minValue; if (checkStatus != null) { DateTime?lastUpdateCheck = checkStatus.LastUpdateCheck; if (lastUpdateCheck.HasValue) { lastUpdateCheck = checkStatus.LastUpdateCheck; minValue = lastUpdateCheck.Value; goto label_4; } } minValue = DateTime.MinValue; label_4: environmentInfoPack.LastUpdateCheck = minValue; environmentInfoPack.OrionDBVersion = DatabaseInfoDAL.GetOrionDBVersion(); environmentInfoPack.SQLVersion = DatabaseInfoDAL.GetSQLEngineVersion(); environmentInfoPack.Modules = MaintUpdateNotifySvcWrapper.GetModules(ModulesCollector.GetInstalledModules()); environmentInfoPack.CustomerUniqueId = ModulesCollector.GetCustomerUniqueId(); return(environmentInfoPack); }
// Token: 0x06000318 RID: 792 RVA: 0x000139C8 File Offset: 0x00011BC8 private static bool ShowUpdateProductNotification(string productTag) { ModuleInfo moduleInfo = ModulesCollector.GetModuleInfo(productTag); if (string.IsNullOrEmpty(moduleInfo.ValidateUpdateNotification)) { return(true); } bool result; try { using (IInformationServiceProxy2 informationServiceProxy = SwisConnectionProxyPool.GetSystemCreator().Create()) { CoreHelper._log.DebugFormat("Calling SWQL query: {0}", moduleInfo.ValidateUpdateNotification); DataTable dataTable = informationServiceProxy.Query(moduleInfo.ValidateUpdateNotification); if (dataTable.Columns.Count != 1 && dataTable.Rows.Count != 1) { CoreHelper._log.WarnFormat("Invalid query: {0}", moduleInfo.ValidateUpdateNotification); result = true; } else { result = (dataTable.Rows[0][0] == null || Convert.ToBoolean(dataTable.Rows[0][0])); } } } catch (Exception ex) { CoreHelper._log.ErrorFormat("Execution of ValidateUpdateNotification '{0}' has failed. Exception: {1}", moduleInfo.ValidateUpdateNotification, ex); result = true; } return(result); }
// Token: 0x06000802 RID: 2050 RVA: 0x000398E8 File Offset: 0x00037AE8 public static void UpdateParticipationFromInstalledProducts(out bool needsreflow) { IEnumerable <PackageInfo> installedPackages = PackageManager.Instance.GetInstalledPackages(); List <ModuleInfo> installedModules = ModulesCollector.GetInstalledModules(); IEnumerable <string> values = from name in (from package in installedPackages select package.PackageId).Concat(from module in installedModules select module.ProductShortName) select '\'' + name.Replace("'", "''") + '\''; using (SqlCommand textCommand = SqlHelper.GetTextCommand(new StringBuilder("UPDATE dbo.[NodeChildStatusParticipation] set Installed=0 Where ModuleName not in (").Append(string.Join(",", values)).Append(')').ToString())) { int num = SqlHelper.ExecuteNonQuery(textCommand); needsreflow = (num > 0); } }
// Token: 0x06000320 RID: 800 RVA: 0x00013D4C File Offset: 0x00011F4C public static CustomerEnvironmentInfoPack GetEnvironmentInfoPack() { CustomerEnvironmentInfoPack customerEnvironmentInfoPack = new CustomerEnvironmentInfoPack(); OperatingSystem osversion = Environment.OSVersion; customerEnvironmentInfoPack.OSVersion = osversion.VersionString; MaintenanceRenewalsCheckStatusDAL checkStatus = MaintenanceRenewalsCheckStatusDAL.GetCheckStatus(); customerEnvironmentInfoPack.LastUpdateCheck = ((checkStatus != null && checkStatus.LastUpdateCheck != null) ? checkStatus.LastUpdateCheck.Value : DateTime.MinValue); customerEnvironmentInfoPack.OrionDBVersion = DatabaseInfoDAL.GetOrionDBVersion(); customerEnvironmentInfoPack.SQLVersion = DatabaseInfoDAL.GetSQLEngineVersion(); customerEnvironmentInfoPack.Modules = MaintUpdateNotifySvcWrapper.GetModules(ModulesCollector.GetInstalledModules()); customerEnvironmentInfoPack.CustomerUniqueId = ModulesCollector.GetCustomerUniqueId(); return(customerEnvironmentInfoPack); }
public static void UpdateParticipationFromInstalledProducts(out bool needsreflow) { using (SqlCommand textCommand = SqlHelper.GetTextCommand(new StringBuilder("UPDATE dbo.[NodeChildStatusParticipation] set Installed=0 Where ModuleName not in (").Append(string.Join(",", ((IPackageManager)SolarWinds.Orion.Core.Common.PackageManager.PackageManager.Instance).GetInstalledPackages().Select <PackageInfo, string>((Func <PackageInfo, string>)(package => package.get_PackageId())).Concat <string>(((IEnumerable <ModuleInfo>)ModulesCollector.GetInstalledModules()).Select <ModuleInfo, string>((Func <ModuleInfo, string>)(module => module.get_ProductShortName()))).Select <string, string>((Func <string, string>)(name => '\''.ToString() + name.Replace("'", "''") + (object)'\'')))).Append(')').ToString())) { int num = SqlHelper.ExecuteNonQuery(textCommand); needsreflow = num > 0; } }