Index: PlanScan/UI/frameKlantinstellingen.pas =================================================================== diff -u -r364 -r368 --- PlanScan/UI/frameKlantinstellingen.pas (.../frameKlantinstellingen.pas) (revision 364) +++ PlanScan/UI/frameKlantinstellingen.pas (.../frameKlantinstellingen.pas) (revision 368) @@ -5,7 +5,7 @@ uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Vcl.StdCtrls, - Vcl.ExtCtrls, Vcl.Grids, Vcl.DBGrids, Datasnap.DBClient; + Vcl.ExtCtrls, Vcl.Grids, Vcl.DBGrids, Datasnap.DBClient, DnaCodeService; type TfrmKlantinstellingen = class(TFrame) @@ -17,13 +17,51 @@ btnKlantinstellingenWijzigen: TButton; btnKlantinstellingenVerwijderen: TButton; private - { Private declarations } + procedure VulKlantinstellingenGridMetData(Klantinstellingen: ArrayOfKlantinstellingenKlantinstellingen); public - { Public declarations } + procedure ZoekAlleGebruikers(); end; implementation +uses + Agent, Main, UiContext; + {$R *.dfm} +{ TfrmKlantinstellingen } + +procedure TfrmKlantinstellingen.ZoekAlleGebruikers(); +var + fBewerkKlantinstellingenResponse: BewerkKlantinstellingenResponse; +begin + fBewerkKlantinstellingenResponse := TAgent.Create(fmMain.UiContext).BewerkKlantinstellingen('List','',false); + try + if fBewerkKlantinstellingenResponse.Header.Status = '200' then begin + VulKlantinstellingenGridMetData(fBewerkKlantinstellingenResponse.Klantinstellingen); + end else begin + ShowMessage(fBewerkKlantinstellingenResponse.Header.Omschrijving); + end; + finally + fBewerkKlantinstellingenResponse.Free; + end; +end; + +procedure TfrmKlantinstellingen.VulKlantinstellingenGridMetData( + Klantinstellingen: ArrayOfKlantinstellingenKlantinstellingen); +var + ii: integer; +begin + cdsKlantinstellingen.Close; + cdsKlantinstellingen.CreateDataSet; + + ii := 0; + while ii <= length(Klantinstellingen)-1 do begin + cdsKlantinstellingen.InsertRecord([Klantinstellingen[ii].KlantId, + Klantinstellingen[ii].Klantnaam, + Klantinstellingen[ii].IsExport]); + ii := ii + 1; + end; +end; + end.