public void Validate()
 {
     if (!DocumentSession.Exists <Domain.Model.Speed>(Id))
     {
         throw new BusinessRuleValidationException("Speed to verify cannot be found. ");
     }
 }
Exemple #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. ");
            }
        }
 public void Validate()
 {
     if (!DocumentSession.Exists <Domain.Model.Country>(CountryId))
     {
         throw new BusinessRuleValidationException("Country does not exit. ");
     }
 }
Exemple #4
0
        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. ");
            }
        }
Exemple #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. ");
            }
        }
        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. ");
            }
        }