31 lines
598 B
C#
31 lines
598 B
C#
using EnVisage.Models.Entities;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace EnVisage
|
|
{
|
|
// SA. ENV-1085
|
|
public partial class Scenario: ITimestampEntity
|
|
{
|
|
public void SetUpdatedTimestamp()
|
|
{
|
|
this.LastUpdate = DateTime.UtcNow;
|
|
}
|
|
|
|
public void SetCreatedTimestamp()
|
|
{
|
|
this.DateCreated = DateTime.UtcNow;
|
|
this.LastUpdate = null;
|
|
}
|
|
|
|
public ulong? GetCurrentVersion()
|
|
{
|
|
if (this.EditTimestamp != null)
|
|
return BitConverter.ToUInt64(this.EditTimestamp.Reverse().ToArray(), 0);
|
|
else
|
|
return (ulong?)null;
|
|
}
|
|
}
|
|
} |