//@@@@@@@@ TOWARY @@@@@@@@@\\ private void AddProductBtn_Click(object sender, EventArgs e) { using (var addform = new AddEditTowarForm(null)) { if (addform.ShowDialog() == DialogResult.Yes) { GridFiller.FillProductsGrid(ProductsGrid); } } }
private void EditProductBtn_Click(object sender, EventArgs e) { try { using (var addform = new AddEditTowarForm((Towary)ProductsGrid.CurrentRow.DataBoundItem)) { if (addform.ShowDialog() == DialogResult.Yes) { GridFiller.FillProductsGrid(ProductsGrid); } } } catch (NullReferenceException exception) { MessageBox.Show(exception.Message, "Błąd", MessageBoxButtons.OK); } }