private void btnXoa_Click(object sender, EventArgs e) { DialogResult check = MessageBox.Show("Bạn có muốn xóa không", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (check == DialogResult.Yes) { ENTITY.PhieuDanhGia p = new ENTITY.PhieuDanhGia(); p.ID_PhieuDanhGia = txtID_PhieuDanhGia.Text.Trim(); DAL.PhieuDanhGia_Model pdg = new DAL.PhieuDanhGia_Model(); pdg.deletePhieuDanhGia(p); } showLsvPhieuDanhGia(); lockControl(); clearControl(); }
private void btnLuu_Click(object sender, EventArgs e) { ENTITY.PhieuDanhGia p = new ENTITY.PhieuDanhGia(); p.ID_PhieuDanhGia = txtID_PhieuDanhGia.Text.Trim(); p.ID_PhieuKhaoSat = cmbID_PhieuKhaoSat.Text.Trim(); p.MaBaoHiem = txtMaBH.Text.Trim(); p.TinhTrangXe = txtTinhTrangXe.Text.Trim(); p.BaoGia = txtBaoGia.Text.Trim(); DAL.PhieuDanhGia_Model pdg = new DAL.PhieuDanhGia_Model(); if (kt == true) { pdg.insertPhieuDanhGia(p); } else { pdg.editPhieuDanhGia(p); } showLsvPhieuDanhGia(); lockControl(); clearControl(); }