private void btnAddTable_Click(object sender, EventArgs e) { TableEditForm tableEditForm = new TableEditForm(); if (tableEditForm.ShowDialog() == DialogResult.OK) { dgvTable.DataSource = tableManager.GetAll(); tableEditForm.Dispose(); } }
private void btnEditTable_Click(object sender, EventArgs e) { int id = (int)dgvTable.CurrentRow.Cells["TableId"].Value; Table table = tableManager.GetByTableId(id); //if update success if (table != null) { TableEditForm tableEditForm = new TableEditForm(table); if (tableEditForm.ShowDialog() == DialogResult.OK) { dgvTable.DataSource = tableManager.GetAll(); tableEditForm.Dispose(); } } }