Пример #1
0
        public bool IsOverwrittenBy(ITimedType newObject)
        {
            var newParentalAutority = newObject as ParentalAuthorityType;

            return(this.RelationshipType == newParentalAutority.RelationshipType &&
                   this.RelationPNR == newParentalAutority.RelationPNR);
        }
Пример #2
0
        public bool IsOverwrittenBy(ITimedType newObject)
        {
            var newDisempowerment = newObject as DisempowermentType;

            if (newDisempowerment != null)
            {
                return(this.GuardianRelationType == newDisempowerment.GuardianRelationType &&
                       this.DisempowermentStartDate == newDisempowerment.DisempowermentStartDate);
            }
            return(false);
        }
Пример #3
0
        public bool IsOverwrittenBy(ITimedType newObject)
        {
            var newCivilStatus = newObject as CurrentCivilStatusType;

            if (newCivilStatus != null)
            {
                return
                    (this.CivilStatusCode == MaritalStatus.Deceased ||
                     newCivilStatus.CivilStatusCode == MaritalStatus.Unmarried);
            }
            return(false);
        }
Пример #4
0
        public static bool IsOverwritten(ITimedType deleteCandidate, IEnumerable <ITimedType> dataOtherObjects)
        {
            if (deleteCandidate is IOverwritable)
            {
                var deleteCandidateO = deleteCandidate as IOverwritable;

                return(dataOtherObjects
                       .Except(new ITimedType[] { deleteCandidate })
                       .Where(o =>
                              o.Tag == deleteCandidate.Tag &&
                              o.Registration != null &&
                              deleteCandidate.Registration != null &&
                              o.Registration.RegistrationDate > deleteCandidate.Registration.RegistrationDate &&
                              deleteCandidateO.IsOverwrittenBy(o)
                              )
                       .FirstOrDefault() != null);
            }
            return(false);
        }