Example #1
0
        public static void DeleteByCategory(int categoryId)
        {
            var sql = @"
            DELETE FROM SocketBoxPatterns
            WHERE CategoryId = " + categoryId;

            var db = SocketBoxPattern.GetDatabase();

            db.ExecuteNonQuery(sql);
        }
Example #2
0
        public static void Delete(int patternId)
        {
            var sql = @"
            DELETE FROM SocketBoxPatterns
            WHERE Id = " + patternId;

            var db = SocketBoxPattern.GetDatabase();

            db.ExecuteNonQuery(sql);
        }
Example #3
0
        public static int GetNewId()
        {
            var sql = @"SELECT MAX(Id) FROM SocketBoxPatterns";
            var db  = SocketBoxPattern.GetDatabase();
            var obj = db.ExecuteScalar(sql);

            if (obj == null || obj == DBNull.Value)
            {
                return(1);
            }

            return((int)obj + 1);
        }