Inheritance: System.Entity
        public CustomsOffices GetForTransportRoute(TransportRoute transportRoute)
        {
            if (transportRoute == null || transportRoute.StateOfExport == null || transportRoute.StateOfImport == null)
            {
                return CustomsOffices.TransitStatesNotSet;
            }

            var isStartPointEU = transportRoute.StateOfExport.Country.IsEuropeanUnionMember;
            var isEndPointEU = transportRoute.StateOfImport.Country.IsEuropeanUnionMember;
            var areAllTransitStatesEU = isStartPointEU && isEndPointEU;

            if (transportRoute.TransitStates != null)
            {
                areAllTransitStatesEU = transportRoute.TransitStates.All(ts => ts.Country.IsEuropeanUnionMember);
            }

            if (isEndPointEU)
            {
                return areAllTransitStatesEU ? CustomsOffices.None : CustomsOffices.EntryAndExit;
            }
            return CustomsOffices.Exit;
        }
Example #2
0
 public CustomsOffices GetForTransportRoute(TransportRoute transportRoute)
 {
     return(CustomsOffices.EntryAndExit);
 }
 public AllTransitStatesInEUEvent(TransportRoute transportRoute)
 {
     TransportRoute = transportRoute;
 }
Example #4
0
 public AllTransitStatesInEUEvent(TransportRoute transportRoute)
 {
     TransportRoute = transportRoute;
 }