Example #1
0
 public int DeleteWord(Word request)
 {
     using (var db = DbConnectionFactory.OpenDbConnection())
     {
         return db.DeleteFmt<Word>("chinese = {0}", request.chinese);
     }
 }
Example #2
0
 public int AddWord(Word request)
 {
     using (var db = DbConnectionFactory.OpenDbConnection())
     {
         db.CreateTableIfNotExists<Word>();
         return (int)(db.Insert(request));
     }
 }
Example #3
0
 public int Delete(WordByChinese request)
 {
     var word = new Word()
     {
         chinese = request.chinese,
     };
     return Repo.DeleteWord(word);
 }
Example #4
0
 public int Delete(WordInformation request)
 {
     var word = new Word()
     {
         chinese = request.chinese,
         english = request.english,
         passed = request.passed,
         lastTested = request.lastTested
     };
     return Repo.DeleteWord(word);
 }
Example #5
0
 public object Post(WordInformation submission)
 {
     var word = new Word()
     {
         chinese = submission.chinese,
         english = submission.english,
         passed = submission.passed,
         lastTested = submission.lastTested
     };
     var id = Repo.AddWord(word);
     return new { Id = id };
 }