//@@@@@@@@@@@@@@@ CENY @@@@@@@@@@@@@@@@@\\ private void AddPriceBtn_Click(object sender, EventArgs e) { using (var addform = new AddEditCenyForm(null)) { if (addform.ShowDialog() == DialogResult.Yes) { GridFiller.FillPricesGrid(CenyGrid); } } }
private void EditPriceBtn_Click(object sender, EventArgs e) { try { var selectedPrice = GetSelectedPrice(); //Złapanie zaznaczonej ceny z DataGridView po ID using (var addform = new AddEditCenyForm(selectedPrice)) { if (addform.ShowDialog() == DialogResult.Yes) { GridFiller.FillPricesGrid(CenyGrid); } } } catch (NullReferenceException exception) { MessageBox.Show(exception.Message, "Błąd", MessageBoxButtons.OK); } }