Files
BeWoPlaner/Shared/DataContracts/ClientPartials/ServiceRecordHistoryDC.cs
2016-06-27 01:45:38 +02:00

74 lines
1.9 KiB
C#

using System;
namespace BS.Shared.DataContracts
{
public partial class ServiceRecordHistoryDC
{
public DateTime? StartDate
{
get
{
if (Start.HasValue && Start.Value.Second == 1)
return null;
else
{
return Start;
}
}
}
public DateTime? EndDate
{
get
{
if (Start.HasValue && Start.Value.Second == 1)
return null;
else
{
return End;
}
}
}
public string HistoryTypeString
{
get
{
switch (ChangeType)
{
case StatementType.Insert:
return "Neu angelegt";
case StatementType.Update:
return "Geändert";
case StatementType.Delete:
return "Gelöscht";
}
return null;
}
}
public override bool Equals(object obj)
{
if(obj is ServiceRecordHistoryDC)
{
var y = (ServiceRecordHistoryDC)obj;
if (ServiceRecordOid == null && y.ServiceRecordOid == null)
return GetHashCode() == y.GetHashCode();
if (ServiceRecordOid != null && y.ServiceRecordOid != null)
return ServiceRecordOid == y.ServiceRecordOid;
}
return false;
}
public override int GetHashCode()
{
return ServiceRecordOid.HasValue
? GetType().Name.GetHashCode() ^ ServiceRecordOid.GetHashCode()
: base.GetHashCode();
}
}
}