Пример #1
0
        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);
            }
        }
Пример #2
0
        // 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);
        }