예제 #1
0
        protected internal override bool StandardsTest(ILegalConcept a, ILegalConcept b)
        {
            var uccContract = Contract as UccContract <Goods>;

            if (uccContract != null && uccContract.IsInstallmentContract)
            {
                AddReasonEntry("the perfect tender rule does not apply to UCC installment contracts-(see UCC 2-612)");
                return(a.EquivalentTo(b) || b.EquivalentTo(a));
            }

            return(a.Equals(b) || b.Equals(a));
        }
예제 #2
0
 protected internal override bool StandardsTest(ILegalConcept a, ILegalConcept b)
 {
     return(a.EquivalentTo(b) || b.EquivalentTo(a));
 }
예제 #3
0
        public override bool IsValid(params ILegalPerson[] persons)
        {
            if (!base.IsValid(persons))
            {
                return(false);
            }

            var cotenants = this.Cotenants(persons).ToList();

            if (!cotenants.Any())
            {
                return(false);
            }

            DateTime?     creationDate = null;
            ILegalConcept instrument   = null;
            var           portion      = 0D;

            for (var i = 0; i < cotenants.Count; i++)
            {
                var cotenant = cotenants[i];
                var title    = cotenant.GetLegalPersonTypeName();
                if (i == 0)
                {
                    creationDate = InterestCreationDate(cotenants[i]);
                    instrument   = InterestCreationInstrument(cotenants[i]);
                    portion      = InterestFraction(cotenants[i]);
                    continue;
                }

                if (portion == 0D)
                {
                    AddReasonEntry($"{title} {cotenant.Name} {nameof(InterestFraction)} is null");
                    return(false);
                }
                if (instrument == null)
                {
                    AddReasonEntry($"{title} {cotenant.Name} {nameof(InterestCreationInstrument)} is null");
                    return(false);
                }
                if (creationDate == null)
                {
                    AddReasonEntry($"{title} {cotenant.Name} {nameof(InterestCreationDate)} is null");
                    return(false);
                }

                var nextCreationDate = InterestCreationDate(cotenant);
                if (!creationDate.Equals(nextCreationDate))
                {
                    AddReasonEntry($"{title} {cotenant.Name} {nameof(InterestCreationDate)}, {creationDate} does not equal {nextCreationDate}");
                    return(false);
                }

                var nextInstrument = InterestCreationInstrument(cotenant);
                if (!instrument.Equals(nextInstrument))
                {
                    AddReasonEntry($"{title} {cotenant.Name} {nameof(InterestCreationInstrument)}, {instrument} does not equal {nextInstrument}");
                    return(false);
                }

                var nextPortion = InterestFraction(cotenant);
                if (Math.Abs(portion - nextPortion) > 0.01)
                {
                    AddReasonEntry($"{title} {cotenant.Name} {nameof(InterestFraction)}, {portion} does not equal {nextPortion}");
                    return(false);
                }
            }

            return(true);
        }
예제 #4
0
 protected internal abstract bool StandardsTest(ILegalConcept a, ILegalConcept b);
예제 #5
0
        protected internal virtual bool TryGetCauseOfAction(ILegalPerson legalPerson, out ILegalConcept causeOfAction, bool addReason = true)
        {
            causeOfAction = null;

            if (legalPerson == null)
            {
                return(false);
            }

            causeOfAction = GetAssertion(legalPerson);

            var title = legalPerson.GetLegalPersonTypeName();

            if (causeOfAction == null && addReason)
            {
                AddReasonEntry($"{title} {legalPerson.Name}, {nameof(GetAssertion)} returned nothing");
                return(false);
            }

            return(true);
        }