Permalink
Browse files

Data objects implementing ICreationHistory - CreationTime and Created…

…By are only set at insert time if undefined, fix #640
  • Loading branch information...
mawtex committed Dec 7, 2018
1 parent 38935d9 commit b78aeaaa75e0ed3e448115121a4f63e75688a2f5
Showing with 6 additions and 3 deletions.
  1. +6 −3 Composite/Data/DataFacadeImpl.cs
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -720,11 +720,14 @@ private static void SetCreationHistoryInformation(object sender, DataEventArgs d
ICreationHistory data = dataEventArgs.Data as ICreationHistory;
if (data != null)
{
data.CreationDate = DateTime.Now;
if (data.CreationDate == DateTime.MinValue)
{
data.CreationDate = DateTime.Now;
}

try
{
if (UserValidationFacade.IsLoggedIn())
if (string.IsNullOrEmpty(data.CreatedBy) && UserValidationFacade.IsLoggedIn())
{
data.CreatedBy = UserValidationFacade.GetUsername();
}

0 comments on commit b78aeaa

Please sign in to comment.