Ejemplo n.º 1
0
 public static void SearchByMeaning(ListViewEx lvw, String m_TenHocSinh)
 {
     DictionaryData data = new DictionaryData();
        DataTable table = data.SearchByMeaning(m_TenHocSinh);
        lvw.Items.Clear();
        foreach (DataRow row in table.Rows)
        {
        ListViewItem item = new ListViewItem(row["ID"].ToString());
        item.SubItems.Add(row["Word"].ToString());
        item.SubItems.Add(row["Meaning"].ToString());
        lvw.Items.Add(item);
        }
 }
Ejemplo n.º 2
0
 public static void SearchByWord(ListView lvw, String m_Word)
 {
     DictionaryData data = new DictionaryData();
        DataTable table= data.SearchByWord(m_Word);
        lvw.Items.Clear();
        foreach (DataRow row in table.Rows)
        {
        ListViewItem item = new ListViewItem(row["ID"].ToString());
        item.SubItems.Add(row["Word"].ToString());
        item.SubItems.Add(row["Meanings"].ToString());
        item.SubItems.Add(row["Phonetic"].ToString());
        lvw.Items.Add(item);
        }
 }
Ejemplo n.º 3
0
 public static String SearchByWordExtractMatch(ListView lvw, String m_Word)
 {
     String meaning = "";
        DictionaryData data = new DictionaryData();
        DataTable table = data.SearchByWordExtractMatch(m_Word);
        lvw.Items.Clear();
        if(table.Rows.Count ==1)
        {
        foreach (DataRow row in table.Rows)
        {
            ListViewItem item = new ListViewItem(row["ID"].ToString());
            item.SubItems.Add(row["Word"].ToString());
            item.SubItems.Add(row["Meanings"].ToString());
            item.SubItems.Add(row["Phonetic"].ToString());
            lvw.Items.Add(item);
            meaning = row["Meanings"].ToString().Trim();
            meaning = meaning.Replace("\\n", "\n");
        }
        }
        return meaning;
 }