private void btnLuu_Click(object sender, EventArgs e) { if (frmManHinhChinh.luu == true) { DTO_HD.MaHD = txtMaHD.Text; DTO_HD.MaBan = frmManHinhChinh.MaBan_Luu; DTO_HD.MaKH = frmManHinhChinh.MaKH_Luu; DTO_HD.MaTK_NV = frmDangNhap.MaTK_NV_Luu; DTO_HD.MaDo_Uong = cboMaDo_Uong.SelectedValue.ToString(); DTO_HD.DonGia = nmDonGia.Value; DTO_HD.SoLuong = nmSoLuong.Value; DTO_HD.ThanhTien = nmDonGia.Value * nmSoLuong.Value; BUS_HD.Them(DTO_HD); MessageBox.Show("Thêm xong ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); gridView.DataSource = BUS_HD.DanhSachHoaDon(frmManHinhChinh.MaBan_Luu); this.Close(); } else { DTO_HD.MaHD = txtMaHD.Text; DTO_HD.MaBan = frmManHinhChinh.MaBan_Luu; DTO_HD.MaKH = frmManHinhChinh.MaKH_Luu; DTO_HD.MaTK_NV = frmDangNhap.MaTK_NV_Luu; DTO_HD.MaDo_Uong = cboMaDo_Uong.SelectedValue.ToString(); DTO_HD.DonGia = nmDonGia.Value; DTO_HD.SoLuong = nmSoLuong.Value; DTO_HD.ThanhTien = nmDonGia.Value * nmSoLuong.Value; BUS_HD.Sua(DTO_HD); MessageBox.Show("Sửa xong ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); gridView.DataSource = BUS_HD.DanhSachHoaDon(frmManHinhChinh.MaBan_Luu); this.Close(); } }