public ItemsInformationcs() { InitializeComponent(); FormBorderStyle = FormBorderStyle.FixedDialog; MaximizeBox = false; StartPosition = FormStartPosition.CenterScreen; try { SQLItemsControl = new SQLDataControl(); } catch (MySqlException) { MessageBox.Show("Database connection problem"); } foreach (string productitem in SQLItemsControl.GetBuyProducts()) { cbProducts.Items.Add(productitem).ToString(); } foreach (string productitem in SQLItemsControl.GetLoanProducts()) { cbLoanProducts.Items.Add(productitem).ToString(); } ItemTimer.Start(); }
private void cBLoanProduct_CheckedChanged(object sender, EventArgs e) { if (cBLoanProduct.Checked == true) { tBAmountProduct.Enabled = false; tBPrice.Enabled = true; cBProductName.Items.Clear(); foreach (string item in SqlAddProduct.GetLoanProducts()) { cBProductName.Items.Add(item); } } else { tBAmountProduct.Enabled = true; tBPrice.Enabled = false; cBProductName.Items.Clear(); foreach (string productType in SqlAddProduct.GetBuyProducts()) { cBProductName.Items.Add(productType).ToString(); } } }