Index: AAPClient/WS/Agent.pas =================================================================== diff -u -r385 -r391 --- AAPClient/WS/Agent.pas (.../Agent.pas) (revision 385) +++ AAPClient/WS/Agent.pas (.../Agent.pas) (revision 391) @@ -32,6 +32,7 @@ function ProboxEtiketAfdrukken(DnaCodesStringList: TStringList): ProboxEtiketAfdrukkenResponse; function RondAfKaderdeurDag(DnaCode: String): RondAfKaderdeurDagResponse; function ZoekAlleVhossLadesBijDnaCode(DnaCode: String): ZoekAlleVhossLadesBijDnaCodeResponse; + function ZoekAlleDnaCodesDieOpVhossMoeten(FrameId: String): ZoekAlleDnaCodesDieOpVhossMoetenResponse; end; implementation @@ -243,6 +244,26 @@ end; end; +function TAgent.ZoekAlleDnaCodesDieOpVhossMoeten( + FrameId: String): ZoekAlleDnaCodesDieOpVhossMoetenResponse; +var + Header: DnaCodeService.RequestHeader; + fZoekAlleDnaCodesDieOpVhossMoetenRequest: ZoekAlleDnaCodesDieOpVhossMoetenRequest; +begin + fZoekAlleDnaCodesDieOpVhossMoetenRequest := ZoekAlleDnaCodesDieOpVhossMoetenRequest.Create; + Header := DnaCodeService.RequestHeader.Create; + try + Header.Initialen := fUiContext.Initialen; + Header.ComputerNaam := FullName(); + fZoekAlleDnaCodesDieOpVhossMoetenRequest.Header := Header; + fZoekAlleDnaCodesDieOpVhossMoetenRequest.FrameId := FrameId; + + result := fDnaCodeServiceSoap.ZoekAlleDnaCodesDieOpVhossMoeten(fZoekAlleDnaCodesDieOpVhossMoetenRequest); + finally + fZoekAlleDnaCodesDieOpVhossMoetenRequest.Free; + end; +end; + function TAgent.ZoekAlleVhossLadesBijDnaCode( DnaCode: String): ZoekAlleVhossLadesBijDnaCodeResponse; var 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;