Ejemplo n.º 1
0
 private void f_Load_Sua()
 {
     try
     {
         if (m_id != "")
         {
             string atmp = m_id;
             m_id = "";
             foreach (DataRow r in m_v.f_get_v_nhomvp(atmp, "", "", "", "", "", "").Tables[0].Rows)
             {
                 m_id                = r["ma"].ToString();
                 txtMa.Text          = r["ma"].ToString();
                 txtStt.Text         = r["stt"].ToString();
                 txtMatat.Text       = r["matat"].ToString();
                 txtTen.Text         = r["ten"].ToString();
                 txtViettat.Text     = r["matat"].ToString();
                 chkReadonly.Checked = r["readonly"].ToString() == "1";
                 try
                 {
                     cbNhombhyt.SelectedValue = r["idnhombhyt"].ToString();
                 }
                 catch
                 {
                 }
                 txtStt.Focus();
                 break;
             }
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 2
0
 private void f_Load_Sua()
 {
     try
     {
         DataRowView arv = (DataRowView)(dataGridView1.CurrentRow.DataBoundItem);
         foreach (DataRow r in m_v.f_get_v_nhomvp(arv["id"].ToString(), "", "", "", "", "", "").Tables[0].Rows)
         {
             m_id                = r["ma"].ToString();
             txtID.Text          = r["ma"].ToString();
             txtSTT.Text         = r["stt"].ToString();
             txtMa.Text          = r["matat"].ToString();
             txtTen.Text         = r["ten"].ToString();
             txtViettat.Text     = r["viettat"].ToString();
             chkReadonly.Checked = r["readonly"].ToString() == "1";
             try
             {
                 cbNhombhyt.SelectedValue = r["idnhombhyt"].ToString();
             }
             catch
             {
             }
             break;
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 3
0
 private void f_Load_CB_Nhomvp()
 {
     try
     {
         DataSet ads = m_v.f_get_v_nhomvp("", "", "", "", "", "", "");
         if (ads.Tables[0].Select("ma=-1").Length <= 0)
         {
             DataRow r = ads.Tables[0].NewRow();
             r["ma"]  = -1;
             r["ten"] = "...";
             ads.Tables[0].Rows.InsertAt(r, ads.Tables[0].Rows.Count);
         }
         cbNhomvp.DisplayMember = "TEN";
         cbNhomvp.ValueMember   = "MA";
         cbNhomvp.DataSource    = ads.Tables[0];
         cbNhomvp.SelectedValue = m_id_nhomvp;
     }
     catch
     {
     }
 }