private void productComboBox_SelectedIndexChanged(object sender, EventArgs e) { string productName = productComboBox.Text; int countProducts = _salesManager.CountProduct(productName); if (countProducts > 0) { aQuantityTextBox.Text = countProducts.ToString(); } else { aQuantityTextBox.Text = 0.ToString(); } sale.ProductId = Convert.ToInt32(productComboBox.SelectedValue.ToString()); //DataTable dataTble = _salesManager.ProductUnitPrice(sale.ProductId); //foreach (DataRow dr in dataTble.Rows) //{ // unitPrice = Convert.ToDouble(dr["UnitPrice"].ToString()); //} }