public static BaseForm CreateForm(IDataTable table) { var frm = new AddTable(table); frm.Dock = DockStyle.Fill; return(WinFormHelper.CreateForm(frm, "添加表")); }
private void toolAddTable_Click(Object sender, EventArgs e) { //为了触发XCodeService的静态构造函数 var temp = ModelResolver.Current; if (temp == null) { return; } var current = ObjectContainer.Current.Resolve <IDataTable>(); Tables.Add(current); var id = Tables.Count; current.TableName = "NewTable" + id; current.Description = "新建表" + id; current.DbType = DatabaseType.SqlServer; current.Description = "默认说明"; AddTable.CreateForm(current).ShowDialog(); dgvTables.DataSource = null; dgvTables.DataSource = Tables; }
private void toolEidtTable_Click(object sender, EventArgs e) { DataGridViewRow row = dgvTables.Rows[dgvTables.CurrentCell.RowIndex]; if (row == null) { return; } AddTable.CreateForm((IDataTable)row.DataBoundItem).ShowDialog(); }
public static BaseForm CreateForm(IDataTable table) { AddTable frm = new AddTable(table ); frm.Dock = DockStyle.Fill; return WinFormHelper.CreateForm(frm , "添加表"); }