Exemple #1
0
        //================================================================================
        private void validateVesselOwnedState(VesselInCompany vesselInCompany, IVesselInCompanyDomainService vesselDomainService)
        {
            VesselStates vesselState = vesselDomainService.GetVesselCurrentState(vesselInCompany.Id);

            if (this.isOpen.IsSatisfiedBy(this) && vesselState != VesselStates.Owned)
            {
                throw new BusinessRuleException("", "Vessel is not in Owned state.");
            }
        }
Exemple #2
0
        //================================================================================
        private void validateBeingSubmitRejectedIfIsInScrappedState(VesselInCompany vesselInCompany, IVesselInCompanyDomainService vesselDomainService)
        {
            VesselStates vesselState = vesselDomainService.GetVesselCurrentState(vesselInCompany.Id);

            if (vesselState == VesselStates.Scrapped)
                if (!this.isSubmitRejected.IsSatisfiedBy(this))
                {
                    throw new BusinessRuleException("", "The Scrap State is not rejected.");
                }
        }