private void btnAdauga_Click(object sender, EventArgs e) { HalaForm frm = null; try { frm = new HalaForm("Adauga hala", 0, "", false); frm.ShowDialog(); frm.FormClosed += new Form.FormClosedEventHandler(HalaForm_FormClosing); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnModifica_Click(object sender, EventArgs e) { HalaForm frm = null; try { if (halaCurenta == null) { btnAdauga_Click(sender, e); } else { frm = new HalaForm("Editeaza hala " + halaCurenta.Denumire, halaCurenta.Id, halaCurenta.Denumire, halaCurenta.Anulat); frm.ShowDialog(); frm.FormClosed += new Form.FormClosedEventHandler(HalaForm_FormClosing); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }