You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.4 KiB
65 lines
1.4 KiB
<%@ CodeTemplate Language="C#" ClassName="Dto" TargetLanguage="C#" Debug="False" Description="" encoding="GB2312" %>
|
|
<%@ Property Name="databaseProjectName" Type="String" Default="SpSampleDb" Optional="True" Category="Context" Description="" %>
|
|
<%@ Property Name="nameSpace" Type="System.String" Default="Dto" Optional="True" Category="Context" Description="" %>
|
|
<%
|
|
DbEntity db = Template.GetDataBase(databaseProjectName);
|
|
foreach(Table tb in db.Tables)
|
|
{
|
|
OpenResponse(databaseProjectName+"\\Dto\\"+tb.ModuleName+"\\"+tb.PropertyName+"Dto.cs");
|
|
string pkParmList = "";
|
|
foreach(Field fd in tb.Fields)
|
|
{
|
|
if(fd.IsPK == true)
|
|
pkParmList += fd.DataType.DotNetType+" "+fd.MemberName+",";
|
|
}
|
|
pkParmList = pkParmList.Trim(',');
|
|
%>
|
|
using System;
|
|
|
|
|
|
|
|
/*******************************************************/
|
|
/*Project:
|
|
Module :
|
|
Description :
|
|
Date : <%=DateTime.Now.ToString()%>
|
|
Create : Lxc
|
|
Update :
|
|
TODO : */
|
|
/*******************************************************/
|
|
|
|
namespace <%=nameSpace%>
|
|
{
|
|
|
|
/// <summary>
|
|
/// <%=tb.CnName%>
|
|
/// </summary>
|
|
public class <%=tb.PropertyName%>Dto
|
|
{
|
|
#region <%=tb.PropertyName%>
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public <%=tb.PropertyName%>Dto()
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
<%--Field--%>
|
|
<%
|
|
foreach(Field fd in tb.Fields)
|
|
{
|
|
%>
|
|
|
|
public <%=fd.DataType.DotNetType%> <%=fd.MemberName%>{get;set;}
|
|
|
|
<%
|
|
}
|
|
%><%--Field End--%>
|
|
}
|
|
}
|
|
<%
|
|
CloseResponse();
|
|
}
|
|
%>
|
|
|