Index: VerpakkingsDefinitie/UI/GevondenProductenScherm.pas =================================================================== diff -u -r571 -r583 --- VerpakkingsDefinitie/UI/GevondenProductenScherm.pas (.../GevondenProductenScherm.pas) (revision 571) +++ VerpakkingsDefinitie/UI/GevondenProductenScherm.pas (.../GevondenProductenScherm.pas) (revision 583) @@ -44,8 +44,6 @@ end; procedure TFormGevondenProducten.FormCreate(Sender: TObject); -var - ColNaam: string; begin FProductSubject.RegisterObserver(FSubjectObserver); end; @@ -56,15 +54,30 @@ end; procedure TFormGevondenProducten.ListViewProductenSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean); +var + ErrorMessage: string; begin if Item = nil then exit; if Item.Data = nil then exit; ApplicationContext.ProductDetailContext.GeselecteerdProduct := Item.Data; - ApplicationContext.ProductDetailContext.NotifyChanged(); + // ApplicationContext.ProductDetailContext.NotifyChanged(); FProductsAgent.ZoekProductDataMetProductNr(TProductInformatie(Item.Data).ProductNr, self.ApplicationContext.UserContext, self.ApplicationContext.ProductDetailContext); + + if self.ApplicationContext.ProductDetailContext.IsOK = false then + begin + // Opzoeking gefaald + ErrorMessage := self.ApplicationContext.ProductDetailContext.ErrorMessage; + if self.ApplicationContext.ProductDetailContext.InternalErrorMessage <> '' then + begin + ErrorMessage := ErrorMessage + sLineBreak + self.ApplicationContext.ProductDetailContext.InternalErrorMessage; + end; + + MessageDlg(ErrorMessage, TMsgDlgType.mtInformation, [mbOK], 0, mbCancel) + end; + self.ApplicationContext.ProductDetailContext.Reset(); end; procedure TFormGevondenProducten.UpdateGui(Sender: TObject);