Esempio n. 1
0
        public bool DeleteWordBook(WordBookUnit wordbookname)
        {
            if(IsContainWordBook(wordbookname))
            {
                using (var statement = connection_.Prepare(SQL_DELETE))
                {
                    statement.Bind(1, wordbookname.WordBookName);
                    statement.Step();

                }
                //delete all word in this wordbookname //to do
                return true;
            }
            else
            {
                return false;
            }
        }
Esempio n. 2
0
 public bool AddWordBook(WordBookUnit wordbookname)
 {
     if (!IsContainWordBook(wordbookname))
     {
         using (var statement = connection_.Prepare(SQL_INSERT))
         {
             statement.Bind(1, wordbookname.WordBookName);
             statement.Bind(2, wordbookname.WordCount);
             statement.Bind(3, wordbookname.DeletedFlag ? 1 : 0);
             statement.Bind(4, wordbookname.IsReadOnly ? 1 : 0);
             statement.Step();
         }
         //add a new blank wordbook
         return true;
     }
     else
     {
         return false;
     }
 }
Esempio n. 3
0
 public bool IsContainWordBook(WordBookUnit wordbookname)
 {
     using (var statement = connection_.Prepare(SQL_QUERY_BY_WORDBOOK_NAME))
     {
         statement.Bind(1, wordbookname.WordBookName);
         SQLiteResult result = statement.Step();
         return SQLiteResult.ROW == result;
     }
 }
Esempio n. 4
0
 public void ImportWordBook(WordBookUnit wordbookname)
 {
     //to do
 }