Index: VerpakkingsDefinitie/WS/ProductsAgent.pas =================================================================== diff -u -r570 -r574 --- VerpakkingsDefinitie/WS/ProductsAgent.pas (.../ProductsAgent.pas) (revision 570) +++ VerpakkingsDefinitie/WS/ProductsAgent.pas (.../ProductsAgent.pas) (revision 574) @@ -13,6 +13,8 @@ OPTI_SERVER_URL = 'http://cacheaccept2010:57772/csp/dev1/WS.Prod.OptiBox.OptiServer.CLS'; type + TZoekMethode = (KortTekst, IdentificatieNr, LeveranciersRef, Tekst); + TProductsAgent = class private FSelectServerSoap: SelectService.ProdSelectServerSoap; @@ -28,8 +30,8 @@ ProductDetailContext: TProductDetailContext): string; public Constructor Create(); - procedure ZoekOpMetKortTekst(Zoek: string; KLNr: string; At: string; UserContext: TUserContext; - ProductsContext: TProductsContext); + procedure ZoekOp(UserContext: TUserContext; ProductsContext: TProductsContext; Zoekmethode: TZoekMethode; Zoek: string; + KLNr: string; LevNr: string; StockType: string; Taal: string); procedure ZoekProductDataMetProductNr(ProductNr: Integer; UserContext: TUserContext; ProductDetailContext: TProductDetailContext); end; @@ -45,22 +47,40 @@ FOptiBoxServerSoap := OptiServerService.GetOptiBoxServerSoap(false, OPTI_SERVER_URL, nil); end; -procedure TProductsAgent.ZoekOpMetKortTekst(Zoek: string; KLNr: string; At: string; UserContext: TUserContext; - ProductsContext: TProductsContext); +procedure TProductsAgent.ZoekOp(UserContext: TUserContext; ProductsContext: TProductsContext; Zoekmethode: TZoekMethode; + Zoek: string; KLNr: string; LevNr: string; StockType: string; Taal: string); var ZoekData: SelectService.Select; ZoekCriteria: SelectService.pxSelectCriteria; // Property van ZoekData SelectResponseObj: SelectService.SelectResponse; + At: string; begin + // At bepalen + case Zoekmethode of + KortTekst: + At := 'K'; + IdentificatieNr: + At := 'I'; + LeveranciersRef: + At := 'R'; + Tekst: + At := 'T'; + else + raise Exception.Create('Ongeldige zoekmethode'); + end; + ZoekData := nil; try // Request ZoekData := SelectService.Select.Create(); ZoekCriteria := SelectService.pxSelectCriteria.Create(); ZoekData.SessionKey := UserContext.SessionKey; - ZoekCriteria.KLNr := KLNr; ZoekCriteria.Zoek := Zoek; ZoekCriteria.At := At; + ZoekCriteria.KLNr := KLNr; + ZoekCriteria.LevNr := LevNr; + ZoekCriteria.StockType := StockType; + ZoekCriteria.SubAt := Taal; ZoekCriteria.FormatCompact := 'KortTekst;IdentNr;StockType'; ZoekCriteria.FormatExpand := 'KortTekst;IdentNr;StockType;LangTekstN'; ZoekData.Criteria := ZoekCriteria;