private void btnLuu_Click(object sender, EventArgs e) { clearList(); ENTITY.NguoiDung nd = new ENTITY.NguoiDung(); nd.MaNV = txtMaNV.Text.Trim(); nd.MatKhau = txtMatKhau.Text.Trim(); nd.Them = ckbThem.Checked ? true : false; nd.Sua = ckbSua.Checked ? true : false; nd.Xoa = ckbXoa.Checked ? true : false; nd.Ad = ckbAd.Checked ? true : false; if (kt == true) { DAL.NguoiDung_Controller user = new DAL.NguoiDung_Controller(); user.insertNGUOIDUNG(nd); showList(); } else { DAL.NguoiDung_Controller user = new DAL.NguoiDung_Controller(); user.updateNGUOIDUNG(nd); showList(); } lockControl(); reset(); }
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.NguoiDung nd = new ENTITY.NguoiDung(); nd.TaiKhoan = txtTaiKhoan.Text; DAL.NguoiDung_Model user = new DAL.NguoiDung_Model(); user.deleteNguoiDung(nd); showLsvNguoiDung(); } lockControlNguoiDung(); clearControl(); }
private void btnXoa_Click(object sender, EventArgs e) { ENTITY.NguoiDung nd = new ENTITY.NguoiDung(); nd.MaNV = txtMaNV.Text.Trim(); 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) { clearList(); DAL.NguoiDung_Controller user = new DAL.NguoiDung_Controller(); user.deleteNGUOIDUNG(nd); showList(); } lockControl(); reset(); }
private void btnLuu_Click(object sender, EventArgs e) { ENTITY.NguoiDung nd = new ENTITY.NguoiDung(); nd.TaiKhoan = txtTaiKhoan.Text; nd.MatKhau = txtMatKhau.Text; nd.ID_QuyenHan = cmbID_QuyenHan.Text; if (kt == true) { DAL.NguoiDung_Model user = new DAL.NguoiDung_Model(); user.insertNguoiDung(nd); showLsvNguoiDung(); } else { DAL.NguoiDung_Model user = new DAL.NguoiDung_Model(); user.editNguoiDung(nd); showLsvNguoiDung(); } lockControlNguoiDung(); clearControl(); }