Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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();
        }