/// <summary> /// Update a Module in the database /// </summary> /// <param name="module">The updated Module</param> private void updateModule(Module module) { string sql; sql = "UPDATE Module"; sql += "Module_Name='" + module.getName() + "', "; sql += "Practical=" + module.getPractical() + ","; sql += "HoursPerWeek=" + module.getHoursPerWeek() + ", "; sql += "RoomType='" + module.getRommType() + "', "; sql += "MaxConsecHours=" + module.getMaxConsecHours() + ", "; sql += "DoubleSlots=" + module.getDoubleSlots() + ", "; sql += "WHERE ID LIKE " + module.getID(); excuteNonQuery(sql); }
/// <summary> /// Insert a new Module into the database /// </summary> /// <param name="module">The new Module</param> private void insertModule(Module module) { string sql; sql = "INSERT INTO Module (Module_Name, Practical, HoursPerWeek, RoomType, MaxConsecHours, DoubleSlots, Deleted) VALUES("; sql = "'" + module.getName() + "', "; sql = module.getPractical() + ","; sql = module.getHoursPerWeek() + ", "; sql = "'" + module.getRommType() + "',"; sql = module.getMaxConsecHours() + ", "; sql = module.getDoubleSlots() + ", false)"; excuteNonQuery(sql); }