Exemplo n.º 1
0
        private void tb_xoa_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn muốn xóa thông tin thuốc?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                ThuocDTO thDTO = new ThuocDTO();
                thDTO.MaThuoc1 = tb_mathuoc.Text;

                bool kq = bus.xoa(thDTO);
                if (kq == false)
                {
                    MessageBox.Show("Xóa thông tin thuốc thất bại.");
                }

                else
                {
                    MessageBox.Show("Xóa thông tin thuốc thành công");
                    dataGridView1.DataSource = bus.loadDuLieuThuoc();//load lại dữ liệu cho datagridview
                }
                KhoaButton();
            }
        }