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 InsertDriver(Login login, string NAVID, string VoorNaam, string AchterNaam) { IWS.ServiceSoapClient IWSService = InitWS(login); IWS.PersonInsert_V2 InsertPerson = new IWS.PersonInsert_V2 { PersonID = NAVID, Firstname = VoorNaam, Lastname = AchterNaam, Language = "NL", PersonExternalCode = NAVID }; IWS.ResultInfo Insert_PersonResult = IWSService.Insert_Driver_V2(iwsLogin(login), InsertPerson); string strError = handleError(Insert_PersonResult); if (strError == null) { return(Insert_PersonResult.ID); } IWS.Identifier Driver = new IWS.Identifier() { IdentifierType = IWS.enumIdentifierType.ID, Id = NAVID }; IWS.PersonSelection GetDrivers = new IWS.PersonSelection() { Persons = new IWS.Identifier[] { Driver }, }; IWS.GetPersonResult get_DriversResult = IWSService.Get_Drivers(iwsLogin(login), GetDrivers); long strTransicsID = 0; foreach (IWS.PersonResult driver in get_DriversResult.Persons) { strTransicsID = driver.PersonTransicsID; } return(strTransicsID.ToString()); }
public string UpdateDriverResigned(Login login, string NAVID, DateTime TerminationDate) { IWS.ServiceSoapClient IWSService = InitWS(login); IWS.PersonInsert UpdateDriverRes = new IWS.PersonInsert { PersonID = NAVID, TechnicalInfo = new IWS.PersonTechnicalInfo { Resigned = TerminationDate } }; IWS.ResultInfo Update_DriverResultRes = IWSService.Update_Driver(iwsLogin(login), UpdateDriverRes); string strError = handleError(Update_DriverResultRes); if (!string.IsNullOrEmpty(strError)) { return(strError); } IWS.Identifier Driver = new IWS.Identifier() { IdentifierType = IWS.enumIdentifierType.ID, Id = NAVID }; IWS.PersonSelection GetDrivers = new IWS.PersonSelection() { Persons = new IWS.Identifier[] { Driver }, }; IWS.GetPersonResult get_DriversResult = IWSService.Get_Drivers(iwsLogin(login), GetDrivers); long strTransicsID = 0; foreach (IWS.PersonResult driver in get_DriversResult.Persons) { strTransicsID = driver.PersonTransicsID; } return(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); } }
public string UpdateDriver(Login login, string NAVID, string VoorNaam, string AchterNaam, string Language, string Street, string PostCode, string City, string email, string GSM, string DriversLicense, bool ADR, DateTime EmpDate, string TachoCardID) { IWS.ServiceSoapClient IWSService = InitWS(login); IWS.InterfacePersonUpdate_V3 UpdateDriver = new IWS.InterfacePersonUpdate_V3 { DriverToUpdate = new IWS.Identifier { IdentifierType = IWS.enumIdentifierType.ID, Id = NAVID }, Lastname = AchterNaam, Firstname = VoorNaam, Language = Language, TachoCardInfo = new IWS.InterfaceTachoCardInfoUpdate { CardId = TachoCardID }, TechnicalInfo = new IWS.PersonTechnicalInfo { DriverLicense = DriversLicense, ADRCertificate = ADR, Employed = EmpDate }, ContactInfo = new IWS.InterfacePersonContactInfo_V3 { Email = email, GsmNumber = GSM, Address = new IWS.PersonAddress_V3 { Street = Street, ZipCode = PostCode, CountryCode = Language, City = City } } }; IWS.ResultInfo Update_DriverResult = IWSService.Update_Driver_V4(iwsLogin(login), UpdateDriver); string strError = handleError(Update_DriverResult); if (!string.IsNullOrEmpty(strError)) { return(strError); } IWS.Identifier Driver = new IWS.Identifier() { IdentifierType = IWS.enumIdentifierType.ID, Id = NAVID }; IWS.PersonSelection GetDrivers = new IWS.PersonSelection() { Persons = new IWS.Identifier[] { Driver }, }; IWS.GetPersonResult get_DriversResult = IWSService.Get_Drivers(iwsLogin(login), GetDrivers); long strTransicsID = 0; foreach (IWS.PersonResult driver in get_DriversResult.Persons) { strTransicsID = driver.PersonTransicsID; } return(strTransicsID.ToString()); }