public static int createDiscipline(
            string name,
            Measure measure,
            Category category
        )
        {
            executeSql(""
                + "INSERT INTO `" + tableName + "` "
                + "("
                    + "`" + field_name + "`, "
                    + "`" + field_measureId + "`, "
                    + "`" + field_categoryId + "`"
                + ") VALUES ("
                    + "'" + name + "', "
                    + (measure == null ? "NULL" : measure.MeasureId.ToString()) + ", "
                    + category.CategoryId
                + ")"
            );

            Dictionary<string, object> result = querySingleSql("SELECT MAX(`" + field_disciplineId + "`) AS `insertionId` FROM `" + tableName + "`");

            int insertionId = Convert.ToInt32(result["insertionId"]);

            return insertionId;
        }
 public static void deleteCategory(Category category)
 {
     executeSql(""
         + "DELETE FROM "
             + "`" + tableName + "` "
         + "WHERE "
             + "`" + field_categoryId + " = " + category.CategoryId + " "
         + "LIMIT 1"
     );
 }
 public Discipline(
     int disciplineId,
     string name,
     Measure measure,
     Category category
 )
 {
     this.disciplineId = disciplineId;
     this.name = name;
     this.measure = measure;
     this.category = category;
 }
 public Discipline(
     int disciplineId,
     string name,
     Measure measure,
     Category category,
     List<DisciplineSetDisciplineMapping> disciplineSetDisciplineMappings,
     List<Variant> variants
 )
 {
     this.disciplineId = disciplineId;
     this.name = name;
     this.measure = measure;
     this.category = category;
     this.disciplineSetDisciplineMappings = disciplineSetDisciplineMappings;
     this.variants = variants;
 }
 public static void updateCategory(Category category)
 {
     executeSql(""
         + "UPDATE "
             + "`" + tableName + "` "
         + "SET "
             + "`" + field_categoryName + "` = " + category.CategoryName + " "
         + "WHERE "
             + "`" + field_categoryId + " = " + category.CategoryId
     );
 }
        public static Category getCategoryById(int categoryId)
        {
            Dictionary<string, object> result = querySingleSql(""
                + "SELECT "
                    + "`" + field_categoryId + "`, "
                    + "`" + field_categoryName + "` "
                + "FROM "
                    + "`" + tableName + "` "
                + "WHERE "
                    + "`" + field_categoryId + "` = " + categoryId
            );

            if (result == null)
            {
                return null;
            }

            Category category = new Category(
                Convert.ToInt32(result[field_categoryId]),
                Convert.ToString(result[field_categoryName])
            );

            return category;
        }