Пример #1
0
 private void button6_Click(object sender, EventArgs e)
 {
     if (MaNhanKhau == null)
     {
         MessageBox.Show("Mời chọn nhân khẩu trước");
     }
     else
     {
         FrmSuaNk frmSuaNk = new FrmSuaNk();
         frmSuaNk.ShowDialog();
         string maNhanKhau = LstNhanKhau.SelectedValue.ToString();
         var    q          = from s in _danhSachNhanKhau
                             where s.MaNhanKhau.Equals(LstNhanKhau.SelectedValue)
                             select s;
         _danhSachNhanKhau.Remove(q.First());
         var q2 = from s in DungChung.Db.NhanKhaus
                  where s.MaNhanKhau.Equals(maNhanKhau)
                  select s;
         _danhSachNhanKhau.Add(q2.First());
         LstNhanKhau.DataSource    = null;
         LstNhanKhau.DataSource    = _danhSachNhanKhau;
         LstNhanKhau.DisplayMember = "TenNhanKhau";
         LstNhanKhau.ValueMember   = "MaNhanKhau";
     }
 }
Пример #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            FrmSuaNk frmSuaNk = new FrmSuaNk();

            frmSuaNk.ShowDialog();
        }