private void btnSearch_Click(object sender, EventArgs e) { string id = txtProductID.Text; DataProcess dt = new DataProcess(); Product p = dt.SearchProduct(id); if (p == null) { MessageBox.Show("Product not found"); btnAddToBill.Enabled = false; btnMakeBill.Enabled = false; } else { txtNameP.Text = p.Name; txtPriceP.Text = p.POut.ToString(); btnAddToBill.Enabled = true; btnMakeBill.Enabled = true; } }