Updated Generated Code to Use IDs rather than Objects for internal Updates
This commit is contained in:
@@ -1166,7 +1166,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (IsNew)
|
||||
_LastChanged = Item.Add(cn, ref _ItemID, _MyPrevious, _MyContent, _DTS, _UserID);
|
||||
else
|
||||
_LastChanged = Item.Update(cn, ref _ItemID, _MyPrevious, _MyContent, _DTS, _UserID, ref _LastChanged);
|
||||
_LastChanged = Item.Update(cn, ref _ItemID, _PreviousID, _ContentID, _DTS, _UserID, ref _LastChanged);
|
||||
MarkOld();
|
||||
}
|
||||
if (_ItemAnnotations != null) _ItemAnnotations.Update(this);
|
||||
@@ -1187,7 +1187,7 @@ namespace VEPROMS.CSLA.Library
|
||||
MarkNew();
|
||||
}
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
public static byte[] Update(SqlConnection cn, ref int itemID, Item myPrevious, Content myContent, DateTime dts, string userID, ref byte[] lastChanged)
|
||||
public static byte[] Update(SqlConnection cn, ref int itemID, int? previousID, int contentID, DateTime dts, string userID, ref byte[] lastChanged)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.Update", 0);
|
||||
try
|
||||
@@ -1198,8 +1198,8 @@ namespace VEPROMS.CSLA.Library
|
||||
cm.CommandText = "updateItem";
|
||||
// Input All Fields - Except Calculated Columns
|
||||
cm.Parameters.AddWithValue("@ItemID", itemID);
|
||||
if (myPrevious != null) cm.Parameters.AddWithValue("@PreviousID", myPrevious.ItemID);
|
||||
cm.Parameters.AddWithValue("@ContentID", myContent.ContentID);
|
||||
cm.Parameters.AddWithValue("@PreviousID", previousID);
|
||||
cm.Parameters.AddWithValue("@ContentID", contentID);
|
||||
if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts);
|
||||
cm.Parameters.AddWithValue("@UserID", userID);
|
||||
cm.Parameters.AddWithValue("@LastChanged", lastChanged);
|
||||
|
Reference in New Issue
Block a user