Exemple #1
0
        public static void Delete(int categoryId)
        {
            var sql = @"DELETE FROM SocketBoxCategories WHERE Id = " + categoryId;
            var db  = SocketBoxCategory.GetDatabase();

            db.ExecuteNonQuery(sql);
        }
Exemple #2
0
        public static int GetNewId()
        {
            var sql = @"SELECT MAX(Id) FROM SocketBoxCategories";
            var db  = SocketBoxCategory.GetDatabase();
            var obj = db.ExecuteScalar(sql);

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

            return((int)obj + 1);
        }