@@ -0,0 +1,1919 @@
+package com.example.yochi.shiftcal;%0A%0Aimport android.content.ContentValues;%0Aimport android.content.Context;%0Aimport android.database.sqlite.SQLiteDatabase;%0Aimport android.database.sqlite.SQLiteOpenHelper;%0A%0Aclass ShiftDao %7B%0A%0A    private SQLiteDatabase mydb = null;%0A%0A    public MySQLiteOpenHelper(Context c) %7B%0A    %7D%0A%0A    public ArrayList%3CShiftDao%3E getMonthlyShift(Timestamp from, Timestamp to)%7B%0A        String format = %22select date, shift from cal where date bitween %25s and %25s%22;%0A        String sql = String.format(format, top, bottom);%0A        Cursor c = openDb().rawQuery(sql);%0A        f(c.moveToFirst())%7B%0A          do%7B%0A            long date = c.getLong(c.getColumnIndex(%22date%22));%0A            long shift = c.getLong(c.getColumnIndex(%22shift%22));%0A          %7Dwhile(c.moveToNext());%0A        %7D%0A%0A    %7D%0A%0A    private SQLiteDatabase openDb()%7B%0A        if(mydb == null)%7B%0A            MySQLiteOpenHelper hlpr = new MySQLiteOpenHelper(mContext);%0A            mydb = hlpr.getWritableDatabase();%0A        %7D%0A        return mydb;%0A    %7D%0A%0A    public void onCreate(SQLiteDatabase db) %7B%0A        db.execSQL(CREATE_TABLE_CAL);%0A        db.execSQL(CREATE_TABLE_SHIFT);%0A%0A        // shift%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E5%88%9D%E6%9C%9F%E3%83%87%E3%83%BC%E3%82%BF%E6%8A%95%E5%85%A5%0A        ContentValues values = new ContentValues();%0A        values.put(%22shift%22, 1);%0A        values.put(%22title%22, %22%E6%97%A9%E7%95%AA%22);%0A        values.put(%22color%22, %22#ff0000ff%22);%0A        values.put(%22order%22, 1);%0A        db.insert(%22shift%22, null, values);%0A        values.put(%22shift%22, 2);%0A        values.put(%22title%22, %22%E6%97%A5%E5%8B%A4%22);%0A        values.put(%22color%22, %22#ff00ff00%22);%0A        values.put(%22order%22, 2);%0A        db.insert(%22shift%22, null, values);%0A        values.put(%22shift%22, 3);%0A        values.put(%22title%22, %22%E9%81%85%E7%95%AA%22);%0A        values.put(%22color%22, %22#ffff0000%22);%0A        values.put(%22order%22, 3);%0A        db.insert(%22shift%22, null, values);%0A    %7D%0A%0A    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) %7B%0A        //db.execSQL(DROP_TABLE);%0A        //onCreate(db);%0A    %7D%0A%7D%0A

add Dao