private void categoryComboBox_Click(object sender, EventArgs e) { // populate category comboBox string fetchCategory = @"SELECT * FROM categories"; _common.FillComboBox(fetchCategory, connection, categoryComboBox); }
private void StockOutForm_Load(object sender, EventArgs e) { // populate category comboBox string fetchCategories = @"SELECT * FROM categories"; _common.FillComboBox(fetchCategories, connection, categoryComboBox); // populate company comboBox string fetchCompanies = @"SELECT * FROM companies"; _common.FillComboBox(fetchCompanies, connection, companyComboBox); }
private void companyComboBox_Click(object sender, EventArgs e) { try { // populate company comboBox string fetchCompany = @"select distinct companies.id, companies.name from companies Inner Join items on companies.id=items.CompanyId"; _common.FillComboBox(fetchCompany, connection, companyComboBox); } catch (Exception exception) { connection.Close(); MessageBox.Show(exception.Message); } }
private void categoryComboBox_SelectedIndexChanged(object sender, EventArgs e) { try { int value = Convert.ToInt32(categoryComboBox.SelectedValue); // populate item comboBox string fetchItems = @"SELECT * FROM items where categoryid=" + value + ""; connection.Close(); _common.FillComboBox(fetchItems, connection, itemComboBox); } catch (Exception exception) { itemComboBox.ResetText(); reorderLevelTextBox.ResetText(); avialableQuantityTextBox.ResetText(); MessageBox.Show("No items in this category."); } }