Example #1
0
    //Lấy danh sách Reading_Practice
    //Nếu muốn lấy hết thì truyền vô ID_Unit < 0 and Task < 0 and Type < 0
    public IEnumerable<READING_PRACTICE> LayReading_Practice(int ID_Unit, int Task, int Type)
    {
        AnhVan10DataContext db = new AnhVan10DataContext();
        string ChuoiLenh = "select * from READING_PRACTICE";
        bool Flag = false;
        if (ID_Unit >= 0)
        {
            ChuoiLenh += " where ID_Unit = " + ID_Unit;
            Flag = true;
        }

        if (Task >= 0)
        {
            if (Flag == false)
            {
                ChuoiLenh += " where Task = " + Task;
                Flag = true;
            }
            else
            {
                ChuoiLenh += " and Task = " + Task;
            }
        }

        if (Type >= 0)
        {
            if (Flag == false)
            {
                ChuoiLenh += " where Type = " + Type;
                Flag = true;
            }
            else
            {
                ChuoiLenh += " and Type = " + Type;
            }
        }

        return db.ExecuteQuery<READING_PRACTICE>(ChuoiLenh);
    }
Example #2
0
 public IEnumerable<SPEAKING> GetSpeakingUnit(int id_Unit)
 {
     AnhVan10DataContext db = new AnhVan10DataContext();
     string chuoilenh = "select * from SPEAKING where ID_Unit=" + id_Unit;
     return db.ExecuteQuery<SPEAKING>(chuoilenh);
 }
Example #3
0
 public IEnumerable<WRITING> GetWritings(int ID_Unit)
 {
     AnhVan10DataContext db = new AnhVan10DataContext();
     string chuoilenh = "select * from WRITING where ID_Unit=" + ID_Unit;
     return db.ExecuteQuery<WRITING>(chuoilenh);
 }
Example #4
0
 public IEnumerable<VOCABULARY> GetVocabulary()
 {
     AnhVan10DataContext db = new AnhVan10DataContext();
     string chuoilenh = "select * from VOCABULARY";
     return db.ExecuteQuery<VOCABULARY>(chuoilenh);
 }
Example #5
0
 //Lấyy đường dẫn file audio
 public IEnumerable<string> GetReading_Audio(int ID_Unit)
 {
     AnhVan10DataContext db = new AnhVan10DataContext();
     string ChuoiLenh = "select Audio from READING where ID_Unit = " + ID_Unit;
     return db.ExecuteQuery<string>(ChuoiLenh);
 }
Example #6
0
 public IEnumerable<READING> LayReading(int ID_Unit)
 {
     AnhVan10DataContext db = new AnhVan10DataContext();
     string ChuoiLenh = "select * from READING where ID_Unit = " + ID_Unit;
     return db.ExecuteQuery<READING>(ChuoiLenh);
 }