using System; using System.Collections.Generic; using System.Windows.Forms; using WorkData; using WorkData.Entity; namespace DQ.Construction.NewLook.DataManager { public partial class frmCreateColumn : Form { string tableName = string.Empty; public frmCreateColumn(List tableInfos, string tableName) { InitializeComponent(); this.tableName = tableName; this.gridControl1.DataSource = tableInfos; } private void button1_Click(object sender, EventArgs e) { int[] rows = this.gridView1.GetSelectedRows(); foreach (int row in rows) { var info = this.gridView1.GetRow(row) as TableInfo; TableInfo tableInfo = new TableInfo() { TableName = this.tableName, ColumnType = "文本", ChineseName = info.ColumnName, ColumnWidth = "100", ColumnName = info.ColumnName, IsMust = "否", OrderBy = 999, ShowDigit = string.Empty, ShowLength = "999", Show = "是", }; DBHelp.NewDb.Insertable(tableInfo).ExecuteCommand(); } this.Close(); } } }