bug 2902 : Problem was that the default initialisation of a .Net DateTime value is outside the range of dates which SQL Server can represent. Modified to default DateTimes to the current date.

status 2902: resolved FIXED
This commit is contained in:
sb 2009-05-04 15:37:37 +00:00
parent 961e71e57a
commit 2d71a40f32

View file

@ -8,8 +8,8 @@
Transform ADL into C# entity classes
$Author: sb $
$Revision: 1.21 $
$Date: 2009-04-30 17:04:00 $
$Revision: 1.22 $
$Date: 2009-05-04 15:37:37 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
@ -70,7 +70,7 @@
// (c)2007 Cygnet Solutions Ltd
//
// Automatically generated from application description using
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.22 $', 10)"/>
//
// <xsl:value-of select="/adl:application/@revision"/>
//
@ -97,7 +97,7 @@
/// &lt;/summary&gt;
/// &lt;remarks&gt;
/// Automatically generated from description of group <xsl:value-of select="@name"/>
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>.
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.22 $', 10)"/>.
///
/// DO NOT EDIT THIS FILE!
/// &lt;/remarks&gt;
@ -123,7 +123,7 @@
// (c)2007 Cygnet Solutions Ltd
//
// Automatically generated from application description using
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.22 $', 10)"/>
//
// <xsl:value-of select="/adl:application/@revision"/>
//
@ -149,7 +149,7 @@
/// &lt;/summary&gt;
/// &lt;remarks&gt;
/// Automatically generated from description of entity <xsl:value-of select="@name"/>
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.21 $', 10)"/>.
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.22 $', 10)"/>.
/// Note that manually maintained parts of this class may be defined in
/// a separate file called <xsl:value-of select="@name"/>.manual.cs, q.v.
///
@ -486,7 +486,12 @@
</xsl:choose>
</xsl:variable>
<xsl:if test="string-length( $validationpattern) &gt; 0">
private Regex <xsl:value-of select="@name"/>Validator = new Regex( "<xsl:value-of select="$validationpattern"/>");
<xsl:variable name="double-escaped">
<xsl:call-template name="double-escape">
<xsl:with-param name="string" select="$validationpattern"/>
</xsl:call-template>
</xsl:variable>
private Regex <xsl:value-of select="@name"/>Validator = new Regex( "<xsl:value-of select="$double-escaped"/>");
</xsl:if>
<xsl:if test="$base-type = 'integer'">
@ -716,6 +721,30 @@
</xsl:if>
</xsl:template>
<!-- C# requires that backslash characters in regexps are escaped,
because backslash is the escape character in C#; JavaScript does not
require this. So to use the same regexp patterns in both C# and
JavaScript we need to double-escape them. This is a beautifully
LISPy solution -->
<xsl:template name="double-escape">
<xsl:param name="string"/>
<xsl:choose>
<xsl:when test="contains( $string, '\')">
<xsl:variable name="recurse">
<xsl:call-template name="double-escape">
<xsl:with-param name="string">
<xsl:value-of select="substring-after( $string, '\')"/>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat( substring-before($string, '\'), '\\', $recurse)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="initialise-messages">
<!-- each IV of type message needs to be initialised -->
<xsl:for-each select="adl:property[@type='message']">
@ -817,7 +846,7 @@
<xsl:when test="$base-type = 'integer'">0</xsl:when>
<xsl:when test="$csharp-type = 'Decimal'">0.0M</xsl:when>
<xsl:when test="$base-type = 'real'">0.0</xsl:when>
<xsl:when test="$base-type = 'date'">new DateTime()</xsl:when>
<xsl:when test="$base-type = 'date'">DateTime.Today</xsl:when>
<xsl:when test="$csharp-type = 'String'">
<xsl:choose>
<xsl:when test="@required='true'">