private void btnNew_Click(object sender, EventArgs e) { frmNewOrUpdateCustomer frm = new frmNewOrUpdateCustomer(); frm.FormClosed += (s, ev) => { frmCustomerList_Load(sender, e); this.WindowState = FormWindowState.Maximized; this.Show(); }; frm.ShowDialog(); }
private void btnEdit_Click(object sender, EventArgs e) { Customer customer = BLL.CustomerServices.GetCustomerById(Int32.Parse(dgvCustomers.CurrentRow.Cells["CustomerID"].Value.ToString())); frmNewOrUpdateCustomer frm = new frmNewOrUpdateCustomer(customer); frm.Text = "Editar cliente"; frm.FormClosed += (s, ev) => { frmCustomerList_Load(sender, e); this.WindowState = FormWindowState.Maximized; this.Show(); }; frm.ShowDialog(); }