Last changed not updaetd properly?

0 views
Skip to first unread message

Richard Griffiths

unread,
Oct 6, 2009, 12:37:08 PM10/6/09
to CslaGenerator
Hi

using 3.5 templates I think I there may be a bug - are you able to
verify.

Following Rocky's PTracker project using the Apply button twice on a
form causes an error as the sp can't find the record to update the
second time round - as the last changed has not been updated
correctly.

The following line (from snippet below) does not bring back the latest
lastchanged value (after first update)....

cmd.Parameters.AddWithValue("@LastChanged", ReadProperty
(LastChangedProperty))

after it should have been updated by this line....

m_lastChanged = DirectCast(cmd.Parameters("@NewLastChanged").Value,
Byte())



Protected Overrides Sub DataPortal_Update()
Using ctx = ConnectionManager(Of SqlConnection).GetManager
(Database.ITASConnection, TRue)
Using cmd As New SqlCommand("usp_Client_Update", ctx.Connection)
If MyBase.IsDirty Then
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@LastChanged",
ReadProperty(LastChangedProperty))
DoInsertUpdate(cmd)
cmd.ExecuteNonQuery()
LoadProperty(LastChangedProperty, DirectCast
(cmd.Parameters("@NewLastChanged").Value, Byte()))
m_lastChanged = DirectCast(cmd.Parameters
("@NewLastChanged").Value, Byte())
End If
End Using
End Using
End Sub



It works if I change this.....

cmd.Parameters.AddWithValue("@LastChanged", ReadProperty
(LastChangedProperty))

to

cmd.Parameters.AddWithValue("@LastChanged", m_lastChanged ) or

I change this line....

m_lastChanged = DirectCast(cmd.Parameters("@NewLastChanged").Value,
Byte())

to....

LoadProperty(LastChangedProperty, DirectCast(cmd.Parameters
("@NewLastChanged").Value, Byte()))


Do you have any thoughts on this - can you verify if this is a bug?

Thanks

Richard



Andrés Villanueva

unread,
Oct 6, 2009, 12:43:59 PM10/6/09
to cslage...@googlegroups.com
That is probably a bug. The timestamp should honor the property types
you're using (i.e. managed, standard, managedbackingfield).
Thanks for reporting this!
--
Andrés
Reply all
Reply to author
Forward
0 new messages