Esempio n. 1
0
        private void btXoa_Click(object sender, EventArgs e)
        {
            string MaLSP;

            MaLSP = txtMaloai.Text;
            LoaiSanPhamDTO lsp = new LoaiSanPhamDTO(MaLSP);

            if (string.IsNullOrEmpty(txtMaloai.Text))
            {
                MessageBox.Show("Vui lòng nhập mã LSP cần xoá", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            int numOfRows = loaisanphamBUS.Delete(lsp);

            if (numOfRows == 0)
            {
                MessageBox.Show("Không tìm được để xoá", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                MessageBox.Show("Xóa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            GridLoaiSP.DataSource = loaisanphamBUS.GetLoaiSP();
        }