Files
TaskHybrid/Template.Shared/Core/Dto/ActivityDTO.cs

97 lines
5.7 KiB
C#

using Template.Shared.Core.Entity;
using Template.Shared.Core.Helpers.Enum;
namespace Template.Shared.Core.Dto;
public class ActivityDTO : StbActivity
{
public string? Commessa { get; set; }
public string? Cliente { get; set; }
public ActivityCategoryEnum Category { get; set; }
public bool Complete { get; set; }
private sealed class ActivityDtoEqualityComparer : IEqualityComparer<ActivityDTO>
{
public bool Equals(ActivityDTO? x, ActivityDTO? y)
{
if (ReferenceEquals(x, y)) return true;
if (x is null) return false;
if (y is null) return false;
if (x.GetType() != y.GetType()) return false;
return x.ActivityId == y.ActivityId && x.ActivityResultId == y.ActivityResultId && x.ActivityTypeId == y.ActivityTypeId && x.DataInsAct.Equals(y.DataInsAct) && x.ActivityDescription == y.ActivityDescription && x.ParentActivityId == y.ParentActivityId && x.TipoAnag == y.TipoAnag && x.CodAnag == y.CodAnag && x.CodJcom == y.CodJcom && x.CodJfas == y.CodJfas && Nullable.Equals(x.EstimatedDate, y.EstimatedDate) && Nullable.Equals(x.EstimatedTime, y.EstimatedTime) && Nullable.Equals(x.AlarmDate, y.AlarmDate) && Nullable.Equals(x.AlarmTime, y.AlarmTime) && Nullable.Equals(x.EffectiveDate, y.EffectiveDate) && Nullable.Equals(x.EffectiveTime, y.EffectiveTime) && x.ResultDescription == y.ResultDescription && Nullable.Equals(x.EstimatedEnddate, y.EstimatedEnddate) && Nullable.Equals(x.EstimatedEndtime, y.EstimatedEndtime) && Nullable.Equals(x.EffectiveEnddate, y.EffectiveEnddate) && Nullable.Equals(x.EffectiveEndtime, y.EffectiveEndtime) && x.UserCreator == y.UserCreator && x.UserName == y.UserName && Nullable.Equals(x.PercComp, y.PercComp) && Nullable.Equals(x.EstimatedHours, y.EstimatedHours) && x.CodMart == y.CodMart && x.PartitaMag == y.PartitaMag && x.Matricola == y.Matricola && x.Priorita == y.Priorita && Nullable.Equals(x.ActivityPlayCounter, y.ActivityPlayCounter) && x.ActivityEvent == y.ActivityEvent && x.Guarantee == y.Guarantee && x.Note == y.Note && x.Rfid == y.Rfid && x.IdLotto == y.IdLotto && x.PersonaRif == y.PersonaRif && x.HrNum == y.HrNum && x.Gestione == y.Gestione && Nullable.Equals(x.DataOrd, y.DataOrd) && x.NumOrd == y.NumOrd && x.IdStep == y.IdStep && x.IdRiga == y.IdRiga && Nullable.Equals(x.OraInsAct, y.OraInsAct) && x.IndiceGradimento == y.IndiceGradimento && x.NoteGradimento == y.NoteGradimento && x.FlagRisolto == y.FlagRisolto && x.FlagTipologia == y.FlagTipologia && x.OreRapportino == y.OreRapportino && x.UserModifier == y.UserModifier && Nullable.Equals(x.OraModAct, y.OraModAct) && Nullable.Equals(x.OraViewAct, y.OraViewAct) && x.CodVdes == y.CodVdes && x.CodCmac == y.CodCmac && x.WrikeId == y.WrikeId && x.CodMgrp == y.CodMgrp && x.PlanId == y.PlanId && x.Commessa == y.Commessa && x.Cliente == y.Cliente && x.Category == y.Category && x.Complete == y.Complete;
}
public int GetHashCode(ActivityDTO obj)
{
var hashCode = new HashCode();
hashCode.Add(obj.ActivityId);
hashCode.Add(obj.ActivityResultId);
hashCode.Add(obj.ActivityTypeId);
hashCode.Add(obj.DataInsAct);
hashCode.Add(obj.ActivityDescription);
hashCode.Add(obj.ParentActivityId);
hashCode.Add(obj.TipoAnag);
hashCode.Add(obj.CodAnag);
hashCode.Add(obj.CodJcom);
hashCode.Add(obj.CodJfas);
hashCode.Add(obj.EstimatedDate);
hashCode.Add(obj.EstimatedTime);
hashCode.Add(obj.AlarmDate);
hashCode.Add(obj.AlarmTime);
hashCode.Add(obj.EffectiveDate);
hashCode.Add(obj.EffectiveTime);
hashCode.Add(obj.ResultDescription);
hashCode.Add(obj.EstimatedEnddate);
hashCode.Add(obj.EstimatedEndtime);
hashCode.Add(obj.EffectiveEnddate);
hashCode.Add(obj.EffectiveEndtime);
hashCode.Add(obj.UserCreator);
hashCode.Add(obj.UserName);
hashCode.Add(obj.PercComp);
hashCode.Add(obj.EstimatedHours);
hashCode.Add(obj.CodMart);
hashCode.Add(obj.PartitaMag);
hashCode.Add(obj.Matricola);
hashCode.Add(obj.Priorita);
hashCode.Add(obj.ActivityPlayCounter);
hashCode.Add(obj.ActivityEvent);
hashCode.Add(obj.Guarantee);
hashCode.Add(obj.Note);
hashCode.Add(obj.Rfid);
hashCode.Add(obj.IdLotto);
hashCode.Add(obj.PersonaRif);
hashCode.Add(obj.HrNum);
hashCode.Add(obj.Gestione);
hashCode.Add(obj.DataOrd);
hashCode.Add(obj.NumOrd);
hashCode.Add(obj.IdStep);
hashCode.Add(obj.IdRiga);
hashCode.Add(obj.OraInsAct);
hashCode.Add(obj.IndiceGradimento);
hashCode.Add(obj.NoteGradimento);
hashCode.Add(obj.FlagRisolto);
hashCode.Add(obj.FlagTipologia);
hashCode.Add(obj.OreRapportino);
hashCode.Add(obj.UserModifier);
hashCode.Add(obj.OraModAct);
hashCode.Add(obj.OraViewAct);
hashCode.Add(obj.CodVdes);
hashCode.Add(obj.CodCmac);
hashCode.Add(obj.WrikeId);
hashCode.Add(obj.CodMgrp);
hashCode.Add(obj.PlanId);
hashCode.Add(obj.Commessa);
hashCode.Add(obj.Cliente);
hashCode.Add((int)obj.Category);
hashCode.Add(obj.Complete);
return hashCode.ToHashCode();
}
}
public static IEqualityComparer<ActivityDTO> ActivityDtoComparer { get; } = new ActivityDtoEqualityComparer();
public ActivityDTO Clone()
{
return (ActivityDTO)MemberwiseClone();
}
}