Index: PlanScan/Main.dfm =================================================================== diff -u -r348 -r349 --- PlanScan/Main.dfm (.../Main.dfm) (revision 348) +++ PlanScan/Main.dfm (.../Main.dfm) (revision 349) @@ -26,100 +26,14 @@ 000001004F0300004F0300000000000001010C5175657279204C6F6F6B757000 00000000FFFFFFFF} end - object pcMain: TPageControl - Left = 197 - Top = 184 - Width = 368 - Height = 184 - ActivePage = tsDnaCodes - MultiLine = True - TabOrder = 1 - TabPosition = tpLeft - object tsDnaCodes: TTabSheet - Caption = 'DnaCodes' - ExplicitWidth = 427 - ExplicitHeight = 352 - end - object tsGebruikers: TTabSheet - Caption = 'Gebruikers' - ImageIndex = 1 - OnShow = tsGebruikersShow - ExplicitWidth = 427 - ExplicitHeight = 352 - object Panel1: TPanel - Left = 213 - Top = 0 - Width = 127 - Height = 176 - Align = alRight - BevelEdges = [] - BevelOuter = bvNone - TabOrder = 0 - ExplicitLeft = 300 - ExplicitHeight = 352 - object btnGebruikerAfmelden: TButton - Left = 6 - Top = 6 - Width = 115 - Height = 25 - Caption = 'Afmelden' - TabOrder = 0 - OnClick = btnGebruikerAfmeldenClick - end - end - object dbgGebruikers: TDBGrid - Left = 0 - Top = 0 - Width = 213 - Height = 176 - Align = alClient - DataSource = dsGebruikers - Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit, dgMultiSelect, dgTitleClick, dgTitleHotTrack] - TabOrder = 1 - TitleFont.Charset = DEFAULT_CHARSET - TitleFont.Color = clWindowText - TitleFont.Height = -11 - TitleFont.Name = 'Tahoma' - TitleFont.Style = [] - Columns = < - item - Expanded = False - FieldName = 'cdsGebruikersInitialen' - Title.Caption = 'Initialen' - Visible = True - end - item - Expanded = False - FieldName = 'cdsGebruikersComputernaam' - Title.Caption = 'Computernaam' - Width = 150 - Visible = True - end - item - Expanded = False - FieldName = 'cdsGebruikersAangemeldSinds' - Title.Caption = 'Aangemeld sinds' - Width = 112 - Visible = True - end - item - Expanded = False - FieldName = 'cdsGebruikersLaatsteActiviteit' - Title.Caption = 'Laatste activiteit' - Width = 155 - Visible = True - end> - end - end - end object pnlLinks: TPanel Left = 0 Top = 0 Width = 185 Height = 408 Align = alLeft BevelOuter = bvNone - TabOrder = 2 + TabOrder = 1 ExplicitLeft = 8 ExplicitTop = 73 ExplicitHeight = 41 @@ -144,71 +58,86 @@ Color = 1513421 ParentBackground = False TabOrder = 1 - ExplicitLeft = 6 - ExplicitTop = 248 - ExplicitHeight = 41 end end - inline frmDnaCodes: TfrmDnaCodes - Left = 296 + object pnlFrames: TPanel + Left = 185 Top = 0 - Width = 402 + Width = 513 Height = 408 - Align = alRight - TabOrder = 3 - ExplicitLeft = 296 - ExplicitWidth = 402 - ExplicitHeight = 408 - inherited dbgDnaCodes: TDBGrid - Width = 275 - Height = 367 - end - inherited pnlActies: TPanel - Left = 275 - Height = 367 - end - inherited pnlZoekKnoppen: TPanel - Width = 402 - ExplicitWidth = 640 - end - end - object cdsGebruikers: TClientDataSet - Aggregates = <> - FieldDefs = < - item - Name = 'cdsGebruikersInitialen' - DataType = ftString - Size = 10 + Align = alClient + BevelOuter = bvNone + TabOrder = 2 + ExplicitLeft = 208 + ExplicitTop = 169 + ExplicitWidth = 185 + ExplicitHeight = 41 + object pcFrames: TPageControl + Left = 0 + Top = 0 + Width = 513 + Height = 408 + Align = alClient + TabOrder = 0 + object tsDnaCodes: TTabSheet + Caption = 'DnaCodes' + TabVisible = False + ExplicitTop = 24 + ExplicitWidth = 281 + ExplicitHeight = 165 + inline frmDnaCodes: TfrmDnaCodes + Left = 0 + Top = 0 + Width = 505 + Height = 398 + Align = alClient + TabOrder = 0 + ExplicitWidth = 281 + ExplicitHeight = 165 + inherited dbgDnaCodes: TDBGrid + Width = 378 + Height = 357 + end + inherited pnlActies: TPanel + Left = 378 + Height = 357 + ExplicitLeft = 154 + ExplicitHeight = 124 + end + inherited pnlZoekKnoppen: TPanel + Width = 505 + ExplicitWidth = 281 + end + end end - item - Name = 'cdsGebruikersComputernaam' - DataType = ftString - Size = 30 + object tsGebruikers: TTabSheet + Caption = 'Gebruikers' + ImageIndex = 1 + TabVisible = False + ExplicitTop = 24 + ExplicitWidth = 281 + ExplicitHeight = 165 + inline frmGebruikers: TfrmGebruikers + Left = 0 + Top = 0 + Width = 505 + Height = 398 + Align = alClient + TabOrder = 0 + ExplicitWidth = 513 + ExplicitHeight = 408 + inherited dbgGebruikers: TDBGrid + Width = 378 + Height = 398 + end + inherited Panel1: TPanel + Left = 378 + Height = 398 + ExplicitLeft = 386 + ExplicitHeight = 408 + end + end end - item - Name = 'cdsGebruikersAangemeldSinds' - DataType = ftString - Size = 20 - end - item - Name = 'cdsGebruikersLaatsteActiviteit' - DataType = ftString - Size = 20 - end - item - Name = 'cdsGebruikersLoginCode' - DataType = ftString - Size = 20 - end> - IndexDefs = <> - Params = <> - StoreDefs = True - Left = 120 - Top = 240 + end end - object dsGebruikers: TDataSource - DataSet = cdsGebruikers - Left = 120 - Top = 192 - end end Index: PlanScan/PlanScan.dproj =================================================================== diff -u -r348 -r349 --- PlanScan/PlanScan.dproj (.../PlanScan.dproj) (revision 348) +++ PlanScan/PlanScan.dproj (.../PlanScan.dproj) (revision 349) @@ -101,6 +101,11 @@ dfm TFrame + +
frmGebruikers
+ dfm + TFrame +
Cfg_2 Index: PlanScan/PlanScan.dproj.local =================================================================== diff -u -r348 -r349 --- PlanScan/PlanScan.dproj.local (.../PlanScan.dproj.local) (revision 348) +++ PlanScan/PlanScan.dproj.local (.../PlanScan.dproj.local) (revision 349) @@ -26,14 +26,17 @@ 2020/03/02 09:30:46.000.906,E:\svn\Delphi\PlanScan\WS\GebruikerService.pas= 2020/03/02 09:31:23.000.040,E:\svn\Delphi\PlanScan\WS\GebruikerService.pas=E:\svn\Delphi\PlanScan\WS.pas 2020/03/04 11:43:31.000.229,=E:\svn\Delphi\PlanScan\Unit1.pas - 2020/03/04 11:49:17.000.078,E:\svn\Delphi\PlanScan\UI\LoginScherm.pas=E:\svn\Delphi\PlanScan\Unit1.pas 2020/03/04 11:49:17.000.078,E:\svn\Delphi\PlanScan\UI\LoginScherm.dfm=E:\svn\Delphi\PlanScan\Unit1.dfm + 2020/03/04 11:49:17.000.078,E:\svn\Delphi\PlanScan\UI\LoginScherm.pas=E:\svn\Delphi\PlanScan\Unit1.pas 2020/04/20 08:48:05.552,=E:\svn\Delphi\PlanScan\Unit1.pas - 2020/04/20 08:48:21.787,E:\svn\Delphi\PlanScan\UI\frmDnaCodes.dfm=E:\svn\Delphi\PlanScan\Unit1.dfm 2020/04/20 08:48:21.787,E:\svn\Delphi\PlanScan\UI\frmDnaCodes.pas=E:\svn\Delphi\PlanScan\Unit1.pas - 2020/04/20 09:19:59.705,E:\svn\Delphi\PlanScan\UI\frameDnaCodes.dfm=E:\svn\Delphi\PlanScan\UI\frmDnaCodes.dfm + 2020/04/20 08:48:21.787,E:\svn\Delphi\PlanScan\UI\frmDnaCodes.dfm=E:\svn\Delphi\PlanScan\Unit1.dfm 2020/04/20 09:19:59.705,E:\svn\Delphi\PlanScan\UI\frameDnaCodes.pas=E:\svn\Delphi\PlanScan\UI\frmDnaCodes.pas + 2020/04/20 09:19:59.705,E:\svn\Delphi\PlanScan\UI\frameDnaCodes.dfm=E:\svn\Delphi\PlanScan\UI\frmDnaCodes.dfm 2020/04/20 09:21:17.241,=E:\svn\Delphi\PlanScan\Unit1.pas + 2020/04/20 10:46:18.858,=E:\svn\Delphi\PlanScan\Unit1.pas + 2020/04/20 10:49:21.229,E:\svn\Delphi\PlanScan\UI\frameGebruikers.pas=E:\svn\Delphi\PlanScan\Unit1.pas + 2020/04/20 10:49:21.229,E:\svn\Delphi\PlanScan\UI\frameGebruikers.dfm=E:\svn\Delphi\PlanScan\Unit1.dfm @@ -43,6 +46,8 @@ + + Index: PlanScan/PlanScan.dpr =================================================================== diff -u -r348 -r349 --- PlanScan/PlanScan.dpr (.../PlanScan.dpr) (revision 348) +++ PlanScan/PlanScan.dpr (.../PlanScan.dpr) (revision 349) @@ -14,7 +14,8 @@ GebruikerService in 'WS\GebruikerService.pas', LoginScherm in 'UI\LoginScherm.pas' {fmLogin}, MidasLib, - frameDnaCodes in 'UI\frameDnaCodes.pas' {frmDnaCodes: TFrame}; + frameDnaCodes in 'UI\frameDnaCodes.pas' {frmDnaCodes: TFrame}, + frameGebruikers in 'UI\frameGebruikers.pas' {frmGebruikers: TFrame}; {$R *.res} Index: PlanScan/Main.pas =================================================================== diff -u -r348 -r349 --- PlanScan/Main.pas (.../Main.pas) (revision 348) +++ PlanScan/Main.pas (.../Main.pas) (revision 349) @@ -7,32 +7,26 @@ Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Bde.DBTables, Vcl.Grids, Vcl.DBGrids, Vcl.OleCtrls, CACHEQUERYLib_TLB, TLLib_TLB, Vcl.OleServer, CacheActiveX_TLB, Vcl.StdCtrls, Datasnap.DBClient, UiContext, Vcl.ComCtrls, - DnaCodeService, Vcl.ExtCtrls, GebruikerService, frameDnaCodes; + DnaCodeService, Vcl.ExtCtrls, GebruikerService, frameDnaCodes, frameGebruikers; type TfmMain = class(TForm) CacheQuery1: TCacheQuery; - pcMain: TPageControl; - tsDnaCodes: TTabSheet; - tsGebruikers: TTabSheet; - Panel1: TPanel; - btnGebruikerAfmelden: TButton; - dbgGebruikers: TDBGrid; - cdsGebruikers: TClientDataSet; - dsGebruikers: TDataSource; - pnlLinks: TPanel; frmDnaCodes: TfrmDnaCodes; + pnlLinks: TPanel; Panel2: TPanel; pnlKnoppen: TPanel; + pnlFrames: TPanel; + frmGebruikers: TfrmGebruikers; + pcFrames: TPageControl; + tsDnaCodes: TTabSheet; + tsGebruikers: TTabSheet; procedure tsGebruikersShow(Sender: TObject); - procedure btnGebruikerAfmeldenClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); private fUiContext: TUiContext; - procedure VulGebruikersGridMetData(Gebruikers: ArrayOfGebruikerGebruiker); - procedure ZoekAlleGebruikers(); public property UiContext: TUiContext Read fUiContext Write fUiContext; end; @@ -47,30 +41,13 @@ {$R *.dfm} -procedure TfmMain.btnGebruikerAfmeldenClick(Sender: TObject); -var - rijteller: integer; -begin - if dbgGebruikers.SelectedRows.Count > 0 then begin - for rijteller := 0 to dbgGebruikers.SelectedRows.Count-1 do begin - dbgGebruikers.DataSource.DataSet.GotoBookmark(Pointer(dbgGebruikers.SelectedRows.Items[rijteller])); - if dbgGebruikers.DataSource.DataSet.FieldByName('cdsGebruikersInitialen').AsString = UiContexT.Initialen then - ShowMessage('Je kan jezelf hier niet afmelden') - else - TAgent.Create(UiContext).GebruikerAfmelden(dbgGebruikers.DataSource.DataSet.FieldByName('cdsGebruikersInitialen').AsString,dbgGebruikers.DataSource.DataSet.FieldByName('cdsGebruikersLoginCode').AsString) - end; - end; - ZoekAlleGebruikers(); -end; - procedure TfmMain.FormCreate(Sender: TObject); begin UiContext := TUiContext.Create(); if ParamStr(1) <> '' then UiContext.ServerName := Copy(ParamStr(1),Pos('=',ParamStr(1))+1,length(ParamStr(1))) else UiContext.ServerName := 'tve-w10'; - pcMain.ActivePage := tsDnaCodes; end; procedure TfmMain.FormShow(Sender: TObject); @@ -90,6 +67,7 @@ UiContext.Initialen := fLoginScherm.edtInitialen.Text; UiContext.LoginCode := fLoginScherm.edtLoginCode.Text; Self.Caption := 'PlanScan '+UiContext.Initialen; + pcFrames.ActivePageIndex := 0; end; except on E: Exception do begin @@ -113,52 +91,7 @@ begin UiContext.LoginCode := '1513'; UiContext.Initialen := 'TSN'; - ZoekAlleGebruikers(); + //ZoekAlleGebruikers(); end; -procedure TfmMain.ZoekAlleGebruikers(); -var - fZoekGebruikersResponse: ZoekGebruikersResponse; -begin - fZoekGebruikersResponse := TAgent.Create(UiContext).ZoekAlleGebruikers(); - try - if fZoekGebruikersResponse.Header.Status = '200' then begin - VulGebruikersGridMetData(fZoekGebruikersResponse.Gebruikers); - end else begin - ShowMessage(fZoekGebruikersResponse.Header.Omschrijving); - end; - finally - fZoekGebruikersResponse.Free; - end; -end; - -procedure TfmMain.VulGebruikersGridMetData(Gebruikers: ArrayOfGebruikerGebruiker); -var - ii: integer; - AangemeldSindsAsString: string; - LaatsteActiviteitAsString: string; -begin - cdsGebruikers.Close; - cdsGebruikers.CreateDataSet; - - ii := 0; - while ii <= length(Gebruikers)-1 do begin - if Gebruikers[ii].AangemeldSinds = nil then - AangemeldSindsAsString := '' - else - AangemeldSindsAsString := DateTimeToStr(Gebruikers[ii].AangemeldSinds.AsUTCDateTime); - if Gebruikers[ii].LaatsteActiviteit = nil then - LaatsteActiviteitAsString := '' - else - LaatsteActiviteitAsString := DateTimeToStr(Gebruikers[ii].LaatsteActiviteit.AsUTCDateTime); - - cdsGebruikers.InsertRecord([Gebruikers[ii].Initialen, - Gebruikers[ii].ComputerNaam, - AangemeldSindsAsString, - LaatsteActiviteitAsString, - Gebruikers[ii].LoginCode]); - ii := ii + 1; - end; -end; - end.