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(); }
public AddProducts() { InitializeComponent(); FormBorderStyle = FormBorderStyle.FixedDialog; // Set the MaximizeBox to false to remove the maximize box. MaximizeBox = false; // Set the MinimizeBox to false to remove the minimize box. //MinimizeBox = false; // Set the start position of the form to the center of the screen. StartPosition = FormStartPosition.CenterScreen; try { SqlAddProduct = new SQLDataControl(); } catch (MySqlException) { MessageBox.Show("Database connection problem"); } foreach (string productType in SqlAddProduct.GetBuyProducts()) { cBProductName.Items.Add(productType).ToString(); } tBPrice.Enabled = false; }
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(); } } }