Пример #1
0
        /// <summary>Gets uptakes for the specified crop and zone. Will throw if not found.</summary>
        /// <param name="crop">Name of the crop.</param>
        /// <param name="ZoneName">Name of the zone.</param>
        /// <returns>The uptakes.</returns>
        public ZoneWaterAndN UptakeZone(IUptake crop, string ZoneName)
        {
            foreach (CropUptakes U in Values)
            {
                if (U.Crop == crop)
                {
                    foreach (ZoneWaterAndN Z in U.Zones)
                    {
                        if (Z.Name == ZoneName)
                        {
                            return(Z);
                        }
                    }
                }
            }

            throw (new Exception("Cannot find uptake for" + (crop as IModel).Name + " " + ZoneName));
        }
Пример #2
0
        /// <summary>Gets uptakes for the specified crop and zone. Will throw if not found.</summary>
        /// <param name="crop">Name of the crop.</param>
        /// <param name="ZoneName">Name of the zone.</param>
        /// <returns>The uptakes.</returns>
        public ZoneWaterAndN UptakeZone(IUptake crop, string ZoneName)
        {
            foreach (CropUptakes U in Values)
                if (U.Crop == crop)
                    foreach (ZoneWaterAndN Z in U.Zones)
                        if (Z.Name == ZoneName)
                            return Z;

            throw (new Exception("Cannot find uptake for" + (crop as IModel).Name + " " + ZoneName));
        }