コード例 #1
0
        public ActivityReport[] GetActRep(Login login, int minutes)
        {
            IWS.ServiceSoapClient IWSService = InitWS(login);

            IWS.ActivityReportSelection_V3 ActRepSel = new IWS.ActivityReportSelection_V3();

            IWS.DateTimeSelection      dtSel = new IWS.DateTimeSelection();
            IWS.DateTimeAndIdSelection idSel = new IWS.DateTimeAndIdSelection();

            idSel.DateTimeType = IWS.enumSelectionDateTimeAndIdType.MINUTES;
            idSel.Value        = minutes;

            dtSel.DateTimeType = IWS.enumSelectionDateTimeType.MINUTES;
            dtSel.Value        = minutes;

            ActRepSel.DateTimeSelection = idSel;

            IWS.GetActivityReportResult_V9 ActRepRes = IWSService.Get_ActivityReport_V9(iwsLogin(login), ActRepSel);

            int i = 0;

            ActivityReport[] actRepList = new ActivityReport[ActRepRes.ActivityReportItems.Count()];

            foreach (IWS.ActivityReportItem_V9 act in ActRepRes.ActivityReportItems)
            {
                i = MoveActToActRep(act, ref actRepList, i);
            }
            return(actRepList);
        }
コード例 #2
0
        public ActivityReport[] GetActRepVehicle(Login login, string vehicle, DateTime FromDate, DateTime ToDate)
        {
            IWS.ServiceSoapClient IWSService = InitWS(login);

            IWS.ActivityReportSelection_V3 ActRepSel = new IWS.ActivityReportSelection_V3();

            IWS.PeriodSelectionWithDateType pSel = new IWS.PeriodSelectionWithDateType();

            pSel.StartDate = FromDate;
            pSel.EndDate   = ToDate;

            ActRepSel.DateTimeRangeSelection = pSel;
            ActRepSel.IncludeRegistrations   = true;

            IWS.IdentifierVehicle Vehicle = new IWS.IdentifierVehicle()
            {
                IdentifierVehicleType = IWS.enumIdentifierVehicleType.ID,
                Id = vehicle
            };

            ActRepSel.IncludeRegistrations = true;

            ActRepSel.Vehicles = new IWS.IdentifierVehicle[] { Vehicle };
            IWS.GetActivityReportResult_V9 ActRepRes = IWSService.Get_ActivityReport_V9(iwsLogin(login), ActRepSel);

            foreach (IWS.Error err in ActRepRes.Errors)
            {
                throw new System.InvalidOperationException(err.ErrorCodeExplanation);
            }

            int i = 0;

            ActivityReport[] actRepList = new ActivityReport[ActRepRes.ActivityReportItems.Count()];

            foreach (IWS.ActivityReportItem_V9 act in ActRepRes.ActivityReportItems)
            {
                i = MoveActToActRep(act, ref actRepList, i);
            }
            return(actRepList);
        }