1234567891011121314151617181920212223242526272829303132 |
- <#@ template language="c#" HostSpecific="True" #>
- <#@ output extension= ".cs" #>
- <#
- TableHost host = (TableHost)(Host);
- host.Fieldlist.Sort(CodeCommon.CompareByintOrder);
- #>
- <# if( host.TableDescription.Length > 0) {#>
- //<#= host.TableDescription #>
- <# } #>
- public class <#= host.GetModelClass(host.TableName) #>
- {
-
- <# foreach (ColumnInfo c in host.Fieldlist)
- { #>
- /// <summary>
- /// <#= string.IsNullOrEmpty(c.Description) ? c.ColumnName : c.Description #>
- /// </summary>
- <# if (CodeCommon.DbTypeToCS(c.TypeName) == "string") {#>
- public <#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName #>{ get;set;} = "";
- <#} else if (CodeCommon.DbTypeToCS(c.TypeName) == "int" || CodeCommon.DbTypeToCS(c.TypeName) == "long" ) {#>
- public <#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName #>{ get;set;} = 0;
- <#} else if (CodeCommon.DbTypeToCS(c.TypeName) == "float" || CodeCommon.DbTypeToCS(c.TypeName) == "double" ) {#>
- public <#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName #>{ get;set;} = 0.0;
- <#} else if (CodeCommon.DbTypeToCS(c.TypeName) == "DateTime" ) {#>
- public <#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName #>{ get;set;}
- <#} else {#>
- public <#= CodeCommon.DbTypeToCS(c.TypeName) #> <#= c.ColumnName #>{ get;set;}
- <# } #>
- <# } #>
-
- }
|