Skip to content

Commit

Permalink
数据库设计说明书基础模板
Browse files Browse the repository at this point in the history
  • Loading branch information
wugenshui committed Mar 30, 2018
1 parent 2aa2663 commit 14bb6a4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 95 deletions.
90 changes: 0 additions & 90 deletions 代码自动生成/_信息管理/_信息管理.cst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<%-- 访问数据库的组件 --%>
<%@ CodeTemplate Language="C#" Inherits="CodeSmith.BaseTemplates.SqlCodeTemplate" TargetLanguage="C#" Description="生成文件模板" %>
<%-- 访问数据库的组件 --%>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Import Namespace="SchemaExplorer" %>
<%@ Assembly Name="System.Data" %>
<%@ Import Namespace="System.Data" %>

<%@ Assembly Name="CodeSmith.BaseTemplates" %>
<%@ Import Namespace="CodeSmith.BaseTemplates" %>
<%@ Assembly Name="CodeSmith.CustomProperties" %>
<%@ Import Namespace="CodeSmith.CustomProperties" %>
<%-- 参数 --%>
<%@ CodeTemplate ResponseEncoding="UTF-8" Language="C#" TargetLanguage="c#" Src="" Debug="False" %>
<%@ Assembly Name="CodeSmith.BaseTemplates" %>
<%@ Property Name="数据表" Type="SchemaExplorer.TableSchemaCollection" Default="" Category="基本设置" %>
<table borderColor='black' border='1'>
<% foreach(TableSchema table in 数据表) { %>
<tr><th colspan="8">_____<%= table.Name %>_____</th></tr>
<tr><th colspan="8" style="font-size:20px;"><%= table.Name %></th></tr>
<% bool isFirst = true;
foreach(ColumnSchema col in table.Columns) { %>
<tr>
Expand All @@ -26,7 +30,11 @@
<% } }%>
</table>
<script runat="template">

public override string GetFileName()
{
return "数据库文档.xls";
}

public string GetDescription(ColumnSchema col){
string result = string.Empty;
result = col.Description.Replace("\r\n","").Replace("\n","").Replace(" = ","=").Replace("= ","=").Replace(" =","=");
Expand Down Expand Up @@ -86,5 +94,12 @@
}
}

</script>
// 文件输出路径
[FileDialog(FileDialogType.Save, Title="选择文件输出路径", Filter="Query Files (*.xls)|*.xls|All Files (*.*)|*.*", DefaultExtension=".xls")]
[Category("基本设置")]
public override string OutputFile
{
get {return Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)+"\\GMS数据库文档.xls";}
set {base.OutputFile = value;}
}
</script>

0 comments on commit 14bb6a4

Please sign in to comment.