Пример #1
0
 private void f_Load_CB_Cha()
 {
     try
     {
         DataSet ads = m_v.f_get_v_treebaocao("", "", "", "", "", "", "");
         if (ads.Tables[0].Select("id=0").Length <= 0)
         {
             DataRow r = ads.Tables[0].NewRow();
             r["id"]     = 0;
             r["id_cha"] = 0;
             r["ten"]    =
                 lan.Change_language_MessageText("(Gốc)");
             ads.Tables[0].Rows.InsertAt(r, 0);
         }
         if (m_id != "" && m_id != "0")
         {
             try
             {
                 DataRow r = ads.Tables[0].Select("id=" + m_id)[0];
                 ads.Tables[0].Rows.Remove(r);
             }
             catch
             {
             }
         }
         cbCha.DisplayMember = "TEN";
         cbCha.ValueMember   = "ID";
         cbCha.DataSource    = ads.Tables[0];
         cbCha.SelectedValue = m_id_cha;
     }
     catch
     {
     }
 }