Beispiel #1
0
        /// <summary>
        /// Checks if the drug contains a route.
        /// </summary>
        /// <param name="route">The route to check.</param>
        /// <returns>Whether the drug contains the route.</returns>
        public bool ContainsRoute(ElementValue route)
        {
            if (!string.IsNullOrEmpty(route.Value) && this.Routes != null)
            {
                string routeValue = route.Value.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0].Trim();
                foreach (ElementValue validRoute in this.Routes)
                {
                    if (!string.IsNullOrEmpty(validRoute.Value))
                    {
                        string validRouteValue = validRoute.Value.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0].Trim();
                        if (routeValue == validRouteValue)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// Checks if the drug contains a route.
        /// </summary>
        /// <param name="route">The route to check.</param>
        /// <returns>Whether the drug contains the route.</returns>
        public bool ContainsRoute(ElementValue route)
        {
            if (!string.IsNullOrEmpty(route.Value) && this.Routes != null)
            {
                string routeValue = route.Value.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0].Trim();
                foreach (ElementValue validRoute in this.Routes)
                {
                    if (!string.IsNullOrEmpty(validRoute.Value))
                    {
                        string validRouteValue = validRoute.Value.Split("-".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0].Trim();
                        if (routeValue == validRouteValue)
                        {
                            return true;
                        }
                    }
                }
            }

            return false;
        }