private static void Notify(string connectionString, int id, string code, bool disableInternalNotifications)
        {
            using (new TransactionScope(TransactionScopeOption.Suppress, new TransactionOptions {
                IsolationLevel = IsolationLevel.ReadCommitted
            }))
            {
                var cnn = new DBConnector(connectionString)
                {
                    CacheData = false,
                    DisableServiceNotifications  = true,
                    DisableInternalNotifications = disableInternalNotifications,
                    ExternalExceptionHandler     = HandleException,
                    ThrowNotificationExceptions  = false
                };

                QPConfiguration.SetAppSettings(cnn.DbConnectorSettings);

                try
                {
                    foreach (var simpleCode in code.Split(';'))
                    {
                        cnn.SendNotification(id, simpleCode);
                    }
                }
                catch (Exception ex)
                {
                    HandleException(ex);
                }
            }
        }
Esempio n. 2
0
        public void SendNotification(string connectionString, int siteId, string code, int id, bool isLive)
        {
            var cnn = new DBConnector(connectionString)
            {
                CacheData = false
            };

            QPConfiguration.SetAppSettings(cnn.DbConnectorSettings);
            cnn.SendNotification(siteId, code, id, string.Empty, isLive);
        }
        private static void Notify(string connectionString, int id, string code, bool disableInternalNotifications)
        {
            var cnn = new DBConnector(connectionString)
            {
                CacheData = false,
                DisableServiceNotifications  = true,
                DisableInternalNotifications = disableInternalNotifications,
                ExternalExceptionHandler     = HandleException,
                ThrowNotificationExceptions  = false
            };

            QPConfiguration.SetAppSettings(cnn.AppSettings);
            foreach (var simpleCode in code.Split(';'))
            {
                cnn.SendNotification(id, simpleCode);
            }
        }