Updated Generated Code to Use IDs rather than Objects for internal Updates

This commit is contained in:
Rich
2010-12-13 15:47:02 +00:00
parent c8d47d9c64
commit db051f8ff8
50 changed files with 112 additions and 112 deletions

View File

@@ -783,12 +783,12 @@ namespace VEPROMS.CSLA.Library
if (IsNew)
_LastChanged = Part.Add(cn, _MyContent, _FromType, _MyItem, _DTS, _UserID);
else
_LastChanged = Part.Update(cn, _MyContent, _FromType, _MyItem, _DTS, _UserID, ref _LastChanged);
_LastChanged = Part.Update(cn, _ContentID, _FromType, _ItemID, _DTS, _UserID, ref _LastChanged);
MarkOld();
}
}
[Transactional(TransactionalTypes.TransactionScope)]
public static byte[] Update(SqlConnection cn, Content myContent, int fromType, Item myItem, DateTime dts, string userID, ref byte[] lastChanged)
public static byte[] Update(SqlConnection cn, int contentID, int fromType, int itemID, DateTime dts, string userID, ref byte[] lastChanged)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.Update", 0);
try
@@ -798,9 +798,9 @@ namespace VEPROMS.CSLA.Library
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "updatePart";
// Input All Fields - Except Calculated Columns
cm.Parameters.AddWithValue("@ContentID", myContent.ContentID);
cm.Parameters.AddWithValue("@ContentID", contentID);
cm.Parameters.AddWithValue("@FromType", fromType);
cm.Parameters.AddWithValue("@ItemID", myItem.ItemID);
cm.Parameters.AddWithValue("@ItemID", itemID);
if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts);
cm.Parameters.AddWithValue("@UserID", userID);
cm.Parameters.AddWithValue("@LastChanged", lastChanged);