GpStructuredStorage file  J7  !"#$%&'()*+,-./0123456789:ABCDEFGHKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~sqli.vtd+ sqliForm.vtdsqliFormName.vtd= sqliStep.vtdssqliStepFile.vtd;GsqliStepStr.vtd<ZsqliStepStrEvent.vtd= sqliVar.vtd> sqliVer.vtd?sqliReports.vtd@="sqliTranslation.vtdIacKeyacNamed acIsDebugacType acVarInINI acAutoStart acAutoClose acEndMessageacLocalization2acFormNameAuthoracActive anVersion acLogType acInstCoded anUserChg anUserIns adTimeChg adTimeIns acIsLocalizedacRunOnInstall acRunOnUpdate acRunOnDelete anOldVersion acCryptPassacCompiledScriptacNote acAresLite acUseCompiled acAutoCompileanQIdAMC0002AMCFAFFFTRT0ƱSBBFFFFFFF acKey acFormName2 acDocType acObjectName2acType acKeyShortCut2acTabSheetName2 acFormType anUserChg anUserIns adTimeChg adTimeIns anQIdAMC0002GLAccountantControlData<>D1B$QBB$QBAMC0002PerFak<>D1xBxB acFormName2acName2anQId!acKeyanNoacViewacSetOfacDescracReportacFileCreateTableanFileDelimiter acFileNameacFileTableName acFileDest acFileType acFileTypeXML acShowIfEmptyacTitleButtons anTitleLinesanBeginFromRecord anUserChg anUserIns adTimeChg adTimeIns acCharSet2 acStyleSheet acUnitNamed acNewThreadacDFMacPAS acSQLExport2acSQLExpacNoteacPCU acCompiledanQId AMC0002GPFAENF#QBB windows-1250 AresProjectFprogram AresProject; uses SysUtils, Classes, Forms, Dialogs, DB, dlDatabase, dlComponents, FForm2, controls; var pgcPageControl: TdlcxPageControl; tab : TdlcxTabSheet; begin //Database work Ares.ExecuteStep(2); Ares.ExecuteStep(3); Ares.ExecuteStep(4); Ares.ExecuteStep(6); Ares.ExecuteStep(7); //Adds new tab if OwnerForm.ClassName = 'TPerFak' then begin AresFindComponent(pgcPageControl, 'pgcDetails', OwnerForm); tab:= TdlcxTabSheet.Create(OwnerForm); tab.name:= 'pcgAMC'; tab.Caption:= 'Accounting management console'; tab.Parent:= pgcPageControl; tab.PageIndex:= 2; //Adds columns to grids Common.AddColumnToGridHeader; Common.AddColumnToGridPos; end else if OwnerForm.ClassName = 'TGLAccountantControlData' then begin AresFindComponent(pgcPageControl, 'PageControl', OwnerForm); tab:= TdlcxTabSheet.Create(OwnerForm); tab.name:= 'pcgAMC'; tab.Caption:= 'Accounting management console'; tab.Parent:= pgcPageControl; tab.PageIndex:= 10; end; //Add components on new tab with TForm2.create(ares) do begin pPanel.Parent := TWinControl(OwnerForm.FindComponent('pcgAMC')); end; end. 1#AMC0002GUFAENFQB B windows-1250CommonF unit Common; interface uses dlComponents, Windows, cxGrid, dlDataBase, db, dlGLCommon, cxImageComboBox; implementation procedure AddColumnToGridHeader; var View: TcxGridDBTableView; DS2: TdlDataSet; TDS2: TDataSource; Column: TcxGridDBColumn; Props: TcxLookupComboBoxProperties; begin AresFindComponent(View, 'gPerFak_View', OwnerForm); // create new dataset as lookup source for new column, just to show functionality // not really usable DS2 := TdlDataSet.Create(Ares); DS2.SQL.Text := 'select acDBName from tPA_SysDatabases order by acDBName asc'; DS2.Open; // connect newly created dataset to new datasource TDS2 := TDataSource.Create(Ares); TDS2.DataSet := DS2; // create new column Column := View.CreateColumn; Column.Name := 'uacDBName'; Column.Caption := 'DB'; Column.Width := 170; Column.DataBinding.FieldName := 'uacDBName'; Column.PropertiesClassName := 'TcxLookupComboBoxProperties'; Props := TcxLookupComboBoxProperties(Column.Properties); Props.ListFieldNames := 'acDBName'; Props.KeyFieldNames := 'acDBName'; Props.ListSource := TDS2; end; procedure AddColumnToGridPos; var View: TcxGridDBTableView; DS2: TdlDataSet; TDS2: TDataSource; Column: TcxGridDBColumn; Props: TcxLookupComboBoxProperties; Items: TcxImageComboBoxItems; Item: TcxImageComboBoxItem; begin AresFindComponent(View, 'gPerFakPoz_View', OwnerForm); // create new column Column := View.CreateColumn; Column.Name := 'uacSQLFind'; Column.Caption := 'Formula'; Column.Width := 170; Column.DataBinding.FieldName := 'uacSQLFind'; Column.PropertiesClassName := 'TdlcxImageComboBoxProperties'; DS2 := TdlDataset.Create(Nil); DS2.SQL.Text := 'Select U.anID, (convert(varchar, U.anID) + '' - '' + I.acDescr) as acDesc from uCriteria U left join tPA_SysIrisItem I on I.ANHELPCONTEXT = u.anHelpContext and i.ANNO = U.anNo join tPA_SysParamSys P on P.acLocalization = I.ACLANGID order by U.anID asc'; DS2.Open; Props := TdlcxImageComboBoxProperties(Column.Properties); While not DS2.EOF do begin Item:=TdlcxImageComboBoxProperties(Props).Items.Add; Item.Value := DS2.FieldByName('anID').asInteger; Item.Description:= DS2.FieldByName('acDesc').asString; DS2.Next; end; DS2.Free; end; end. 2#AMC0002GMFAENFܖQBA&B windows-12502FBIf OBJECT_ID('_DE_PeriodAMC') is not null drop procedure _DE_PeriodAMC -- Temp tables If Object_ID('uDBs') is null Create table uDBs (acMarked char(1), acDBName varchar(100)) If Object_ID('uCriteria') is null Create table uCriteria (anID integer identity, acMarked char(1), acTable varchar(100), acDateFrom varchar(100), acDateTo varchar(100), acNote varchar(max), acCrit varchar(max)) If Object_ID('uUsers') is null Create table uUsers (acMarked char(1), anUserID integer, acUserID varchar(10)) -- add columns if not exists (select * from information_schema.columns where table_name='tHE_MovePerInv' and column_name='uacDBName' and TABLE_CATALOG = DB_NAME()) begin alter table tHE_MovePerInv add uacDBName varchar(100) end if not exists (select * from information_schema.columns where table_name='uCriteria' and column_name='anHelpContext' and TABLE_CATALOG = DB_NAME()) begin alter table uCriteria add anHelpContext integer end if not exists (select * from information_schema.columns where table_name='uCriteria' and column_name='anNo' and TABLE_CATALOG = DB_NAME()) begin alter table uCriteria add anNo integer end if not exists (select * from information_schema.columns where table_name='tHE_MovePerInvItem' and column_name='uacSQLFind' and TABLE_CATALOG = DB_NAME()) begin alter table tHE_MovePerInvItem add uacSQLFind Integer not null default 0 end -- Fill data to tables Insert into uDBs(acMarked, acDBName) select 'T', acDBName from tPA_SysDatabases where acDBName not in (select acDBName from uDBs) Delete from uDBs where acDBName not in (select acDBName from tPA_SysDatabases) Insert into uUsers(acMarked, anUserId, acUserId) select 'T', anUserID, acUserID from tPA_User where anUserId not in (Select anUserId from uUsers) if not exists (select 1 from uCriteria where acTable = 'vHE_GLPostings' and acDateFrom = 'adDateOfEntry') begin Insert into uCriteria (acMarked, acTable, acDateFrom, acDateTo, acNote, anHelpContext, anNo) values ('T', 'vHE_GLPostings', 'adDateOfEntry', 'adDateOfEntry', 'tevilo knjib v obdobju', 8382, 43) end if not exists (select 1 from uCriteria where acTable = 'tHR_SlryCalcJob' and acDateFrom = 'adDate') begin Insert into uCriteria (acMarked, acTable, acDateFrom, acDateTo, acNote, anHelpContext, anNo) values ('T', 'tHR_SlryCalcJob', 'adDate', 'adDate', 'tevilo pla v obdobju', 8382, 45) end if not exists (select 1 from uCriteria where acTable = 'tHR_Trvl' and acDateFrom = 'adDateCalc') begin Insert into uCriteria (acMarked, acTable, acDateFrom, acDateTo, acNote, anHelpContext, anNo) values ('T', 'tHR_Trvl', 'adDateCalc', 'adDateCalc', 'tevilo potnih nalogov v obdobju', 8382, 48) end if not exists (select 1 from uCriteria where acTable = 'vHE_Move' and acDateFrom = 'adDate' and acCrit = 'and acDocType in (Select acDocType from tPA_SetDocType where acType = ''I'')') begin Insert into uCriteria (acMarked, acTable, acDateFrom, acDateTo, acNote, acCrit, anHelpContext, anNo) values ('T', 'vHE_Move', 'adDate', 'adDate', 'tevilo izdanih raunov v obdobju', 'and acDocType in (Select acDocType from tPA_SetDocType where acType = ''I'')', 8382, 51) end if not exists (select 1 from uCriteria where acTable = 'vHE_Move' and acDateFrom = 'adDate' and acCrit = 'and acDocType in (Select acDocType from tPA_SetDocType where acType = ''P'')') begin Insert into uCriteria (acMarked, acTable, acDateFrom, acDateTo, acNote, acCrit, anHelpContext, anNo) values ('T', 'vHE_Move', 'adDate', 'adDate', 'tevilo prejetih raunov v obdobju', 'and acDocType in (Select acDocType from tPA_SetDocType where acType = ''P'')', 8382, 54) end if not exists (select 1 from uCriteria where acTable = 'tHE_VATCalc' and acDateFrom = 'adDate') begin Insert into uCriteria (acMarked, acTable, acDateFrom, acDateTo, acNote, anHelpContext, anNo) values ('T', 'tHE_VATCalc', 'adDate', 'adDate', 'tevilo obraunov DDV v obdobju', 8382, 56) end if not exists (select 1 from uCriteria where acTable = 'tHE_Chronos' and acDateFrom = 'adBegin') begin Insert into uCriteria (acMarked, acTable, acDateFrom, acDateTo, acNote, anHelpContext, anNo) values ('T', 'tHE_Chronos', 'adBegin', 'adBegin', 'tevilo klicev v izterjavi v obdobju', 8382, 58) end 3#AMC0002GMFAENFSBB windows-12503FCREATE procedure [dbo].[_DE_PeriodAMC] ( @p_cDBName Varchar(max), @p_nType integer, @p_dDateFrom DateTime = '19000101', @p_dDateTo DateTime = '20500101', @p_nQty Float output, @p_cNote Varchar(Max) output ) as set nocount off If OBJECT_ID('tempdb..#tmpBases') is not null Drop table #tmpBases If OBJECT_ID('tempdb..##AMCReport') is not null Drop table ##AMCReport If OBJECT_ID('tempdb..#tmpUsers') is not null Drop table #tmpUsers Create table #tmpBases (RowNo integer identity, DB varchar(50)) Create table #tmpUsers (anUserID integer, acUserID varchar(10)) Create table ##AMCReport (anUserID integer, acUserID varchar(10), acDBName varchar(100), acNote varchar(max), anType integer, anQtY Float, adDateFrom datetime, adDateTo datetime) Declare @cSQL Varchar(Max), @cUsers Varchar(max), @dDateFrom Char(8), @dDateTo Char(8), @ii integer, @jj integer, @kk integer, @cTable Varchar(100), @cDateNameFrom varchar(30), @cDateNameTo varchar(30), @cMarked char(1), @cTempDB varchar(50), @cTempDBDesc varchar(50), @cCriteria varchar(max) select @dDateFrom = convert(char(8), @p_dDateFrom, 112), @dDateTo = convert(char(8), @p_dDateTo, 112) if @p_cDBName = '' begin insert into #tmpBases (DB) Select acDBName from uDBs where acmarked = 'T' and acDBName in (Select acDBName from tPA_SysDatabases) Set @kk = (Select count(*) from #tmpBases) end else begin insert into #tmpBases (DB) values (@p_cDBName) set @kk = 1 end While @kk > 0 begin select @cTempDBDesc = DB from #tmpBases where RowNo = @kk select @cTempDB = '[' + DB + ']' from #tmpBases where RowNo = @kk --Paring users in different dabases If OBJECT_ID('LinkUsers') is not null drop synonym LinkUsers set @cSQL = 'CREATE SYNONYM LinkUsers FOR ' + @cTempDB + '.dbo.tPA_User' exec(@cSQL) truncate table #tmpUsers Insert into #tmpUsers(anUserID, acUserID) Select T.anUserId, U.acUserID from uUsers U inner join LinkUsers T on T.acUserId = U.acUserID where U.acMarked = 'T' Select @cUsers = COALESCE(@cUsers + ', ', '') + convert(varchar, anUserID) from #tmpUsers if @cTempDB <> '' begin Set @ii = @p_nType Set @jj = @p_nType if @p_nType = -1 begin Set @ii = 1 Set @jj = (Select MAX(anID) from uCriteria) end While @ii <= @jj begin Select @cMarked = U.acMarked, @cTable = U.acTable, @cDateNameFrom = U.acDateFrom, @cDateNameTo = U.acDateTo, @p_cNote = I.ACDESCR, @cCriteria = isnull(U.acCrit, '') from uCriteria U left join tPA_SysIrisItem I on I.ANHELPCONTEXT = u.anHelpContext and i.ANNO = U.anNo join tPA_SysParamSys P on P.acLocalization = I.ACLANGID where U.anId = @ii if @cMarked = 'T' begin If OBJECT_ID('LinkTable') is not null drop synonym LinkTable set @cSQL = 'CREATE SYNONYM LinkTable FOR ' + @cTempDB + '.dbo.' + @cTable exec(@cSQL) Set @cSQL = 'insert into ##AMCReport(anUserID, acUserID, acDBName, anType, acNote, anQtY) ' Set @cSQL = @cSQL + 'Select anUserIns, (Select acUserID from #tmpUsers where anUserID = L.anUserIns) as acUserID, ''' + @cTempDBDesc + ''', ''' + convert(varchar, @p_nType) + ''', ''' + @p_cNote + ''', count(*) as anQty from LinkTable L where ' + @cDateNameFrom + ' >= ''' + convert(varchar, @p_dDateFrom, 112) + ''' and ' + @cDateNameTo + ' <= ''' + convert(varchar, @p_dDateTo, 112) + ''' and (anUserIns in (Select acItem from dbo.fPA_SplitString(''' + @cUsers + ''', '','') where acItem <> '''')) ' + @cCriteria + ' group by anUserIns' exec(@cSQL) end Set @ii = @ii + 1 end end Set @kk = @kk - 1 End Update ##AMCReport set adDateFrom = @p_dDateFrom, adDateTo = @p_dDateTo Select @p_nQtY = sum(anQtY) from ##AMCReport where anType = @p_nType 4#AMC0002GMFAENFLuB`*uB windows-12504Fb-- alter views alter view vHE_MovePerInv as select G.acKey, G.acDocType, G.adDate, G.acSubject, G.acType, G.anPeriodical, G.anInstalmentNo, G.adDateEnd, G.acPriceCalcMethod, G.adDateLastInv, G.acActive, G.acDocTypeInvo, G.acCurrency, G.adTimeChg, G.adTimeIns, G.anUserChg, G.anUserIns, G.acPerInvType, G.anSeqNo, G.acSubjType, G.acContractNo, dbo.fPA_KeyRet(G.acKey, P.anDocKeyLenYear, P.anDocKeyLenDocType, P.anDocKeyLenNumber) as acKeyView, S.acName2 as acSubjectName2, uacDBName from tHE_MovePerInv G left join tHE_SetSubj S on G.acSubject = S.acSubject , tPA_SysParam P 5#AMC0002GRA03FAENF;B_RzB windows-1250PRN_1FSelect R.*, (Rtrim(Ltrim(U.acUserID)) + ' ' + LTrim(Rtrim(U.acWorker))) as acWorker from ##AMCReport R join vPA_SysUsersSelect U on R.anUserId = U.anUserId6#AMC0002GMFAENF#BhVB windows-12506FFIf object_id('_DBFields') is not null drop function dbo._DBFields 7#AMC0002GMFAENFoEBB windows-12507Fcreate function [dbo].[_DBFields]( @p_nType integer ) returns varchar(max) as begin declare @cFields varchar(max) if @p_nType = 1 begin Select @cFields = COALESCE(@cFields + ', ', '') + acDBName from uDBs where acMarked = 'T' end if @p_nType = 2 begin Select @cFields = COALESCE(@cFields + ', ', '') + U2.acWorker from uUsers U1 join vPA_SysUsersSelect U2 on U1.anUserID = U2.anUserId where U1.acMarked = 'T' end if @p_nType = 3 begin Select @cFields = COALESCE(@cFields + ', ', '') + acNote from uCriteria where acMarked = 'T' end return (isnull(@cFields, '')) end 8#AMC0002GFFAENF?!QBbB windows-1250FForm2FtUobject Form2: TForm Tag = 99 Left = 207 Top = 242 Caption = 'Form2' ClientHeight = 746 ClientWidth = 1520 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False PopupMenu = PopupMenu2 Position = poDesigned WindowState = wsMaximized PixelsPerInch = 96 TextHeight = 13 object pPanel: TdlcxPanel Left = 0 Top = 0 Width = 1520 Height = 746 Align = alClient TabOrder = 0 ExplicitLeft = 503 ExplicitTop = 192 ExplicitWidth = 185 ExplicitHeight = 41 object dlcxPanel1: TdlcxPanel Left = 286 Top = 0 Width = 1234 Height = 746 Align = alClient TabOrder = 0 object cxGrid1: TcxGrid Left = 0 Top = 0 Width = 1234 Height = 746 Align = alClient TabOrder = 0 object cxGrid1DBTableView1: TcxGridDBTableView NavigatorButtons.ConfirmDelete = False NavigatorButtons.First.Visible = True NavigatorButtons.PriorPage.Visible = True NavigatorButtons.Prior.Visible = True NavigatorButtons.Next.Visible = True NavigatorButtons.NextPage.Visible = True NavigatorButtons.Last.Visible = True NavigatorButtons.Insert.Visible = True NavigatorButtons.Append.Visible = False NavigatorButtons.Delete.Visible = True NavigatorButtons.Edit.Visible = True NavigatorButtons.Post.Visible = True NavigatorButtons.Cancel.Visible = True NavigatorButtons.Refresh.Visible = True NavigatorButtons.SaveBookmark.Visible = True NavigatorButtons.GotoBookmark.Visible = True NavigatorButtons.Filter.Visible = True DataController.DataSource = DataSource1 DataController.Summary.DefaultGroupSummaryItems = <> DataController.Summary.FooterSummaryItems = <> DataController.Summary.SummaryGroups = <> OptionsView.GroupByBox = False object cxGrid1DBTableView1Column1: TcxGridDBColumn Caption = 'User' DataBinding.FieldName = 'acWorker' Width = 143 end object cxGrid1DBTableView1Column4: TcxGridDBColumn Caption = 'DB' DataBinding.FieldName = 'acDBName' Width = 168 end object cxGrid1DBTableView1Column2: TcxGridDBColumn Caption = 'Note' DataBinding.FieldName = 'acNote' Width = 251 end object cxGrid1DBTableView1Column3: TcxGridDBColumn Caption = 'Qty' DataBinding.FieldName = 'anQty' Width = 147 end end object cxGrid1Level1: TcxGridLevel GridView = cxGrid1DBTableView1 end end end object dlcxPanel2: TdlcxPanel Left = 0 Top = 0 Width = 286 Height = 746 Align = alLeft TabOrder = 1 ExplicitLeft = 38 ExplicitTop = 98 ExplicitWidth = 185 ExplicitHeight = 206 object dlcxPanel3: TdlcxPanel Left = 0 Top = 151 Width = 286 Height = 554 Align = alClient TabOrder = 0 ExplicitTop = 150 ExplicitHeight = 447 object dlcxPageControl1: TdlcxPageControl Left = 0 Top = 0 Width = 286 Height = 554 ActivePage = dlcxTabSheet3 Align = alClient Style = 15 TabOrder = 0 ShowMinimizeButton = False Minimized = False ExplicitLeft = 56 ExplicitTop = 40 ExplicitWidth = 289 ExplicitHeight = 193 ClientRectBottom = 554 ClientRectRight = 286 ClientRectTop = 19 object dlcxTabSheet1: TdlcxTabSheet Caption = 'DB' Color = 15131095 ImageIndex = 0 ParentColor = False object dlcxPanel5: TdlcxPanel Left = 2 Top = 5 Width = 282 Height = 528 Align = alClient TabOrder = 0 object cxGrid2: TcxGrid Left = 0 Top = 0 Width = 282 Height = 528 Align = alClient PopupMenu = PopupMenu1 TabOrder = 0 object cxGrid2DBTableView1: TcxGridDBTableView PopupMenu = PopupMenu1 NavigatorButtons.ConfirmDelete = False NavigatorButtons.First.Visible = True NavigatorButtons.PriorPage.Visible = True NavigatorButtons.Prior.Visible = True NavigatorButtons.Next.Visible = True NavigatorButtons.NextPage.Visible = True NavigatorButtons.Last.Visible = True NavigatorButtons.Insert.Visible = True NavigatorButtons.Append.Visible = False NavigatorButtons.Delete.Visible = True NavigatorButtons.Edit.Visible = True NavigatorButtons.Post.Visible = True NavigatorButtons.Cancel.Visible = True NavigatorButtons.Refresh.Visible = True NavigatorButtons.SaveBookmark.Visible = True NavigatorButtons.GotoBookmark.Visible = True NavigatorButtons.Filter.Visible = True DataController.DataSource = DataSource2 DataController.Summary.DefaultGroupSummaryItems = <> DataController.Summary.FooterSummaryItems = <> DataController.Summary.SummaryGroups = <> OptionsView.GroupByBox = False object cxGrid2DBTableView1Column1: TcxGridDBColumn Caption = 'Sel.' DataBinding.FieldName = 'acMarked' PropertiesClassName = 'TdlcxCustomCheckBoxProperties' Properties.ValueChecked = 'T' Properties.ValueUnchecked = 'F' end object cxGrid2DBTableView1Column2: TcxGridDBColumn Caption = 'DB' DataBinding.FieldName = 'acDBName' Width = 217 end end object cxGrid2Level1: TcxGridLevel GridView = cxGrid2DBTableView1 end end end end object dlcxTabSheet2: TdlcxTabSheet Caption = 'Users' Color = 15131095 ImageIndex = 1 ParentColor = False object dlcxPanel6: TdlcxPanel Left = 2 Top = 5 Width = 282 Height = 528 Align = alClient TabOrder = 0 object cxGrid3: TcxGrid Left = 0 Top = 0 Width = 282 Height = 528 Align = alClient TabOrder = 0 object cxGrid3DBTableView1: TcxGridDBTableView PopupMenu = PopupMenu2 NavigatorButtons.ConfirmDelete = False NavigatorButtons.First.Visible = True NavigatorButtons.PriorPage.Visible = True NavigatorButtons.Prior.Visible = True NavigatorButtons.Next.Visible = True NavigatorButtons.NextPage.Visible = True NavigatorButtons.Last.Visible = True NavigatorButtons.Insert.Visible = True NavigatorButtons.Append.Visible = False NavigatorButtons.Delete.Visible = True NavigatorButtons.Edit.Visible = True NavigatorButtons.Post.Visible = True NavigatorButtons.Cancel.Visible = True NavigatorButtons.Refresh.Visible = True NavigatorButtons.SaveBookmark.Visible = True NavigatorButtons.GotoBookmark.Visible = True NavigatorButtons.Filter.Visible = True DataController.DataSource = DataSource3 DataController.Summary.DefaultGroupSummaryItems = <> DataController.Summary.FooterSummaryItems = <> DataController.Summary.SummaryGroups = <> OptionsView.GroupByBox = False object cxGrid3DBTableView1Column1: TcxGridDBColumn Caption = 'Sel' DataBinding.FieldName = 'acMarked' PropertiesClassName = 'TdlcxCustomCheckBoxProperties' Properties.ValueChecked = 'T' Properties.ValueUnchecked = 'F' end object cxGrid3DBTableView1Column2: TcxGridDBColumn Caption = 'ID' DataBinding.FieldName = 'anUserID' Width = 107 end object cxGrid3DBTableView1Column3: TcxGridDBColumn Caption = 'User' DataBinding.FieldName = 'acUserID' Width = 101 end end object cxGrid3Level1: TcxGridLevel GridView = cxGrid3DBTableView1 end end end end object dlcxTabSheet3: TdlcxTabSheet Caption = 'Criteria' Color = 15131095 ImageIndex = 2 ParentColor = False object dlcxPanel7: TdlcxPanel Left = 2 Top = 5 Width = 282 Height = 528 Align = alClient TabOrder = 0 object cxGrid4: TcxGrid Left = 0 Top = 0 Width = 282 Height = 528 Align = alClient TabOrder = 0 object cxGrid4DBTableView1: TcxGridDBTableView NavigatorButtons.ConfirmDelete = False NavigatorButtons.First.Visible = True NavigatorButtons.PriorPage.Visible = True NavigatorButtons.Prior.Visible = True NavigatorButtons.Next.Visible = True NavigatorButtons.NextPage.Visible = True NavigatorButtons.Last.Visible = True NavigatorButtons.Insert.Visible = True NavigatorButtons.Append.Visible = False NavigatorButtons.Delete.Visible = True NavigatorButtons.Edit.Visible = True NavigatorButtons.Post.Visible = True NavigatorButtons.Cancel.Visible = True NavigatorButtons.Refresh.Visible = True NavigatorButtons.SaveBookmark.Visible = True NavigatorButtons.GotoBookmark.Visible = True NavigatorButtons.Filter.Visible = True DataController.DataSource = DataSource4 DataController.Summary.DefaultGroupSummaryItems = <> DataController.Summary.FooterSummaryItems = <> DataController.Summary.SummaryGroups = <> OptionsView.GroupByBox = False object cxGrid4DBTableView1Column1: TcxGridDBColumn Caption = 'Sel.' DataBinding.FieldName = 'acMarked' PropertiesClassName = 'TdlcxCustomCheckBoxProperties' Properties.ValueChecked = 'T' Properties.ValueUnchecked = 'F' end object cxGrid4DBTableView1Column2: TcxGridDBColumn Caption = 'Table' DataBinding.FieldName = 'acTable' end object cxGrid4DBTableView1Column3: TcxGridDBColumn Caption = 'Date from' DataBinding.FieldName = 'acDateFrom' end object cxGrid4DBTableView1Column4: TcxGridDBColumn Caption = 'Date to' DataBinding.FieldName = 'acDateTo' end object cxGrid4DBTableView1Column5: TcxGridDBColumn Caption = 'Note' DataBinding.FieldName = 'acNote' end object cxGrid4DBTableView1Column6: TcxGridDBColumn Caption = 'Add. criteria' DataBinding.FieldName = 'acCrit' end end object cxGrid4Level1: TcxGridLevel GridView = cxGrid4DBTableView1 end end end end end end object dlcxPanel4: TdlcxPanel Left = 0 Top = 0 Width = 286 Height = 151 Align = alTop TabOrder = 1 object dDateFrom: TdlcxLabeledDateEdit Left = 124 Top = 5 AutoSize = False Properties.ReadOnly = False Properties.WeekNumbers = True TabOrder = 0 LabelPosition = lpoLeft LabelSpacing = 3 LabelVisible = True EditLabel.Left = 73 EditLabel.Top = 7 EditLabel.Width = 48 EditLabel.Height = 13 EditLabel.Caption = 'Date from' EditLabel.FocusControl = dDateFrom EditLabel.Transparent = True ComponentSize = csSmall Caption = 'Date from' Templatable = False ReadOnly = False DropDownButtonWidth = 0 Height = 18 Width = 142 end object dDateTo: TdlcxLabeledDateEdit Left = 124 Top = 27 AutoSize = False Properties.ReadOnly = False Properties.WeekNumbers = True TabOrder = 1 LabelPosition = lpoLeft LabelSpacing = 3 LabelVisible = True EditLabel.Left = 85 EditLabel.Top = 29 EditLabel.Width = 36 EditLabel.Height = 13 EditLabel.Caption = 'Date to' EditLabel.FocusControl = dDateFrom EditLabel.Transparent = True ComponentSize = csSmall Caption = 'Date to' Templatable = False ReadOnly = False DropDownButtonWidth = 0 Height = 18 Width = 142 end object bZberiVse: TdlcxButton Left = 124 Top = 85 Width = 142 Height = 25 Caption = 'Collect all' TabOrder = 2 end object bPripravi: TdlcxButton Left = 124 Top = 55 Width = 142 Height = 25 Caption = 'Collect' TabOrder = 3 end object bTiskaj: TdlcxButton Left = 124 Top = 117 Width = 143 Height = 25 Caption = 'Print' TabOrder = 4 PopUpMenu = PopupMenu3 end end object dlcxPanel8: TdlcxPanel Left = 0 Top = 705 Width = 286 Height = 41 Align = alBottom TabOrder = 2 ExplicitLeft = 75 ExplicitTop = 113 ExplicitWidth = 185 object fPath: TdlcxLabeledOpenDialogEdit Left = 77 Top = 7 AutoSize = False Properties.Buttons = < item Default = True Kind = bkEllipsis end> Properties.ReadOnly = False TabOrder = 0 Text = 'c:\izvoz.xls' LabelPosition = lpoLeft LabelSpacing = 3 LabelVisible = True EditLabel.Left = 13 EditLabel.Top = 10 EditLabel.Width = 61 EditLabel.Height = 13 EditLabel.Caption = 'Shrani XML v' EditLabel.FocusControl = fPath EditLabel.Transparent = True ComponentSize = csSmall Templatable = False Caption = 'Shrani XML v' ReadOnly = False DialogType = dlcxdtOpenFile Height = 19 Width = 204 end end end end object _evsaver: TEventCom events = 'bTiskaj.OnClick=bTiskajClick'#13#10'MenuItem4.OnClick=MenuItem4Click'#13#10 + 'MenuItem5.OnClick=MenuItem5Click'#13#10'MenuItem7.OnClick=MenuItem7Cli' + 'ck'#13#10 end object DataSource1: TDataSource DataSet = dlDataset1 Left = 592 Top = 140 end object dlDataset1: TdlDataset SQL.Strings = ( 'Select R.*, (Rtrim(Ltrim(U.acUserID)) + '#39' '#39' + LTrim(Rtrim(U.acWo' + 'rker))) as acWorker from ##AMCReport R join vPA_SysUsersSelect U' + ' on R.acUserId = U.acUserId') FieldNamesToUpperCase = False AutoCalcFields = False Cached = False LocateInsert = False Editable = True RequestLive = False QueryRecCount = False DetailDelay = 0 LocalMasterDetail = False StrictUpdate = False TrimFixedChar = True TrimVarChar = True ORACompatibility = False Left = 560 Top = 140 end object dlDataset2: TdlDataset SQL.Strings = ( 'Select * from uDBs') FieldNamesToUpperCase = False Active = True AutoCalcFields = False Cached = False LocateInsert = False Editable = True RequestLive = False QueryRecCount = False DetailDelay = 0 LocalMasterDetail = False StrictUpdate = False TrimFixedChar = True TrimVarChar = True ORACompatibility = False Left = 181 Top = 282 end object DataSource2: TDataSource DataSet = dlDataset2 Left = 214 Top = 280 end object dlDataset3: TdlDataset SQL.Strings = ( 'Select * from uUsers') FieldNamesToUpperCase = False Active = True AutoCalcFields = False Cached = False LocateInsert = False Editable = True RequestLive = False QueryRecCount = False DetailDelay = 0 LocalMasterDetail = False StrictUpdate = False TrimFixedChar = True TrimVarChar = True ORACompatibility = False Left = 181 Top = 317 end object DataSource3: TDataSource DataSet = dlDataset3 Left = 213 Top = 317 end object PopupMenu1: TPopupMenu Left = 326 Top = 271 object MenuItem1: TMenuItem Caption = 'Select all' end object MenuItem2: TMenuItem Caption = 'Deselect all' end end object PopupMenu2: TPopupMenu Left = 400 Top = 208 object MenuItem3: TMenuItem Caption = 'Select all' end object MenuItem4: TMenuItem Caption = 'Deselect all' end object MenuItem6: TMenuItem Caption = '-' end object MenuItem7: TMenuItem Caption = 'Ozna'#269'i samo aktivne' end end object dlDataset4: TdlDataset SQL.Strings = ( 'select U.anID, U.acMarked, U.acTable, U.acDateFrom, U.acDateTo, ' + 'I.ACDESCR as acNote, U.acCrit from uCriteria U join tPA_SysIrisI' + 'tem I on I.ANHELPCONTEXT = u.anHelpContext and i.ANNO = U.anNo j' + 'oin tPA_SysParamSys P on P.acLocalization = I.ACLANGID ') FieldNamesToUpperCase = False Active = True AutoCalcFields = False Cached = False LocateInsert = False Editable = True RequestLive = False QueryRecCount = False DetailDelay = 0 LocalMasterDetail = False StrictUpdate = False TrimFixedChar = True TrimVarChar = True ORACompatibility = False Left = 181 Top = 356 end object DataSource4: TDataSource DataSet = dlDataset4 Left = 214 Top = 355 end object PopupMenu3: TPopupMenu Left = 355 Top = 391 object MenuItem5: TMenuItem Caption = 'Izvoz v Excel' end end object sme: TSMEWizardDlg AnimatedStatus = True DataFormats.DateOrder = doDMY DataFormats.DateSeparator = '.' DataFormats.TimeSeparator = ':' DataFormats.FourDigitYear = True DataFormats.LeadingZerosInDate = False DataFormats.ThousandSeparator = '.' DataFormats.DecimalSeparator = ',' DataFormats.CurrencyString = #8364 DataFormats.BooleanTrue = 'True' DataFormats.BooleanFalse = 'False' DataFormats.UseRegionalSettings = False KeyGenerator = 'SMExport 4.77' SelectedRecord = False BlankIfZero = False RightToLeft = False Statistic.TotalCount = 0 Statistic.Result = erInProgress Columns = <> Bands = <> ColumnSource = csDBGrid Formats = [teParadox, teDBase, teText, teHTML, teXLS, teExcel, teWord, teSYLK, teDIF, teWKS, teQuattro, teSQL, teXML, teAccess, teClipboard, teRTF, teSPSS, tePDF, teLDIF, teADO] RecordSeparator = #13#10 Fixed = False TableType = teText FileName = 'D:\Dokumenti\Datalab\MSSQL\SMExport.TXT' AddTitle = False CharacterSet = csANSI_WINDOWS ExportStyle.Style = esNormal ExportStyle.OddColor = clBlack ExportStyle.EvenColor = clBlack UserAccess.Specification = True Left = 56 Top = 306 end end 8unit FForm2; interface uses Forms, Controls, StdCtrls, SysUtils, Classes, Graphics, dlComponents, Dialogs, cxGrid, dlDatabase, db, Variants, Menus, ImportExport; type TForm2 = class(TarForm) pPanel: TdlcxPanel; dlcxPanel1: TdlcxPanel; cxGrid1: TcxGrid; cxGrid1DBTableView1: TcxGridDBTableView; cxGrid1Level1: TcxGridLevel; cxGrid1DBTableView1Column2: TcxGridDBColumn; cxGrid1DBTableView1Column3: TcxGridDBColumn; DataSource1: TDataSource; dlDataset1: TdlDataset; dlcxPanel2: TdlcxPanel; dlcxPanel3: TdlcxPanel; dlDataset2: TdlDataset; DataSource2: TDataSource; dlcxPanel4: TdlcxPanel; dDateFrom: TdlcxLabeledDateEdit; dDateTo: TdlcxLabeledDateEdit; bZberiVse: TdlcxButton; cxGrid1DBTableView1Column4: TcxGridDBColumn; cxGrid1DBTableView1Column1: TcxGridDBColumn; bPripravi: TdlcxButton; dlcxPageControl1: TdlcxPageControl; dlcxTabSheet1: TdlcxTabSheet; dlcxTabSheet2: TdlcxTabSheet; dlcxPanel5: TdlcxPanel; cxGrid2: TcxGrid; cxGrid2DBTableView1: TcxGridDBTableView; cxGrid2Level1: TcxGridLevel; cxGrid2DBTableView1Column1: TcxGridDBColumn; cxGrid2DBTableView1Column2: TcxGridDBColumn; dlcxPanel6: TdlcxPanel; cxGrid3: TcxGrid; cxGrid3DBTableView1: TcxGridDBTableView; cxGrid3Level1: TcxGridLevel; cxGrid3DBTableView1Column1: TcxGridDBColumn; cxGrid3DBTableView1Column2: TcxGridDBColumn; cxGrid3DBTableView1Column3: TcxGridDBColumn; dlDataset3: TdlDataset; DataSource3: TDataSource; PopupMenu1: TPopupMenu; MenuItem1: TMenuItem; MenuItem2: TMenuItem; PopupMenu2: TPopupMenu; MenuItem3: TMenuItem; MenuItem4: TMenuItem; dlcxTabSheet3: TdlcxTabSheet; dlcxPanel7: TdlcxPanel; cxGrid4: TcxGrid; cxGrid4DBTableView1: TcxGridDBTableView; cxGrid4Level1: TcxGridLevel; cxGrid4DBTableView1Column1: TcxGridDBColumn; cxGrid4DBTableView1Column2: TcxGridDBColumn; cxGrid4DBTableView1Column3: TcxGridDBColumn; cxGrid4DBTableView1Column4: TcxGridDBColumn; dlDataset4: TdlDataset; DataSource4: TDataSource; cxGrid4DBTableView1Column5: TcxGridDBColumn; cxGrid4DBTableView1Column6: TcxGridDBColumn; bTiskaj: TdlcxButton; PopupMenu3: TPopupMenu; MenuItem5: TMenuItem; sme: TSMEWizardDlg; dlcxPanel8: TdlcxPanel; fPath: TdlcxLabeledOpenDialogEdit; MenuItem6: TMenuItem; MenuItem7: TMenuItem; procedure MenuItem7Click(Sender: TObject); procedure MenuItem5Click(Sender: TObject); procedure bTiskajClick(Sender: TObject); procedure MenuItem3Click(Sender: TObject); procedure MenuItem4Click(Sender: TObject); procedure MenuItem2Click(Sender: TObject); procedure MenuItem1Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bPripraviClick(Sender: TObject); procedure bZberiVseClick(Sender: TObject); private public constructor Create(AOwner: TComponent); override; end; var Form2: TForm2; implementation constructor TForm2.Create(AOwner: TComponent); begin inherited Create(AOwner); Ares.AssignObjectsToForm('FForm2', Self); AresFindComponent(pPanel, 'pPanel', Self); AresFindComponent(dlcxPanel1, 'dlcxPanel1', Self); AresFindComponent(cxGrid1, 'cxGrid1', Self); AresFindComponent(cxGrid1DBTableView1, 'cxGrid1DBTableView1', Self); AresFindComponent(cxGrid1Level1, 'cxGrid1Level1', Self); AresFindComponent(cxGrid1DBTableView1Column2, 'cxGrid1DBTableView1Column2', Self); AresFindComponent(cxGrid1DBTableView1Column3, 'cxGrid1DBTableView1Column3', Self); AresFindComponent(DataSource1, 'DataSource1', Self); AresFindComponent(dlDataset1, 'dlDataset1', Self); AresFindComponent(dlcxPanel2, 'dlcxPanel2', Self); AresFindComponent(dlcxPanel3, 'dlcxPanel3', Self); AresFindComponent(dlDataset2, 'dlDataset2', Self); AresFindComponent(DataSource2, 'DataSource2', Self); AresFindComponent(dlcxPanel4, 'dlcxPanel4', Self); AresFindComponent(dDateFrom, 'dDateFrom', Self); AresFindComponent(dDateTo, 'dDateTo', Self); AresFindComponent(bZberiVse, 'bZberiVse', Self); AresFindComponent(cxGrid1DBTableView1Column4, 'cxGrid1DBTableView1Column4', Self); AresFindComponent(cxGrid1DBTableView1Column1, 'cxGrid1DBTableView1Column1', Self); AresFindComponent(bPripravi, 'bPripravi', Self); AresFindComponent(dlcxPageControl1, 'dlcxPageControl1', Self); AresFindComponent(dlcxTabSheet1, 'dlcxTabSheet1', Self); AresFindComponent(dlcxTabSheet2, 'dlcxTabSheet2', Self); AresFindComponent(dlcxPanel5, 'dlcxPanel5', Self); AresFindComponent(cxGrid2, 'cxGrid2', Self); AresFindComponent(cxGrid2DBTableView1, 'cxGrid2DBTableView1', Self); AresFindComponent(cxGrid2Level1, 'cxGrid2Level1', Self); AresFindComponent(cxGrid2DBTableView1Column1, 'cxGrid2DBTableView1Column1', Self); AresFindComponent(cxGrid2DBTableView1Column2, 'cxGrid2DBTableView1Column2', Self); AresFindComponent(dlcxPanel6, 'dlcxPanel6', Self); AresFindComponent(cxGrid3, 'cxGrid3', Self); AresFindComponent(cxGrid3DBTableView1, 'cxGrid3DBTableView1', Self); AresFindComponent(cxGrid3Level1, 'cxGrid3Level1', Self); AresFindComponent(cxGrid3DBTableView1Column1, 'cxGrid3DBTableView1Column1', Self); AresFindComponent(cxGrid3DBTableView1Column2, 'cxGrid3DBTableView1Column2', Self); AresFindComponent(cxGrid3DBTableView1Column3, 'cxGrid3DBTableView1Column3', Self); AresFindComponent(dlDataset3, 'dlDataset3', Self); AresFindComponent(DataSource3, 'DataSource3', Self); AresFindComponent(PopupMenu1, 'PopupMenu1', Self); AresFindComponent(MenuItem1, 'MenuItem1', Self); AresFindComponent(MenuItem2, 'MenuItem2', Self); AresFindComponent(PopupMenu2, 'PopupMenu2', Self); AresFindComponent(MenuItem3, 'MenuItem3', Self); AresFindComponent(MenuItem4, 'MenuItem4', Self); AresFindComponent(dlcxTabSheet3, 'dlcxTabSheet3', Self); AresFindComponent(dlcxPanel7, 'dlcxPanel7', Self); AresFindComponent(cxGrid4, 'cxGrid4', Self); AresFindComponent(cxGrid4DBTableView1, 'cxGrid4DBTableView1', Self); AresFindComponent(cxGrid4Level1, 'cxGrid4Level1', Self); AresFindComponent(cxGrid4DBTableView1Column1, 'cxGrid4DBTableView1Column1', Self); AresFindComponent(cxGrid4DBTableView1Column2, 'cxGrid4DBTableView1Column2', Self); AresFindComponent(cxGrid4DBTableView1Column3, 'cxGrid4DBTableView1Column3', Self); AresFindComponent(cxGrid4DBTableView1Column4, 'cxGrid4DBTableView1Column4', Self); AresFindComponent(dlDataset4, 'dlDataset4', Self); AresFindComponent(DataSource4, 'DataSource4', Self); AresFindComponent(cxGrid4DBTableView1Column5, 'cxGrid4DBTableView1Column5', Self); AresFindComponent(cxGrid4DBTableView1Column6, 'cxGrid4DBTableView1Column6', Self); AresFindComponent(bTiskaj, 'bTiskaj', Self); AresFindComponent(PopupMenu3, 'PopupMenu3', Self); AresFindComponent(MenuItem5, 'MenuItem5', Self); AresFindComponent(sme, 'sme', Self); AresFindComponent(dlcxPanel8, 'dlcxPanel8', Self); AresFindComponent(fPath, 'fpath', Self); AresFindComponent(MenuItem6, 'MenuItem6', Self); AresFindComponent(MenuItem7, 'MenuItem7', Self); MenuItem7.OnClick := MenuItem7Click; MenuItem5.OnClick := MenuItem5Click; bTiskaj.OnClick := bTiskajClick; MenuItem3.OnClick := MenuItem3Click; MenuItem4.OnClick := MenuItem4Click; MenuItem2.OnClick := MenuItem2Click; MenuItem1.OnClick := MenuItem1Click; OnClose := FormClose; bPripravi.OnClick := bPripraviClick; bZberiVse.OnClick := bZberiVseClick; dlDataSet2.Active := True; dlDataSet3.Active := True; dDateFrom.Caption := panResources['cPrometPosZakljucekDatumOd']; dDateTo.Caption := panResources['cPrometPosZakljucekDatumDo']; bPripravi.Caption := panResources['cPrometObnovitevZalogePripPod']; bZberiVse.Caption := panResources['cPolniKriterijObracun']; dlcxTabSheet2.Caption := panResources['cSifUser0014']; dlcxTabSheet3.Caption := panResources['cAresVariables']; cxGrid2DBTableView1Column1.Caption := panResources['cStdHEObjectPovAvansGrid07']; cxGrid3DBTableView1Column1.Caption := panResources['cStdHEObjectPovAvansGrid07']; cxGrid1DBTableView1Column1.Caption := panResources['cPolniKriterijInitUporabnik']; cxGrid3DBTableView1Column3.Caption := panResources['cPolniKriterijInitUporabnik']; cxGrid1DBTableView1Column2.Caption := panResources['cNacocFieldDisplayOpomba']; cxGrid1DBTableView1Column3.Caption := panResources['cSerijskeStevilkeSNSelectedKolicina']; MenuItem1.Caption := panResources['cdlChListPDVMRepPrekrizaj']; MenuItem2.Caption := panResources['cdlChListPDVMRepOdkrizaj']; MenuItem3.Caption := panResources['cdlChListPDVMRepPrekrizaj']; MenuItem4.Caption := panResources['cdlChListPDVMRepOdkrizaj']; cxGrid4DBTableView1Column1.Caption := panResources['cStdHEObjectPovAvansGrid07']; //cxGrid4DBTableView1Column2.Caption := panResources['cAresObject']; cxGrid4DBTableView1Column3.Caption := panResources['cPrometPosZakljucekDatumOd']; cxGrid4DBTableView1Column4.Caption := panResources['cPrometPosZakljucekDatumDo']; cxGrid4DBTableView1Column5.Caption := panResources['cNacocFieldDisplayOpomba']; cxGrid4DBTableView1Column6.Caption := panResources['cAresVariables']; bTiskaj.Caption := panResources['cMainUporIzpis']; RefreshDBs; if (VarToStr(dlIniReadString('AMCPath', 'FileName')) = '') then fPath.Text := 'c:\AMCExport.XLS'; end; procedure TForm2.bZberiVseClick(Sender: TObject); var sp: TdlStoredProc; begin sp := TdlStoredProc.Create(nil); try sp.StoredProcName := '_DE_PeriodAMC'; sp.ParamByName('p_cDBName').AsString := ''; sp.ParamByName('p_nType').AsInteger := -1; sp.ParamByName('p_dDateFrom').asDateTime := StrToDate(GetDateFrom(dDateFrom.Text)); sp.ParamByName('p_dDateTo').asDateTime := StrToDate(GetDateTo(dDateTo.Text)); //sp.ParamByName('p_cbUsers').asString := GetUsersSQL(cUsers); sp.ExecProc; except ShowMessage(panResources['cMsg0368']); end; sp.Free; dlDataset1.Active := True; dlDataSet1.Refresh; cxGrid1.Refresh; end; procedure TForm2.bPripraviClick(Sender: TObject); var DS, DSPoz: TdlDataset; sp: TdlStoredProc; begin AresFindComponent(DS, 'tbPerFak', OwnerForm); AresFindComponent(DSPoz, 'tbPerFakPoz', OwnerForm); //Goes through and fills data DS.Open; DS.First; While not DS.EOF do begin DSPoz.First; While not DSPoz.EOF do begin //Use stored procedure to calculate and get data to upodate the current record sp := TdlStoredProc.Create(nil); try sp.StoredProcName := '_DE_PeriodAMC'; sp.ParamByName('p_cDBName').AsString := DS.FieldByName('uacDBName').AsString; sp.ParamByName('p_nType').AsInteger := DSPoz.FieldByName('uacSQLFind').asInteger; sp.ParamByName('p_dDateFrom').asDateTime := StrToDate(GetDateFrom(dDateFrom.Text)); sp.ParamByName('p_dDateTo').asDateTime := StrToDate(GetDateTo(dDateTo.Text)); //sp.ParamByName('p_cbUsers').asString := GetUsersSQL(cUsers); sp.ExecProc; if sp.ParamByName('p_nQty').asFloat <> 0 then DefDatabase.ExecSQL('Update tHE_MovePerInvItem set anQty = ' + VarToStr(sp.ParamByName('p_nQty').asFloat) + ', acNote = ''' + VarToStr(sp.ParamByName('p_cNote').asString) + ''' where acKey = ''' + DS.FieldByName('acKey').AsString + ''' and anNo = ' + VarToStr(DSPoz.FieldByName('anNo').AsInteger) + '', []); except ShowMessage(panResources['cMsg0368']); end; sp.Free; DSPoz.Next; end; DS.Next; end; ShowMessage(panResources['cAresDone']); end; Function GetDateFrom(dDate:String):String; begin If dDate = '' then GetDateFrom := '1.1.1900' else GetDateFrom := dDate; end; Function GetDateTo(dDate:String):String; begin If dDate = '' then GetDateTo := '31.12.2049' else GetDateTo := dDate; end; procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction); begin //DefDatabase.ExecSQL('update tHE_PayOrder set acStatus = ''O'', adDateOfAppr = ' + QuotedStr(cPayDate) + ' where acStatus = ''P'' and acDocType = ' +QuotedStr(cDocType)+ ' and anBankNo = ' +cBankNo, []); end; Procedure RefreshDBs; var sp: TdlStoredProc; begin sp := TdlStoredProc.Create(nil); try sp.StoredProcName := 'pPA_GetDataBases'; sp.ParamByName('p_Refresh').AsString := 'F'; sp.ExecProc; except //ShowMessage('Napaka pri osveevanju zbirk podatkov.'); end; end; procedure TForm2.MenuItem1Click(Sender: TObject); begin DefDatabase.ExecSQL('update uDBs set acMarked = ''T''', []); dlDataset2.Refresh; cxGrid2.Refresh; end; procedure TForm2.MenuItem2Click(Sender: TObject); begin DefDatabase.ExecSQL('update uDBs set acMarked = ''F''', []); dlDataset2.Refresh; cxGrid2.Refresh; end; procedure TForm2.MenuItem4Click(Sender: TObject); begin DefDatabase.ExecSQL('update uUsers set acMarked = ''F''', []); dlDataset3.Refresh; cxGrid3.Refresh; end; procedure TForm2.MenuItem3Click(Sender: TObject); begin DefDatabase.ExecSQL('update uUsers set acMarked = ''T''', []); dlDataset3.Refresh; cxGrid3.Refresh; end; procedure TForm2.bTiskajClick(Sender: TObject); begin Ares.ExecuteStep(5); end; procedure TForm2.MenuItem5Click(Sender: TObject); begin //Export through component sme.WizardStyle := wsWindows2000; sme.TableName := 'GLPosts'; sme.ColumnSource := csdataset; sme.TableType := teExcel; sme.FileName := fPath.text; sme.DataSet := dlDataSet1; sme.ExecuteWithoutDialog; ShowMessage(panResources['cAresDone']); dlIniWriteString('AmcPath', 'FileName', fPath.Text); end; procedure TForm2.MenuItem7Click(Sender: TObject); begin DefDatabase.ExecSQL('update uUsers set acMarked = ''F''', []); DefDatabase.ExecSQL('update uUsers set acMarked = ''T'' from uUsers U inner join tPA_User T on U.acUserId = T.acUserId where T.acActive = ''T''', []); dlDataset3.Refresh; cxGrid3.Refresh; end; end. 9#acKeyanNoanSeqNoacHField2acHType anHLengthanHDecacPField2acPTypeanPLegthanPDec acPFormat acPSeparator anUserChg anUserIns adTimeChg adTimeIns anQIdacKeyanNoanSeqNo acFieldName2 anFieldSize acFieldTitleacFieldReadOnly acEditType acFieldConst acFieldFormatacFieldDefault anUserChg anUserIns adTimeIns adTimeChg acLookupSQLanQId acKeyanNo acDataEventacDataReturnValue acKeyAndNo anUserChg anUserIns adTimeChg adTimeIns anQIdacKey acWhereKeyanNo acFieldName acParamVar acFieldType acFieldREQacFieldCaption2 acDefaultExpacDefaultValue acLookUpSQL acOperator acVarHint2 acAddApostrof acPrtCrit anUserChg anUserIns adTimeChg adTimeIns anQId acKey anVersionanNoacSQLExpacNote adTimeChg anUserChg adTimeIns anUserInsanQIdacReportacLangIdacLocalization2 acFormNamedacNamedacDefaultPrinter acPreviewanMaxPrStLevelacSubstituteSignacPrintIfEmpty acPrintToText anNoOfCopy acOrderBy acRegUserCodeacActive acKeyShortCut2 anUserIns adTimeIns anUserChg adTimeChg acText1acText2acText3acNote acReportDataacPDFPrintoptimizedanQIdA03SIAresReportAMC0002AresReportAMC0002Privzet tiskalnikTFFFTRzBB? FF acKey acUnitName acObjectName acTranslationacLocalisationanQId