Example #1
0
        /// <summary>
        /// Determine the groups for the <paramref name="vehicleNumber"/> then increase
        /// the totals.
        /// </summary>
        /// <param name="vehicleNumber">current vehicle number</param>
        /// <param name="groups">group details</param>
        /// <param name="classTotals">class total array</param>
        private static void UpdateClassTotals(
            string vehicleNumber,
            List <GroupsType> groups,
            ReportCounterManager <YearCounter> classTotals,
            int month)
        {
            if (vehicleNumber == string.Empty)
            {
                return;
            }

            List <string> classIds =
                ClassReportFactory.GetClassAndFamilies(
                    groups,
                    vehicleNumber);

            if (classIds == null || classIds.Count == 0)
            {
                return;
            }

            foreach (string classId in classIds)
            {
                classTotals.AddOne(classId, month);
            }
        }
Example #2
0
        /// ---------- ---------- ---------- ---------- ---------- ----------
        /// <name>updateArraysBasedOnCls</name>
        /// <date>15/09/13</date>
        /// <summary>
        ///   If singleCls is set then use the currentJourney to update all
        ///    location arrays. If not set then update the cls array for the
        ///    current month.
        /// </summary>
        /// <param name="classId">class id</param>
        /// <param name="cls">cls name</param>
        /// <param name="currentJourneyDetails">current journey details</param>
        /// <param name="month">month to update</param>
        /// ---------- ---------- ---------- ---------- ---------- ----------
        private static void UpdateArraysBasedOnCls(
            string vehicleNumber,
            List <GroupsType> groups,
            ReportCounterManager <LocationCounter> locations,
            IJourneyDetailsType currentJourneyDetails,
            string cls)
        {
            if (vehicleNumber == string.Empty)
            {
                return;
            }

            List <string> classIds =
                ClassReportFactory.GetClassAndFamilies(
                    groups,
                    vehicleNumber);

            foreach (string classId in classIds)
            {
                if (classId == cls)
                {
                    locations.AddOne(
                        currentJourneyDetails.To,
                        currentJourneyDetails.From);
                }
            }
        }