Index: ProScan/UI/PalletScherm.pas =================================================================== diff -u -r679 -r684 --- ProScan/UI/PalletScherm.pas (.../PalletScherm.pas) (revision 679) +++ ProScan/UI/PalletScherm.pas (.../PalletScherm.pas) (revision 684) @@ -13,17 +13,14 @@ imgPallet: TImage; edtPallet: TEdit; btnGenereerTbp: TButton; - btnOnderdelen: TButton; procedure FormShow(Sender: TObject); procedure actHomeExecute(Sender: TObject); procedure actVolgendeExecute(Sender: TObject); procedure edtPalletKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); procedure btnGenereerTbpClick(Sender: TObject); - procedure btnOnderdelenClick(Sender: TObject); procedure FormActivate(Sender: TObject); private - procedure ResetPopups; procedure SetContext; procedure SetModus(GescandeInput: string); function ValideerPalletCode(GescandeInput: string): boolean; @@ -52,19 +49,20 @@ var fZoekViaPalletCodeResponse: ZoekViaPalletCodeResponse; fZoekViaToeleveringResponse: ZoekViaToeleveringResponse; + fPalletGevalideerd: boolean; fAgent: TAgent; begin SetModus(edtPallet.Text); - if (UiContext.MoetTbpCodeGenereren = true) then begin - ResetPopups; - Self.ModalResult := mrDnaCode; - end else if (UiContext.Modus = modusKAD) then begin - Self.ModalResult := mrDnaCode; - end else if (UiContext.Modus = modusVHOSS) then begin - Self.ModalResult := mrDnaCode; - end else if (ValideerPalletCode(edtPallet.Text) = true) then begin - fAgent := TAgent.Create(UiContext); + fPalletGevalideerd := false; + if not (UiContext.Modus = modusKAD) then + fPalletGevalideerd := ValideerPalletCode(edtPallet.Text); + + //checken of pallet in gebruik is indien het vorige geslaagd is + if fPalletGevalideerd and not(UiContext.Modus = modusKAD) and not(UiContext.Modus = modusVHOSS ) then begin + if (UiContext.MoetTbpCodeGenereren = true) then + edtPallet.Text := '000000'; // Kleine hack om hieronder een foute statuscode te geven + fAgent := TAgent.Create(UiContext); fZoekViaPalletCodeResponse := fAgent.ZoekViaPalletCode(edtPallet.Text); fAgent.Free; try @@ -90,11 +88,20 @@ finally fZoekViaPalletCodeResponse.Free; end; - ResetPopups; + //popups resetten + UiContext.IsDirecteLeveringPopupGetoond := false; + UiContext.IsWegwerpPalletPopupGetoond := false; + UiContext.IsSSTPopupGetoond := false; + UiContext.IsExportPopupGetoond := false; + UiContext.IsBlumXsPopupGetoond := false; + UiContext.InternVhossId := ''; + end else if (UiContext.Modus = modusKAD) then begin + Self.ModalResult := mrDnaCode; + end else if (UiContext.Modus = modusVHOSS) then begin + Self.ModalResult := mrDnaCode; end else begin Self.ModalResult := mrPallet; end; - PostMessage(Self.Handle,WM_Close,0,0); (Self.Parent.Parent As TfmProScanHoofdscherm).NavigeerNaar(Self.ModalResult); end; @@ -108,7 +115,7 @@ result := false; if (UiContext.MoetTbpCodeGenereren) then begin - result := true; + result := true; end else begin fAgent := TAgent.Create(UiContext); fValideerPalletCodeResponse := fAgent.ValideerPalletCode(edtPallet.Text); @@ -128,15 +135,6 @@ end; end; -procedure TfmPalletScherm.ResetPopups; -begin - UiContext.IsDirecteLeveringPopupGetoond := false; - UiContext.IsWegwerpPalletPopupGetoond := false; - UiContext.IsSSTPopupGetoond := false; - UiContext.IsExportPopupGetoond := false; - UiContext.IsBlumXsPopupGetoond := false; - UiContext.InternVhossId := ''; -end; procedure TfmPalletScherm.btnGenereerTbpClick(Sender: TObject); begin @@ -147,14 +145,6 @@ actVolgendeExecute(Self); end; -procedure TfmPalletScherm.btnOnderdelenClick(Sender: TObject); -begin - inherited; - Self.ModalResult := mrOnderdelen; - PostMessage(Self.Handle,WM_Close,0,0); - (Self.Parent.Parent As TfmProScanHoofdscherm).NavigeerNaar(Self.ModalResult); -end; - procedure TfmPalletScherm.edtPalletKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin @@ -202,4 +192,3 @@ end; end. -