2018-12-03 19:14:35 -04:00
|
|
|
|
using System.Collections.Generic;
|
2018-12-10 23:40:38 -04:00
|
|
|
|
|
2018-12-03 19:14:35 -04:00
|
|
|
|
using BS.Shared.DataContracts;
|
2022-12-30 16:28:23 +01:00
|
|
|
|
using BS.Shared.Extensions;
|
2018-12-03 19:14:35 -04:00
|
|
|
|
|
|
|
|
|
|
namespace BeWoPlanerMobil.Util
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ServiceRecord2Validation
|
|
|
|
|
|
{
|
2018-12-10 23:40:38 -04:00
|
|
|
|
public ServiceRecordDC ServiceRecord { get; }
|
|
|
|
|
|
public List<ServiceRecordValidationResultDC> ValidationResults { get; }
|
2018-12-03 19:14:35 -04:00
|
|
|
|
public string HilfePlanZeitraum { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public ServiceRecord2Validation(ServiceRecordDC pServiceRecord, List<ServiceRecordValidationResultDC> pValidationResults, string pHilfePlanZeitraum)
|
|
|
|
|
|
{
|
|
|
|
|
|
ServiceRecord = pServiceRecord;
|
|
|
|
|
|
ValidationResults = pValidationResults;
|
|
|
|
|
|
HilfePlanZeitraum = pHilfePlanZeitraum;
|
|
|
|
|
|
}
|
2022-12-30 16:28:23 +01:00
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(obj is ServiceRecord2Validation serviceRecord2Validation)
|
|
|
|
|
|
{
|
|
|
|
|
|
var listEquals = false;
|
|
|
|
|
|
|
|
|
|
|
|
if(ValidationResults is null && serviceRecord2Validation.ValidationResults is null)
|
|
|
|
|
|
{
|
|
|
|
|
|
listEquals = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if(!(ValidationResults is null))
|
|
|
|
|
|
{
|
|
|
|
|
|
listEquals = ValidationResults.AreListEqual(serviceRecord2Validation.ValidationResults);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var sr2 = serviceRecord2Validation.ServiceRecord;
|
|
|
|
|
|
|
|
|
|
|
|
var srEqual = ServiceRecord.Employee.Equals(sr2.Employee) &&
|
|
|
|
|
|
ServiceRecord.CostBearer.Equals(sr2.CostBearer) &&
|
|
|
|
|
|
ServiceRecord.CostBearer2SupportConceptOid.Equals(sr2.CostBearer2SupportConceptOid) &&
|
|
|
|
|
|
ServiceRecord.SupportConcept.Equals(sr2.SupportConcept) &&
|
|
|
|
|
|
ServiceRecord.Customer.Equals(sr2.Customer) &&
|
|
|
|
|
|
ServiceRecord.DistanceInMeter.Equals(sr2.DistanceInMeter) &&
|
|
|
|
|
|
(ServiceRecord.Goals is null && sr2.Goals is null || (!(ServiceRecord.Goals is null) && ServiceRecord.Goals.AreListEqual(sr2.Goals))) &&
|
|
|
|
|
|
ServiceRecord.RoundedDuration.Equals(sr2.RoundedDuration) &&
|
|
|
|
|
|
ServiceRecord.Notice.Equals(sr2.Notice) &&
|
|
|
|
|
|
ServiceRecord.Notice2.Equals(sr2.Notice2) &&
|
|
|
|
|
|
ServiceRecord.Notice3.Equals(sr2.Notice3) &&
|
|
|
|
|
|
ServiceRecord.Notice4.Equals(sr2.Notice4) &&
|
|
|
|
|
|
ServiceRecord.Notice5.Equals(sr2.Notice5) &&
|
|
|
|
|
|
ServiceRecord.ServiceDescription.Equals(sr2.ServiceDescription) &&
|
|
|
|
|
|
ServiceRecord.ServiceRecordType.Equals(sr2.ServiceRecordType) &&
|
|
|
|
|
|
ServiceRecord.ServiceRecordFormat.Equals(sr2.ServiceRecordFormat) &&
|
|
|
|
|
|
(ServiceRecord.End?.Equals(sr2.End) ?? false) &&
|
|
|
|
|
|
(ServiceRecord.Start?.Equals(sr2.Start) ?? false);
|
|
|
|
|
|
|
|
|
|
|
|
return listEquals;// && srEqual && (HilfePlanZeitraum?.Equals(serviceRecord2Validation.HilfePlanZeitraum) ?? false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2018-12-03 19:14:35 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|