Index: AAPClient/UI/DnaCodeScherm.pas =================================================================== diff -u -r389 -r391 --- AAPClient/UI/DnaCodeScherm.pas (.../DnaCodeScherm.pas) (revision 389) +++ AAPClient/UI/DnaCodeScherm.pas (.../DnaCodeScherm.pas) (revision 391) @@ -353,34 +353,36 @@ fDnaCodeTeller: integer; fAantalGescand: integer; begin - if UiContext.LaatsteDnaCode = '' then - exit; + if UiContext.LaatsteDnaCode = '' then begin + // - fZoekAlleVhossLadesBijDnaCodeResponse := TAgent.Create(UiContext).ZoekAlleVhossLadesBijDnaCode(UiContext.LaatsteDnaCode); - try - if fZoekAlleVhossLadesBijDnaCodeResponse.Header.Status <> '200' then begin - ToonPopupScherm(fZoekAlleVhossLadesBijDnaCodeResponse.Header.Omschrijving, 'Probeer opnieuw') - end else begin - fDnaCodeTeller := 0; - fAantalGescand := 0; - while fDnaCodeTeller < length(fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes) do begin - if not (fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes[fDnaCodeTeller].ScanTijdstip = nil) then - fAantalGescand := fAantalGescand + 1; + end else begin + fZoekAlleVhossLadesBijDnaCodeResponse := TAgent.Create(UiContext).ZoekAlleVhossLadesBijDnaCode(UiContext.LaatsteDnaCode); + try + if fZoekAlleVhossLadesBijDnaCodeResponse.Header.Status <> '200' then begin + ToonPopupScherm(fZoekAlleVhossLadesBijDnaCodeResponse.Header.Omschrijving, 'Probeer opnieuw') + end else begin + fDnaCodeTeller := 0; + fAantalGescand := 0; + while fDnaCodeTeller < length(fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes) do begin + if not (fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes[fDnaCodeTeller].ScanTijdstip = nil) then + fAantalGescand := fAantalGescand + 1; - if fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes[fDnaCodeTeller].DnaCode = UiContext.LaatsteDnaCode then - UiContext.Toelevering := fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes[fDnaCodeTeller].Toelevering; + if fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes[fDnaCodeTeller].DnaCode = UiContext.LaatsteDnaCode then + UiContext.Toelevering := fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes[fDnaCodeTeller].Toelevering; - fDnaCodeTeller := fDnaCodeTeller + 1; - end; + fDnaCodeTeller := fDnaCodeTeller + 1; + end; - lblAantalGescand.Caption := IntToStr(fAantalGescand); - lblTotaalAantal.Caption := IntToStr(length(fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes)); - btnInfo.Visible := true; - ZetIcoontjesBovenaan; - Self.ModalResult := mrDnaCode; + lblAantalGescand.Caption := IntToStr(fAantalGescand); + lblTotaalAantal.Caption := IntToStr(length(fZoekAlleVhossLadesBijDnaCodeResponse.DnaCodes)); + btnInfo.Visible := true; + ZetIcoontjesBovenaan; + Self.ModalResult := mrDnaCode; + end; + finally + fZoekAlleVhossLadesBijDnaCodeResponse.Free; end; - finally - fZoekAlleVhossLadesBijDnaCodeResponse.Free; end; end;