コード例 #1
0
ファイル: kanjidb.cs プロジェクト: ChickenKFC/LearningKanji
        /* Get list kanji of specification lession */
        public List <KanjiObj> GetListKanji(int lessionID)
        {
            List <KanjiObj> lstKanji = new List <KanjiObj>();

            /* Create database connection */
            kanjidbDataContext dbConnection = new kanjidbDataContext("");

            return(lstKanji);
        }
コード例 #2
0
        public List <KanjiObj> GetListKanjiByLessionID(int lessionID)
        {
            List <KanjiObj>    lstResult    = new List <KanjiObj>();
            kanjidbDataContext dbConnection = new kanjidbDataContext();
            var lstKanji = from kanji in dbConnection.KANJI_TBLs where kanji.LESSION_ID == lessionID.ToString() select kanji;

            foreach (var eRecord in lstKanji)
            {
                lstResult.Add(new KanjiObj((int)eRecord.ID, (string)eRecord.VOCABULARY, (string)eRecord.HIRAGANA,
                                           (string)eRecord.CHINESE, (string)eRecord.VIETNAMESE, (string)eRecord.LESSION_ID, (int)eRecord.STT));
            }
            return(lstResult);
        }
コード例 #3
0
        public Dictionary <int, string> GetLessionName()
        {
            Dictionary <int, string> lessionManager = new Dictionary <int, string>();
            kanjidbDataContext       dbConnection   = new kanjidbDataContext();

            // Query database
            var strResult = from kanji in dbConnection.LESSION_TBLs select kanji;

            foreach (var lession in strResult)
            {
                lessionManager.Add((int)lession.LESSION_ID, lession.LESSION_NAME.ToString());
            }

            return(lessionManager);
        }
コード例 #4
0
        public List <KanjiObj> GetListKanji()
        {
            List <KanjiObj>    lstKanji     = new List <KanjiObj>();
            kanjidbDataContext dbConnection = new kanjidbDataContext();
            var result = from kanji in dbConnection.KANJI_TBLs select kanji;

            foreach (var kj in result)
            {
                KanjiObj eKanji = new KanjiObj((int)kj.ID, (string)kj.VOCABULARY, (string)kj.HIRAGANA,
                                               (string)kj.CHINESE, (string)kj.VIETNAMESE, (string)kj.LESSION_ID, (int)kj.STT);
                lstKanji.Add(eKanji);
            }

            return(lstKanji);
        }