private void buttonDiscontCreate_Click(object sender, EventArgs e) { FormDiscont form = new FormDiscont(); if (form.ShowDialog() == DialogResult.OK) { dB.setDiscont(form.discont); RefreshDiscont(); } }
private void buttonDiscontEdit_Click(object sender, EventArgs e) { int idDiscont = Convert.ToInt32(comboBoxDiscont.SelectedItem); int index = disconts.FindIndex(x => x.id == idDiscont); FormDiscont form = new FormDiscont(disconts[index]); if (form.ShowDialog() == DialogResult.OK) { dB.setDiscont(form.discont); RefreshDiscont(); } }