34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using Dlhis.ScheduledTask.Entities;
|
|
using Dlhis.ScheduledTask.Extensions;
|
|
|
|
namespace Dlhis.ScheduledTask.Comparers
|
|
{
|
|
internal class ZHRS_ORGComparer : IEqualityComparer<ZHRS_ORG>
|
|
{
|
|
public bool Equals(ZHRS_ORG x, ZHRS_ORG y)
|
|
{
|
|
if (ReferenceEquals(x, y)) return true;
|
|
if (ReferenceEquals(x, null) || ReferenceEquals(y, null)) return false;
|
|
if (x.GetType() != y.GetType()) return false;
|
|
|
|
return x.BEGDA == y.BEGDA
|
|
&& x.ENDDA == y.ENDDA
|
|
&& x.LANGU == y.LANGU
|
|
&& x.OBJID == y.OBJID
|
|
&& x.STEXT == y.STEXT
|
|
&& x.SOBID == y.SOBID
|
|
&& x.ORGID01 == y.ORGID01
|
|
&& x.ORGID02 == y.ORGID02;
|
|
}
|
|
|
|
public int GetHashCode(ZHRS_ORG obj)
|
|
{
|
|
return obj.BEGDA.SafeGetHashCode() ^ obj.ENDDA.SafeGetHashCode()
|
|
^ obj.LANGU.SafeGetHashCode() ^ obj.OBJID.SafeGetHashCode()
|
|
^ obj.STEXT.SafeGetHashCode() ^ obj.SOBID.SafeGetHashCode()
|
|
^ obj.ORGID01.SafeGetHashCode() ^ obj.ORGID02.SafeGetHashCode();
|
|
}
|
|
}
|
|
|
|
}
|