Index: VerpakkingsDefinitie/VerpakkingsDefinitie.dpr =================================================================== diff -u -r564 -r573 --- VerpakkingsDefinitie/VerpakkingsDefinitie.dpr (.../VerpakkingsDefinitie.dpr) (revision 564) +++ VerpakkingsDefinitie/VerpakkingsDefinitie.dpr (.../VerpakkingsDefinitie.dpr) (revision 573) @@ -17,7 +17,8 @@ NavGridPanel in 'UI\NavGridPanel.pas', GevondenProductenScherm in 'UI\GevondenProductenScherm.pas' {FormGevondenProducten}, OptiServerService in 'WS\OptiServerService.pas', - ProductDetailScherm in 'UI\ProductDetailScherm.pas' {FormProductDetail}; + ProductDetailScherm in 'UI\ProductDetailScherm.pas' {FormProductDetail}, + CheckCombo in 'UI\CheckCombo.pas'; {$R *.res} Index: VerpakkingsDefinitie/VerpakkingsDefinitie.dproj =================================================================== diff -u -r564 -r573 --- VerpakkingsDefinitie/VerpakkingsDefinitie.dproj (.../VerpakkingsDefinitie.dproj) (revision 564) +++ VerpakkingsDefinitie/VerpakkingsDefinitie.dproj (.../VerpakkingsDefinitie.dproj) (revision 573) @@ -118,6 +118,7 @@
FormProductDetail
dfm + Cfg_2 Base Index: VerpakkingsDefinitie/UI/NavGridPanel.pas =================================================================== diff -u -r559 -r573 --- VerpakkingsDefinitie/UI/NavGridPanel.pas (.../NavGridPanel.pas) (revision 559) +++ VerpakkingsDefinitie/UI/NavGridPanel.pas (.../NavGridPanel.pas) (revision 573) @@ -43,7 +43,7 @@ const colLeftSize: Integer = 375; rowTopSize: Integer = 40; - rowMidSize: Integer = 200; + rowMidSize: Integer = 220; begin // Rijen en kolommen toevoegen Index: VerpakkingsDefinitie/UI/ZoekProductenScherm.dfm =================================================================== diff -u -r559 -r573 --- VerpakkingsDefinitie/UI/ZoekProductenScherm.dfm (.../ZoekProductenScherm.dfm) (revision 559) +++ VerpakkingsDefinitie/UI/ZoekProductenScherm.dfm (.../ZoekProductenScherm.dfm) (revision 573) @@ -3,7 +3,7 @@ Top = 0 BorderStyle = bsSizeToolWin Caption = 'FormZoekProducten' - ClientHeight = 161 + ClientHeight = 204 ClientWidth = 359 Color = clBtnFace Font.Charset = DEFAULT_CHARSET @@ -15,14 +15,14 @@ OnCreate = FormCreate DesignSize = ( 359 - 161) + 204) PixelsPerInch = 96 TextHeight = 13 object PageControl1: TPageControl Left = 0 Top = 0 Width = 361 - Height = 162 + Height = 204 ActivePage = TabSheetKortTekst Anchors = [akLeft, akTop, akRight, akBottom] Font.Charset = DEFAULT_CHARSET @@ -34,68 +34,256 @@ TabOrder = 0 object TabSheetKortTekst: TTabSheet Caption = 'Kort tekst' + ExplicitHeight = 144 object Label1: TLabel Left = 3 - Top = 16 + Top = 10 Width = 27 Height = 13 Caption = 'Zoek:' end object Label2: TLabel Left = 3 - Top = 56 - Width = 33 + Top = 45 + Width = 37 Height = 13 - Caption = 'Beperk' + Caption = 'Beperk:' end - object EditZoek: TEdit + object EditZoekKortTekst: TEdit Left = 56 - Top = 13 + Top = 7 Width = 289 Height = 21 TabOrder = 0 - OnChange = EditZoekChange + OnChange = EditZoekKortTekstChange end - object ComboBoxAt: TComboBox + object ComboBoxBeperkKortTekst: TComboBox Left = 56 - Top = 53 - Width = 65 + Top = 42 + Width = 145 Height = 21 Style = csDropDownList TabOrder = 1 + OnChange = ComboBoxBeperkKortTekstChange + Items.Strings = ( + '--Geen beperking--' + 'Klant nummer' + 'Leveranciers nummer') end - object EditKlantNr: TEdit - Left = 144 - Top = 53 - Width = 201 + object EditBeperkKortTekst: TEdit + Left = 56 + Top = 69 + Width = 289 Height = 21 TabOrder = 2 end object ButtonZoekViaKortTekst: TButton - Left = 56 - Top = 88 - Width = 289 + Left = 72 + Top = 115 + Width = 200 Height = 25 - Caption = 'Zoek via kortTekst' + Caption = 'Zoek' + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False TabOrder = 3 OnClick = ButtonZoekViaKortTekstClick end end object TabSheetIdentificatieNr: TTabSheet Caption = 'Identificatie nr' ImageIndex = 1 + ExplicitHeight = 144 + object Label3: TLabel + Left = 3 + Top = 10 + Width = 41 + Height = 13 + Caption = 'IdentNr:' + end + object EditZoekIdentNr: TEdit + Left = 56 + Top = 7 + Width = 289 + Height = 21 + TabOrder = 0 + OnChange = EditZoekIdentNrChange + end + object ButtonZoekIdentNr: TButton + Left = 72 + Top = 45 + Width = 200 + Height = 25 + Caption = 'Zoek' + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 1 + OnClick = ButtonZoekIdentNrClick + end end object TabSheetLeveranciersRef: TTabSheet Caption = 'Leveranciers ref' ImageIndex = 2 + ExplicitHeight = 144 + object Label4: TLabel + Left = 3 + Top = 10 + Width = 55 + Height = 13 + Caption = 'Referentie:' + end + object Label5: TLabel + Left = 3 + Top = 45 + Width = 80 + Height = 13 + Caption = 'Beperk klantnr. :' + end + object Label6: TLabel + Left = 3 + Top = 80 + Width = 55 + Height = 13 + Caption = 'Stock type:' + end + object EditZoekReferentie: TEdit + Left = 120 + Top = 7 + Width = 225 + Height = 21 + TabOrder = 0 + OnChange = EditZoekReferentieChange + end + object EditKlantNrReferentie: TEdit + Left = 120 + Top = 42 + Width = 225 + Height = 21 + TabOrder = 1 + TextHint = 'Klant nr' + end + object ComboBoxStockTypeReferentie: TComboBox + Left = 120 + Top = 77 + Width = 225 + Height = 21 + Style = csDropDownList + TabOrder = 2 + Items.Strings = ( + '--Niet gespecifieerd--' + 'S' + 'N' + 'A') + end + object ButtonZoekLeveranciersReferentie: TButton + Left = 72 + Top = 115 + Width = 200 + Height = 25 + Caption = 'Zoek' + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 3 + OnClick = ButtonZoekLeveranciersReferentieClick + end end object TabSheetTekst: TTabSheet Caption = 'Tekst' ImageIndex = 3 + object Label7: TLabel + Left = 3 + Top = 10 + Width = 27 + Height = 13 + Caption = 'Zoek:' + end + object Label8: TLabel + Left = 3 + Top = 45 + Width = 27 + Height = 13 + Caption = 'Taal :' + end + object Label10: TLabel + Left = 3 + Top = 80 + Width = 37 + Height = 13 + Caption = 'Beperk:' + end + object EditZoekTekst: TEdit + Left = 56 + Top = 7 + Width = 289 + Height = 21 + TabOrder = 0 + OnChange = EditZoekTekstChange + end + object ComboBoxTaalTekst: TComboBox + Left = 56 + Top = 42 + Width = 225 + Height = 21 + Style = csDropDownList + TabOrder = 1 + Items.Strings = ( + '--Niet gespecifieerd--' + 'N' + 'F' + 'D' + 'E' + 'R') + end + object ComboBoxBeperkTekst: TComboBox + Left = 56 + Top = 77 + Width = 145 + Height = 21 + Style = csDropDownList + TabOrder = 2 + OnChange = ComboBoxBeperkTekstChange + Items.Strings = ( + '--Geen beperking--' + 'Klant nummer' + 'Leveranciers nummer') + end + object EditBeperkTekst: TEdit + Left = 56 + Top = 104 + Width = 289 + Height = 21 + TabOrder = 3 + end + object ButtonZoekTekst: TButton + Left = 72 + Top = 150 + Width = 200 + Height = 25 + Caption = 'Zoek' + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnClick = ButtonZoekTekstClick + end end - object TabSheetProductboom: TTabSheet - Caption = 'Productboom' - ImageIndex = 4 - end end end Index: VerpakkingsDefinitie/UI/ZoekProductenScherm.pas =================================================================== diff -u -r571 -r573 --- VerpakkingsDefinitie/UI/ZoekProductenScherm.pas (.../ZoekProductenScherm.pas) (revision 571) +++ VerpakkingsDefinitie/UI/ZoekProductenScherm.pas (.../ZoekProductenScherm.pas) (revision 573) @@ -17,18 +17,45 @@ TabSheetIdentificatieNr: TTabSheet; TabSheetLeveranciersRef: TTabSheet; TabSheetTekst: TTabSheet; - TabSheetProductboom: TTabSheet; Label1: TLabel; - EditZoek: TEdit; + EditZoekKortTekst: TEdit; Label2: TLabel; - ComboBoxAt: TComboBox; - EditKlantNr: TEdit; + ComboBoxBeperkKortTekst: TComboBox; + EditBeperkKortTekst: TEdit; ButtonZoekViaKortTekst: TButton; + Label3: TLabel; + EditZoekIdentNr: TEdit; + ButtonZoekIdentNr: TButton; + Label4: TLabel; + Label5: TLabel; + EditZoekReferentie: TEdit; + EditKlantNrReferentie: TEdit; + Label6: TLabel; + ComboBoxStockTypeReferentie: TComboBox; + ButtonZoekLeveranciersReferentie: TButton; + Label7: TLabel; + Label8: TLabel; + EditZoekTekst: TEdit; + ComboBoxTaalTekst: TComboBox; + Label10: TLabel; + ComboBoxBeperkTekst: TComboBox; + EditBeperkTekst: TEdit; + ButtonZoekTekst: TButton; procedure FormCreate(Sender: TObject); procedure ButtonZoekViaKortTekstClick(Sender: TObject); - procedure EditZoekChange(Sender: TObject); + procedure EditZoekKortTekstChange(Sender: TObject); + procedure ComboBoxBeperkKortTekstChange(Sender: TObject); + procedure ButtonZoekIdentNrClick(Sender: TObject); + procedure ButtonZoekLeveranciersReferentieClick(Sender: TObject); + procedure ComboBoxBeperkTekstChange(Sender: TObject); + procedure EditZoekIdentNrChange(Sender: TObject); + procedure EditZoekReferentieChange(Sender: TObject); + procedure EditZoekTekstChange(Sender: TObject); + procedure ButtonZoekTekstClick(Sender: TObject); private FProductAgent: TProductsAgent; + procedure VerwerkOpzoeking(); + procedure ComboBoxBeperkUpdatet(ComboBox: TComboBox; EditText: TEdit); public Constructor Create(AOwner: TComponent; Navigator: TFormMain; ApplicationContext: TApplicationContext; ProductAgent: TProductsAgent); @@ -43,38 +70,96 @@ begin inherited Create(AOwner, Navigator, ApplicationContext); self.FProductAgent := ProductAgent; +end; - ButtonZoekViaKortTekst.Enabled := false; +procedure TFormZoekProducten.FormCreate(Sender: TObject); +begin + // Vorige opzoeking is ongeldig + self.ApplicationContext.ProductsContext.reset(); + + // UI configuratie + // Zoeken op kort tekst + ComboBoxBeperkKortTekst.ItemIndex := 0; // Default value + ComboBoxBeperkUpdatet(ComboBoxBeperkKortTekst, EditBeperkKortTekst); + // Zoeken op leveranciers referentie + ComboBoxStockTypeReferentie.ItemIndex := 0; // Default value + // Zoeken op tekst + ComboBoxTaalTekst.ItemIndex := 0; + ComboBoxBeperkTekst.ItemIndex := 0; + ComboBoxBeperkUpdatet(ComboBoxBeperkTekst, EditBeperkTekst); end; -procedure TFormZoekProducten.EditZoekChange(Sender: TObject); +procedure TFormZoekProducten.ComboBoxBeperkKortTekstChange(Sender: TObject); begin - // Opzoeken met lege tekst geeft problemen - ButtonZoekViaKortTekst.Enabled := (Sender as TEdit).Text <> EmptyStr; + ComboBoxBeperkUpdatet(ComboBoxBeperkKortTekst, EditBeperkKortTekst); end; -procedure TFormZoekProducten.FormCreate(Sender: TObject); +procedure TFormZoekProducten.ComboBoxBeperkTekstChange(Sender: TObject); begin - // COMBOBOXAT INSTELLEN - ComboBoxAt.Style := csDropDownList; // Typen in combobox uitzetten - // Waarden toevoegen aan combobox - ComboBoxAt.AddItem('K', nil); - ComboBoxAt.AddItem('L', nil); - ComboBoxAt.AddItem('', nil); - // Default value - ComboBoxAt.ItemIndex := 0; + ComboBoxBeperkUpdatet(ComboBoxBeperkTekst, EditBeperkTekst); +end; - // Vorige opzoeking is ongeldig - self.ApplicationContext.ProductsContext.reset() +procedure TFormZoekProducten.ComboBoxBeperkUpdatet(ComboBox: TComboBox; EditText: TEdit); +begin + if ComboBox.ItemIndex > -1 then + if ComboBox.Items[ComboBox.ItemIndex] = 'Klant nummer' then + EditText.Enabled := true + else if ComboBox.Items[ComboBox.ItemIndex] = 'Leveranciers nummer' then + EditText.Enabled := true + else if ComboBox.Items[ComboBox.ItemIndex] = '--Geen beperking--' then + EditText.Enabled := false + else + raise Exception.Create('Ongeldige waarde geselecteerd'); end; +procedure TFormZoekProducten.EditZoekKortTekstChange(Sender: TObject); +begin + ButtonZoekViaKortTekst.Enabled := (Sender as TEdit).text <> EmptyStr; +end; + +procedure TFormZoekProducten.EditZoekIdentNrChange(Sender: TObject); +begin + ButtonZoekIdentNr.Enabled := (Sender as TEdit).text <> EmptyStr; +end; + +procedure TFormZoekProducten.EditZoekReferentieChange(Sender: TObject); +begin + ButtonZoekLeveranciersReferentie.Enabled := (Sender as TEdit).text <> EmptyStr; +end; + +procedure TFormZoekProducten.EditZoekTekstChange(Sender: TObject); +begin + ButtonZoekTekst.Enabled := (Sender as TEdit).text <> EmptyStr; +end; + procedure TFormZoekProducten.ButtonZoekViaKortTekstClick(Sender: TObject); +begin + { TODO -cZoekProductenScherm : Opzoeken via korttekst } + VerwerkOpzoeking(); +end; + +procedure TFormZoekProducten.ButtonZoekIdentNrClick(Sender: TObject); +begin + { TODO -cZoekProductenScherm : Opzoeken via identnr } + VerwerkOpzoeking(); +end; + +procedure TFormZoekProducten.ButtonZoekLeveranciersReferentieClick(Sender: TObject); +begin + { TODO -cZoekProductenScherm : Opzoeken via leveranciers referentie } + VerwerkOpzoeking(); +end; + +procedure TFormZoekProducten.ButtonZoekTekstClick(Sender: TObject); +begin + { TODO -cZoekProductenScherm : Opzoeken via tekst } + VerwerkOpzoeking(); +end; + +procedure TFormZoekProducten.VerwerkOpzoeking(); var ErrorMessage: string; begin - FProductAgent.ZoekOpMetKortTekst(EditZoek.Text, EditKlantNr.Text, ComboBoxAt.Text, self.ApplicationContext.UserContext, - self.ApplicationContext.ProductsContext); - if ApplicationContext.ProductsContext.IsOK = false then begin // Opzoeking gefaald Index: VerpakkingsDefinitie/Main.dfm =================================================================== diff -u -r555 -r573 --- VerpakkingsDefinitie/Main.dfm (.../Main.dfm) (revision 555) +++ VerpakkingsDefinitie/Main.dfm (.../Main.dfm) (revision 573) @@ -2,8 +2,8 @@ Left = 0 Top = 0 Caption = 'Verpakkings Definitie' - ClientHeight = 481 - ClientWidth = 944 + ClientHeight = 711 + ClientWidth = 1184 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -14,20 +14,22 @@ OnCloseQuery = FormCloseQuery OnCreate = FormCreate DesignSize = ( - 944 - 481) + 1184 + 711) PixelsPerInch = 96 TextHeight = 13 object PanelMain: TPanel Left = 0 Top = 0 - Width = 944 - Height = 481 + Width = 1184 + Height = 711 Anchors = [akLeft, akTop, akRight, akBottom] Color = clWhite ParentBackground = False ParentShowHint = False ShowHint = True TabOrder = 0 + ExplicitWidth = 944 + ExplicitHeight = 481 end end