コード例 #1
0
 private void taoTK(TAIKHOAN _tk)
 {
     using (var db1 = new TroGiupViecLamEntities())
     {
         db1.TAIKHOANs.Add(_tk);
         db1.SaveChanges();
     }
 }
コード例 #2
0
        private void btnDangKi_Click(object sender, EventArgs e)
        {
            bool a = false;

            using (var db1 = new TroGiupViecLamEntities())
            {
                if (ktTrung(txtTenTK.Text) == true)
                {
                    TAIKHOAN tk = new TAIKHOAN();
                    tk.tenTK  = txtTenTK.Text;
                    tk.passTK = txtMatKhau.Text;
                    taoTK(tk);
                    MessageBox.Show("Đăng kí thành công.");
                    txtTenTK.Clear();
                    txtMatKhau.Clear();
                }
            }
        }