示例#1
0
        public static BaseForm CreateForm(IDataTable table)
        {
            var frm = new AddTable(table);

            frm.Dock = DockStyle.Fill;
            return(WinFormHelper.CreateForm(frm, "添加表"));
        }
示例#2
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;
        }
示例#3
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();
        }
示例#4
0
 public static BaseForm CreateForm(IDataTable table)
 {
     AddTable frm = new AddTable(table );
     frm.Dock = DockStyle.Fill;            
     return WinFormHelper.CreateForm(frm , "添加表");
 }