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 deleteMeasure(Measure measure) { executeSql("" + "DELETE FROM " + "`" + tableName + "` " + "WHERE " + "`" + field_measureId + " = " + measure.MeasureId + " " + "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 updateMeasure(Measure measure) { executeSql("" + "UPDATE " + "`" + tableName + "` " + "SET " + "`" + field_name + "` = " + measure.Name + ". " + "`" + field_shortcut + "` = " + measure.Shortcut + " " + "WHERE " + "`" + field_measureId + " = " + measure.MeasureId ); }
public static Measure getMeasureById(int measureId) { Dictionary<string, object> result = querySingleSql("" + "SELECT " + "* " + "FROM " + "`" + tableName + "` " + "WHERE " + "`" + field_measureId + "` = " + measureId ); if (result == null) { return null; } Measure measure = new Measure( Convert.ToInt32(result[field_measureId]), Convert.ToString(result[field_name]), Convert.ToString(result[field_shortcut]) ); return measure; }