private void btnluu_Click(object sender, EventArgs e) { bool flag; if (rdbnam.Checked == true) { flag = true; } else { flag = false; } using (_db = new QLSQADataContext()) { db_KhachHang user = new db_KhachHang { TenKH = txttenkh.Text, DiaChiKH = txtdiachi.Text, sdtKH = txtsdt.Text, EmailKH = txtemail.Text, GioiTInh = flag, NgaySinh = dateTimePicker1.Value }; _db.db_KhachHangs.InsertOnSubmit(user); _db.SubmitChanges(); loadata(); }; MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK); enableNutLenh(false); cleardata(); }
partial void Deletedb_KhachHang(db_KhachHang instance);
partial void Updatedb_KhachHang(db_KhachHang instance);
partial void Insertdb_KhachHang(db_KhachHang instance);