%@ 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%>
{
///
/// <%=tb.CnName%>
///
public class <%=tb.PropertyName%>Dto
{
#region <%=tb.PropertyName%>
///
///
///
public <%=tb.PropertyName%>Dto()
{
}
#endregion
<%--Field--%>
<%
foreach(Field fd in tb.Fields)
{
%>
public <%=fd.DataType.DotNetType%> <%=fd.MemberName%>{get;set;}
<%
}
%><%--Field End--%>
}
}
<%
CloseResponse();
}
%>