User Tools

Site Tools


globalstatementblocks.htm
Navigation:  T4 Template Language Reference > Directives >GlobalStatementBlocks Previous pageReturn to chapter overviewNext page

GlobalStatementBlocks

<;#* #>

Example:

<;#* public partial class Global

{

public static string ToNETType(SoftVelocity.DataDictionary.Design.IColumn column)

{

string returnValue;

switch (column.DataType)

{

case SoftVelocity.DataDictionary.Design.FieldType.DATE_TIME:

returnValue = “DateTime”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.BYTE:

returnValue = “byte”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.SHORT:

returnValue = “Int16”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.USHORT:

returnValue = “UInt16”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.DATE:

returnValue = “DateTime”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.TIME:

returnValue = “DateTime”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.LONG:

returnValue = “Int32”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.ULONG:

returnValue = “UInt32”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.SREAL:

returnValue = “System.Single”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.REAL:

returnValue = “double”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.DECIMAL:

returnValue = “decimal”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.PDECIMAL:

returnValue = “decimal”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.SBYTE:

returnValue = “sbyte”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.BFLOAT4:

returnValue = “System.Single”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.BFLOAT8:

returnValue = “double”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.SIGNED:

returnValue = “int”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.UNSIGNED:

returnValue = “uint”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.STRING:

returnValue = “string”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.CSTRING:

returnValue = “string”;

break;

case SoftVelocity.DataDictionary.Design.FieldType.PSTRING:

returnValue = “string”;

break;

default:

returnValue = string.Format(“Unmatched type error {0}”, column.DataType.ToString());

break;

}

return returnValue;

}

}

#>

globalstatementblocks.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1