private void button1_Click(object sender, EventArgs e) { HOADONDAL cmd = new HOADONDAL(); hoadon data = new hoadon(); data.mahd = txtma.Text; data.makh = cbmakh.Text; data.manv = cbmanv.Text; data.ngaylap = dtngay.Text; data.tongtien = txttt.Text; bool kt = cmd.hoadon_insert(data); if (kt == false) { MessageBox.Show("Loi"); } else { MessageBox.Show("Them thành công"); } Load_Data("select * from HOADON"); ComboHD(); }
private void button3_Click(object sender, EventArgs e) { HOADONDAL cmd = new HOADONDAL(); hoadon data = new hoadon(); data.mahd = txtma.Text; bool kt = cmd.hoadon_delete(data); if (kt == false) { MessageBox.Show("Loi"); } else { MessageBox.Show("Xoa thành công"); } Load_Data("select * from HOADON"); }