Exemple #1
0
        public static DateRangePattern GetDateRangePattern(SelectionTimeSpan timeSpanRange)
        {
            switch (timeSpanRange)
            {
            case SelectionTimeSpan.Today:
                return(DateRangePattern.D0);

            case SelectionTimeSpan.Yesterday:
                return(DateRangePattern.Dm1);

            case SelectionTimeSpan.ThisWeek:
                return(DateRangePattern.W0);

            case SelectionTimeSpan.LastWeek:
                return(DateRangePattern.Wm1);

            case SelectionTimeSpan.ThisMonth:
                return(DateRangePattern.M0);

            case SelectionTimeSpan.LastMonth:
                return(DateRangePattern.Mm1);

            case SelectionTimeSpan.ThisYear:
                return(DateRangePattern.Y0);

            default:
                return(DateRangePattern.D0);    // default to today
            }
        }
Exemple #2
0
        public ICollection <WebFleetStandStill> GetStandStills(SelectionTimeSpan dateRange, string objectNumber = "")
        {
            var result     = new List <WebFleetStandStill>();
            var webService = new tripAndTimeReportingClient();

            var standStillParams = new StandStillReportParam();

            if (objectNumber.Length > 0)
            {
                standStillParams.@object = new ObjectIdentityParameter()
                {
                    objectNo = objectNumber
                };
            }

            if (dateRange != SelectionTimeSpan.Unspecified)
            {
                standStillParams.dateRange = new DateRange()
                {
                    rangePattern          = ReportingServiceHelper.GetDateRangePattern(dateRange),
                    rangePatternSpecified = true
                };
            }


            var response = webService.showStandStillReport(GetAuthenticationParameters(), GetGeneralParameters(), standStillParams);

            if (HandleResult(response))
            {
                result.AddRange(from StandStillList obj in response.results select _mappingService.Map(obj));
            }

            return(result);
        }
 public ICollection <WebFleetOrder> GetOrders(SelectionTimeSpan dateRange)
 {
     return(GetOrders(OrdersServiceHelper.GetDateRangePattern(dateRange)));
 }