public static void update(P6004 course) { SQLiteDatabase db = DALHelper.getInstance().getWritableDatabase(); db.execSQL( "update " + TABLE_NAME + " set " + COLUMN_WEEKTIME + "=?," + COLUMN_DAYTIME + "=?," + COLUMN_COURSETIME1 + "=?," + COLUMN_COURSETIME2 + "=?," + COLUMN_STARTTIME + "=?," + COLUMN_ENDTIME + "=?," + COLUMN_NAME + "=?," + COLUMN_TEACHER + "=?," + COLUMN_SITE + "=?," + COLUMN_STATU + "=?," + COLUMN_SERVERID + "=? where " + COLUMN_ID + "=?", new Object[] { course.getWeektime(), course.getDaytime(), course.getCoursetime1(), course.getCoursetime2(), course.getStarttime(), course.getEndtime(), course.getName(), course.getTeacher(), course.getSite(), course.getStatu(), course.getServerid(), course.getId() }); db.close(); }
public static void save(P6004 course) { SQLiteDatabase db = DALHelper.getInstance().getWritableDatabase(); db.execSQL( "insert into " + TABLE_NAME + " (" + COLUMN_WEEKTIME + "," + COLUMN_DAYTIME + "," + COLUMN_COURSETIME1 + "," + COLUMN_COURSETIME2 + "," + COLUMN_STARTTIME + "," + COLUMN_ENDTIME + "," + COLUMN_NAME + "," + COLUMN_TEACHER + "," + COLUMN_SITE + "," + COLUMN_STATU + "," + COLUMN_SERVERID + ")" + " values (?,?,?,?,?,?,?,?,?,?,?)", new Object[] { course.getWeektime(), course.getDaytime(), course.getCoursetime1(), course.getCoursetime2(), course.getStarttime(), course.getEndtime(), course.getName(), course.getTeacher(), course.getSite(), course.getStatu(), course.getServerid() }); db.close(); }