Beispiel #1
0
        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());
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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());
        }