private void AddTable2Tree() { DataView dv = DataMarket.GetUserTable(); dv.Sort = "TableName"; List <TableExpandDT> list = new List <TableExpandDT>(); foreach (DataRowView drv in dv) { list.Add(new TableExpandDT(drv)); } TreeNode childNode = new TreeNode(); childNode.Text = "用户表(" + list.Count + ")"; childNode.Tag = ""; childNode.ImageIndex = 1; childNode.SelectedImageIndex = 1; TreeNode childNode2; foreach (TableExpandDT dt in list) { childNode2 = new TreeNode(); childNode2.Text = dt.TableName + "-" + dt.Script; childNode2.Tag = dt.Id.ToString(); childNode2.ImageIndex = 0; childNode2.SelectedImageIndex = 5; childNode.Nodes.Add(childNode2); } childNode.ExpandAll(); this.tvTable.Nodes.Add(childNode); }
public static List <ColumnDT> GetAllColumns() { DataView dv = DataMarket.GetUserTable(); List <ColumnDT> list = new List <ColumnDT>(); foreach (DataRowView drv in dv) { list.AddRange((new TableExpandDT(drv)).Columns); } return(list); }
public void PrintAll() { DataView dv = DataMarket.GetUserTable(); List <TemplateDT> list = new List <TemplateDT>(); foreach (DataRowView drv in dv) { list.Add(TemplateDT.CreateTemplateDT(drv)); } foreach (TemplateDT detail in list) { PrintCode(detail); } }
public static string GetSQLConfigText() { DataView dv = DataMarket.GetUserTable(); List <TableExpandDT> list = new List <TableExpandDT>(); foreach (DataRowView drv in dv) { list.Add(new TableExpandDT(drv)); } StringBuilder sb = new StringBuilder(); sb.Append("<?xml version=\"1.0\"?>" + "\r\n"); sb.Append("<SQL-List>" + "\r\n"); sb.Append(GetAllCode("SQLXML")); sb.Append("</SQL-List>" + "\r\n"); return(sb.ToString()); }
/// <summary> /// 导出所有的类。 /// </summary> public static string PrinterAllClass() { DataView dv = DataMarket.GetUserTable(); List <TemplateDT> list = new List <TemplateDT>(); foreach (DataRowView drv in dv) { list.Add(TemplateDT.CreateTemplateDT(drv)); //Template.PrinterClassForTable(drv); } foreach (TemplateDT detail in list) { //Template.PrinterClassForTable(detail); foreach (CodeObject obj in s_CodeObjects.Values) { obj.PrintCode(detail); } } return("../../Code/Tables"); }
private static string GetAllCode(string key) { DataView dv = DataMarket.GetUserTable(); List <TableExpandDT> list = new List <TableExpandDT>(); foreach (DataRowView drv in dv) { list.Add(new TableExpandDT(drv)); } StringBuilder sb = new StringBuilder(); CodeObject obj = s_CodeObjects[key]; if (obj == null) { return(""); } foreach (TableExpandDT detail in list) { sb.Append(obj.GetCode(detail.Id)); } return(sb.ToString()); }
public static DataTable GetPKTable() { DataView dv = DataMarket.GetUserTable(); List <TableExpandDT> list = new List <TableExpandDT>(); foreach (DataRowView drv in dv) { list.Add(new TableExpandDT(drv)); } DataTable dt = new DataTable(); DataTable dt2; foreach (TableExpandDT detail in list) { dt2 = detail.PKDataTable; if (dt2 != null) { dt.Merge(dt2); } } return(dt); }