private void AddButton_Click(object sender, EventArgs e) { var form = new ProductForm(); DialogResult result = form.ShowDialog(this); if (result == DialogResult.OK) { ProductDBService.addProduct(form.getProduct()); } updateList(); }
private void SearchButton_Click(object sender, EventArgs e) { ProductList.DataSource = null; ProductList.DataSource = ProductDBService.findProducts(nameBox.Text, typeBox.Text, priceBox.Text).Tables[0].DefaultView; }
public void updateProduct() { ProductList.DataSource = null; ProductList.DataSource = ProductDBService.getProducts().Tables[0].DefaultView; }
private void RemoveButton_Click(object sender, EventArgs e) { ProductDBService.removeProduct(DBService.getSelectedProduct(Product)); updateList(); }
public ProductListForm() { InitializeComponent(); Product.DataSource = ProductDBService.getProducts().Tables[0].DefaultView; }