public AddItemUI(Shop aShop) { InitializeComponent(); shop=aShop; aDatabase = new Database(); }
private void sellItemButton_Click(object sender, EventArgs e) { aDatabase = new Database(); string id = sellProductIdTextBox.Text; int quantity = Convert.ToInt16(sellQuantityTextBox.Text); aProduct = new Product(id, quantity); if (aDatabase.HasThisId(id)) { MessageBox.Show(aDatabase.SellProductInDatabase(id, quantity)); } else { MessageBox.Show("Product not fornd"); } sellItemdataGridView.DataSource = null; sellItemdataGridView.DataSource = aDatabase.fillDataTable("Product"); // table name }
public ShopUI() { InitializeComponent(); aDatabase = new Database(); }