Ejemplo n.º 1
0
        public static SocketBoxSpecific GetPatternName(int patternId)
        {
            var sql = @"
            SELECT * 
            FROM SocketBoxSpecifics
            WHERE Id = " + patternId;

            var db    = SocketBoxSpecific.GetDatabase();
            var boxes = db.ExecuteQuery <SocketBoxSpecific>(sql);

            return(boxes[0]);
        }
Ejemplo n.º 2
0
        public static int GetNewId()
        {
            var sql = @"
            SELECT MAX(Id) FROM SocketBoxSpecifics";

            var db  = SocketBoxSpecific.GetDatabase();
            var obj = db.ExecuteScalar(sql);

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

            return((int)obj + 1);
        }