示例#1
0
        private void btnAddTable_Click(object sender, EventArgs e)
        {
            TableEditForm tableEditForm = new TableEditForm();

            if (tableEditForm.ShowDialog() == DialogResult.OK)
            {
                dgvTable.DataSource = tableManager.GetAll();
                tableEditForm.Dispose();
            }
        }
示例#2
0
        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();
                }
            }
        }