public string UpdateVehicle(Login login, string NAVID, string Kenteken, String ChassisNo, String GSMNummer, string AutoFilter, string Brand) { IWS.ServiceSoapClient IWSService = InitWS(login); string strError = ""; IWS.VehicleInsert UpdateVehicle = new IWS.VehicleInsert { VehicleID = NAVID, VehicleExternalCode = NAVID, LicensePlate = Kenteken, AutoFilter = AutoFilter, Category = IWS.VehicleCategory.GeneralCargo, GsmNumber = GSMNummer, TechnicalInfo = new IWS.VehicleTechnicalInfo { ChassisNumber = ChassisNo, BrandCode = Brand } }; IWS.ResultInfo Update_VehicleResult = IWSService.Update_Vehicle(iwsLogin(login), UpdateVehicle); strError = handleError(Update_VehicleResult); if (!string.IsNullOrEmpty(strError)) { return("Error Update " + strError); } IWS.IdentifierVehicle Vehicle = new IWS.IdentifierVehicle() { IdentifierVehicleType = IWS.enumIdentifierVehicleType.ID, Id = NAVID }; IWS.VehicleSelection_With_NextStop_Info GetVehicles = new IWS.VehicleSelection_With_NextStop_Info() { Identifiers = new IWS.IdentifierVehicle[] { Vehicle } }; IWS.GetVehicleResult_With_NextStop_Info get_VehicleResult = IWSService.Get_Vehicles_V2(iwsLogin(login), GetVehicles); long strTransicsID = 0; foreach (IWS.VehicleResult_With_NextStop_Info veh in get_VehicleResult.Vehicles) { strTransicsID = veh.VehicleTransicsID; } return("Ready " + strTransicsID.ToString()); }
public string UpdateVehicleOutOfDuty(Login login, string NAVID, DateTime OutOfService) { IWS.ServiceSoapClient IWSService = InitWS(login); IWS.VehicleInsert UpdateVehicle = new IWS.VehicleInsert { VehicleID = NAVID, Inactive = true, TechnicalInfo = new IWS.VehicleTechnicalInfo { OutOfDuty = OutOfService, } }; IWS.ResultInfo Update_VehicleResult = IWSService.Update_Vehicle(iwsLogin(login), UpdateVehicle); string strError = handleError(Update_VehicleResult); if (!string.IsNullOrEmpty(strError)) { return("Error Out of Service " + strError); } IWS.IdentifierVehicle Vehicle = new IWS.IdentifierVehicle() { IdentifierVehicleType = IWS.enumIdentifierVehicleType.ID, Id = NAVID }; IWS.VehicleSelection_With_NextStop_Info GetVehicles = new IWS.VehicleSelection_With_NextStop_Info() { Identifiers = new IWS.IdentifierVehicle[] { Vehicle } }; IWS.GetVehicleResult_With_NextStop_Info get_VehicleResult = IWSService.Get_Vehicles_V2(iwsLogin(login), GetVehicles); long strTransicsID = 0; foreach (IWS.VehicleResult_With_NextStop_Info veh in get_VehicleResult.Vehicles) { strTransicsID = veh.VehicleTransicsID; } return("Ready " + strTransicsID.ToString()); }
public string InsertVehicle(Login login, string NAVID, string Kenteken) { IWS.ServiceSoapClient IWSService = InitWS(login); IWS.VehicleInsert InsertVehicle = new IWS.VehicleInsert { VehicleID = NAVID, VehicleExternalCode = NAVID, LicensePlate = Kenteken }; IWS.ResultInfo Insert_VehicleResult = IWSService.Insert_Vehicle(iwsLogin(login), InsertVehicle); string strError = handleError(Insert_VehicleResult); if (string.IsNullOrEmpty(strError)) { return(Insert_VehicleResult.ID); } else { return(strError); } }