コード例 #1
0
 public void Validate()
 {
     if (!DocumentSession.Exists <Domain.Model.Speed>(Id))
     {
         throw new BusinessRuleValidationException("Speed to verify cannot be found. ");
     }
 }
コード例 #2
0
        public void Validate()
        {
            if (!DocumentSession.Exists <Domain.Model.Speed>(Id))
            {
                throw new BusinessRuleValidationException("Speed cannot be found. ");
            }

            if (!DocumentSession.Exists <Person>(PilotId))
            {
                throw new BusinessRuleValidationException("Pilot cannot be found. ");
            }

            if (!DocumentSession.Exists <Person>(WitnessId))
            {
                throw new BusinessRuleValidationException("Witness cannot be found. ");
            }

            if (!DocumentSession.Exists <Domain.Model.Site>(SiteId))
            {
                throw new BusinessRuleValidationException("Site cannot be found. ");
            }

            if (!DocumentSession.Exists <Domain.Model.Aircraft>(AircraftId))
            {
                throw new BusinessRuleValidationException("Airctaft cannot be found. ");
            }

            if (DocumentSession.Load <Domain.Model.Speed>(Id).IsVerified)
            {
                throw new BusinessRuleValidationException("Cannot edit a verified speed. ");
            }
        }
コード例 #3
0
ファイル: CreateSiteCommand.cs プロジェクト: petegee/DsSpeeds
 public void Validate()
 {
     if (!DocumentSession.Exists <Domain.Model.Country>(CountryId))
     {
         throw new BusinessRuleValidationException("Country does not exit. ");
     }
 }
コード例 #4
0
ファイル: EditSiteCommand.cs プロジェクト: petegee/DsSpeeds
        public void Validate()
        {
            if (!DocumentSession.Exists <Domain.Model.Site>(Id))
            {
                throw new BusinessRuleValidationException("Site to update cannot be found. ");
            }

            if (!DocumentSession.Exists <Domain.Model.Country>(Id))
            {
                throw new BusinessRuleValidationException("Country cannot be found. ");
            }
        }
コード例 #5
0
        public void Validate()
        {
            if (!DocumentSession.Exists <Domain.Model.Speed>(Id))
            {
                throw new BusinessRuleValidationException("Speed to delete cannot be found. ");
            }

            if (!DocumentSession.Exists <Person>(DeletedById))
            {
                throw new BusinessRuleValidationException("Deleting person cannot be found. ");
            }

            if (DocumentSession.Load <Domain.Model.Speed>(Id).IsVerified)
            {
                throw new BusinessRuleValidationException("Cannot delete a verified speed. ");
            }
        }
コード例 #6
0
        public void Validate()
        {
            if (!DocumentSession.Exists <Person>(PilotId))
            {
                throw new BusinessRuleValidationException("Pilot cannot be found. ");
            }

            if (!DocumentSession.Exists <Person>(WitnessId))
            {
                throw new BusinessRuleValidationException("Witness cannot be found. ");
            }

            if (!DocumentSession.Exists <Domain.Model.Site>(SiteId))
            {
                throw new BusinessRuleValidationException("Site cannot be found. ");
            }

            if (!DocumentSession.Exists <Domain.Model.Aircraft>(AircraftId))
            {
                throw new BusinessRuleValidationException("Aircraft cannot be found. ");
            }
        }