Пример #1
0
        public string RemoveVehicleFromPlanner(Login login, ref IWS.ServiceSoapClient IWSService, string VehID, string PlannerID)
        {
            IWS.IdentifierVehicle Veh = new IWS.IdentifierVehicle()
            {
                IdentifierVehicleType = IWS.enumIdentifierVehicleType.ID,
                Id = VehID
            };

            IWS.Identifier disp = new IWS.Identifier()
            {
                IdentifierType = IWS.enumIdentifierType.ID,
                Id             = PlannerID
            };

            IWS.RemoveIdentifiersFromDispatchers ws = new IWS.RemoveIdentifiersFromDispatchers
            {
                VehicleItemList    = new IWS.IdentifierVehicle[] { Veh },
                DispatcherItemList = new IWS.Identifier[] { disp }
            };

            IWS.ExecutionResult RemVehToPlanRes = IWSService.Remove_Vehicles_From_Dispatchers(iwsLogin(login), ws);

            string strError = handleError(RemVehToPlanRes);

            if (strError == null)
            {
                return("");
            }
            else
            {
                return(strError);
            }
        }
Пример #2
0
        private string handleError(IWS.ExecutionResult response)
        {
            string strError = "";

            if (response.Errors.Length > 0)
            {
                foreach (IWS.Error err in response.Errors)
                {
                    strError = err.ErrorCode + ": " + err.ErrorCodeExplanation + "(" + err.Field + " - " + err.Value + ")";
                }
            }
            return(strError);
        }
Пример #3
0
        public string CancelPlanning(Login login, string TripID)
        {
            IWS.ServiceSoapClient IWSService = InitWS(login);

            IWS.PlanningItemSelection CancelPlanningData = new IWS.PlanningItemSelection()
            {
                ID = TripID,
                PlanningSelectionType = IWS.enumPlanningItemSelectionType.TRIP
            };

            IWS.ExecutionResult PlanningCancelResult = IWSService.Cancel_Planning(iwsLogin(login), CancelPlanningData);

            return(handleError(PlanningCancelResult));
        }
Пример #4
0
        public string ExecCancelPlaces(Login login, Cancel cancel)
        {
            IWS.ServiceSoapClient IWSService = InitWS(login);
            string strError = "";

            foreach (string PlaceID in cancel.PlaceID)
            {
                IWS.PlanningItemSelection CancelPlanningData = new IWS.PlanningItemSelection()
                {
                    ID = PlaceID,
                    PlanningSelectionType = IWS.enumPlanningItemSelectionType.PLACE
                };

                IWS.ExecutionResult PlanningCancelResult = IWSService.Cancel_Planning(iwsLogin(login), CancelPlanningData);

                strError = handleError(PlanningCancelResult);
            }

            return(strError);
        }
Пример #5
0
        public string AssignVehicleToPlanner(Login login, ref IWS.ServiceSoapClient IWSService, string VehID, string PlannerID)
        {
            IWS.IdentifierVehicle Veh = new IWS.IdentifierVehicle()
            {
                IdentifierVehicleType = IWS.enumIdentifierVehicleType.ID,
                Id = VehID
            };

            IWS.IdentifierVehicleItem item = new IWS.IdentifierVehicleItem()
            {
                Identifier = Veh
            };


            IWS.Identifier disp = new IWS.Identifier()
            {
                IdentifierType = IWS.enumIdentifierType.ID,
                Id             = PlannerID
            };

            IWS.AssignIdentifiersToDispatchers ws = new IWS.AssignIdentifiersToDispatchers
            {
                VehicleItemList    = new IWS.IdentifierVehicleItem[] { item },
                DispatcherItemList = new IWS.Identifier[] { disp }
            };

            IWS.ExecutionResult AssVehToPlanRes = IWSService.Assign_Vehicles_To_Dispatchers(iwsLogin(login), ws);
            string strError = handleError(AssVehToPlanRes);

            if (strError == null)
            {
                return("");
            }
            else
            {
                return(strError);
            }
        }