예제 #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
파일: frmMain.cs 프로젝트: vtrinhit/T02Rup
        private void button6_Click(object sender, EventArgs e)
        {
            FrmSuaNk frmSuaNk = new FrmSuaNk();

            frmSuaNk.ShowDialog();
        }