Private Field Sufix
Last Post 18 Dec 2009 05:18 PM by luisxvarg. 2 Replies.
Printer Friendly
Sort:
NextNext
You are not authorized to post a reply.
Author Messages
luisxvarg
New Member
New Member
Posts:3

--
16 Dec 2009 01:29 PM  
Hi Phil
Can I modify @PrivateField value?
this variable works with suffix (by default is _) + databasefield so generate a private field like this:
If I choose a custom suffix = 'Property' so @PrivateField value generated will be:
PropertyId

I need to change suffix like prefix so my fix privateField works like:
prefix
IdProperty
In this way it works like code snippets.
What is the template to modify?
Thanks
eurowise
Basic Member
Basic Member
Posts:215

--
17 Dec 2009 07:21 AM  
Hi
The template to change is BLBusinessBaseDesigner.XSL. Here is the section you can change. If I am correct, you just need to replace <xsl:value-of select="@PrivateField"/> by <xsl:value-of select="@PrivateField"/>Property:

#region "Private Variables"
<xsl:for-each select="Mappings/Mapping">
<xsl:choose>
<xsl:when test="@DataType='System.Byte[]'">
private static byte[] <xsl:value-of select="@PrivateField"/> = null;
</xsl:when>
<xsl:when test="@DataType='System.DateTime'">
private static PropertyInfo<SmartDate> <xsl:value-of select="@PrivateField"/> = RegisterProperty<SmartDate>(typeof(<xsl:value-of select="$BLClassName"/>), new PropertyInfo<SmartDate>("<xsl:value-of select="@PropertyName"/>"<xsl:text>)</xsl:text><xsl:text>);</xsl:text>
</xsl:when>
<xsl:otherwise>
private static PropertyInfo<<xsl:value-of select="@DataType"/>> <xsl:value-of select="@PrivateField"/> = RegisterProperty<<xsl:value-of select="@DataType"/>>(typeof(<xsl:value-of select="$BLClassName"/>), new PropertyInfo<<xsl:value-of select="@DataType"/>>("<xsl:value-of select="@PropertyName"/>"<xsl:text>)</xsl:text><xsl:text>)</xsl:text>;
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
#endregion

Regards

Philip
luisxvarg
New Member
New Member
Posts:3

--
18 Dec 2009 05:18 PM  
Thanks Phil, but i am searching a global solution that works in all templates. Your suggest work fine for BusinessBase template, but I need for all templates.
In the first screen of project wizzard you give us an option to define suffix by default is the char '_'
so I need to redefine this field to assign 'Property' value, so the template generate _Id by PropertyID, _LastChanged by PropertyLastChanged.
My fix template should generate IdProperty, LastChanged (noticed that LastChanged don´t have a preffix).
I would like to know the template of the first screen is referencing, so I could modify: @PrivateField = suffix + 'readField from datasource'> by @PrivateField = 'readField from datasource' + suffix but i don´t have idea if your templates works in this way.
So, Do I need modify all templates with <xsl:value-of select="@PrivateField"/>Property? or is there any easier way to do this task?
You are not authorized to post a reply.

Active Forums 4.1
NOT LICENSED FOR PRODUCTION USE
www.activemodules.com
Connexion / Register