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.LenhSuaChua l = new ENTITY.LenhSuaChua(); l.ID_LenhSuaChua = txtID_LenhSuaChua.Text.Trim(); DAL.LenhSuaChua_Model lcs = new DAL.LenhSuaChua_Model(); lcs.deleteLenhSuaChua(l); } showLsvLenhSuaChua(); lockControl(); clearControl(); }
private void btnLuu_Click(object sender, EventArgs e) { ENTITY.LenhSuaChua l = new ENTITY.LenhSuaChua(); l.ID_LenhSuaChua = txtID_LenhSuaChua.Text.Trim(); l.ID_PhieuDanhGia = txtID_PhieuDanhGia.Text.Trim(); l.ID_PhieuVatTu = txtID_PhieuVatTu.Text.Trim(); DAL.LenhSuaChua_Model lsc = new DAL.LenhSuaChua_Model(); if (kt == true) { lsc.insertLenhSuaChua(l); } else { lsc.editLenhSuaChua(l); } showLsvLenhSuaChua(); clearControl(); lockControl(); }