Ejemplo n.º 1
0
        public static void UpdateUnsentNotifications(DbConnection connection, IEnumerable <int> ids)
        {
            var dbType = DatabaseTypeHelper.ResolveDatabaseType(connection);
            var query  = $@"UPDATE EXTERNAL_NOTIFICATION_QUEUE SET
				TRIES = TRIES + 1,
				MODIFIED = {SqlQuerySyntaxHelper.Now(dbType)}
			WHERE ID IN (SELECT Id FROM {SqlQuerySyntaxHelper.IdList(dbType, "@ids", "i")})"            ;

            ExecuteIdsQuery(connection, query, ids);
        }
Ejemplo n.º 2
0
        public static void UpdateUnsentNotifications(DbConnection connection, IEnumerable <int> ids, string lastExceptionMessage = null)
        {
            var dbType = DatabaseTypeHelper.ResolveDatabaseType(connection);
            var query  = $@"UPDATE SYSTEM_NOTIFICATION_QUEUE SET
				TRIES = TRIES + 1,
                LastExceptionMessage = @lastExceptionMessage,
				MODIFIED = {SqlQuerySyntaxHelper.Now(dbType)}
			WHERE ID IN (SELECT Id FROM {SqlQuerySyntaxHelper.IdList(dbType, "@ids", "i")})"            ;

            ExecuteIdsQuery(connection, query, ids, lastExceptionMessage);
        }
Ejemplo n.º 3
0
        public static void UpdateSentNotifications(DbConnection connection, IEnumerable <int> ids)
        {
            var dbType = DatabaseTypeHelper.ResolveDatabaseType(connection);
            var query  = $@"UPDATE SYSTEM_NOTIFICATION_QUEUE SET
				SENT = {SqlQuerySyntaxHelper.ToBoolSql(dbType, true)},
                LastExceptionMessage = NULL,
				MODIFIED = {SqlQuerySyntaxHelper.Now(dbType)}
			WHERE ID IN (SELECT Id FROM {SqlQuerySyntaxHelper.IdList(dbType, "@ids", "i")})"            ;

            ExecuteIdsQuery(connection, query, ids);
        }
 public AuthenticationService(DBConnector connector)
 {
     _connector     = connector;
     _clearSIDQuery = $@"UPDATE sessions_log SET sid = NULL {
             SqlQuerySyntaxHelper.Output(_connector.DatabaseType, new[] { "USER_ID", "SESSION_ID" })
         } WHERE sid = @sid {SqlQuerySyntaxHelper.Returning(_connector.DatabaseType, new[] { "USER_ID", "SESSION_ID" })}";
     _tokenQuery    = $@"select UserId, ExpirationDate
             from access_token
             where Token = @token and Application = @application and {
                     SqlQuerySyntaxHelper.Now(_connector.DatabaseType)
                  } < ExpirationDate";
 }