Commit ece10ebb authored by Sasa Jankov's avatar Sasa Jankov

*main

parent 8717a92a
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<TfrxReport Version="4.15" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="44160.4556349421" ReportOptions.Description.Text="" ReportOptions.LastChange="44160.6392802315" ScriptLanguage="PascalScript" ScriptText.Text="begin&#13;&#10;&#13;&#10;end." PropData="044C65667403A00303546F7002780844617461736574730101063020446174615365743D226672784442417274696B616C2220446174615365744E616D653D22667278417274696B616C220001062C20446174615365743D226672784442445072696E742220446174615365744E616D653D2266727844696167220000095661726961626C65730100055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="215.9" PaperHeight="279.4" PaperSize="1" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxChartView Name="Chart1" Left="3.77953" Top="15.11812" Width="714.33117" Height="396.85065" ShowHint="False" PropData="0543686172740A850200005450463006544368617274054368617274044C656674020003546F7002000557696474680390010648656967687403FA00144261636B57616C6C2E50656E2E56697369626C650825426F74746F6D417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E746572244465707468417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E746572274465707468546F70417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E7465720D4672616D652E56697369626C6508234C656674417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E746572245269676874417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E74657222546F70417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E746572165669657733444F7074696F6E732E526F746174696F6E02000D5A6F6F6D2E50656E2E4D6F64650708706D4E6F74586F720A426576656C4F75746572070662764E6F6E6505436F6C6F720707636C57686974650D44656661756C7443616E766173060E54474449506C757343616E76617311436F6C6F7250616C65747465496E646578020D000F54466173744C696E6553657269657307536572696573310D4D61726B732E56697369626C65080D4C696E6550656E2E436F6C6F72044466A3000C5856616C7565732E4E616D650601580D5856616C7565732E4F72646572070B6C6F417363656E64696E670C5956616C7565732E4E616D650601590D5956616C7565732E4F7264657207066C6F4E6F6E650000000E4368617274456C65766174696F6E0359010A5365726965734461746101010C2D0100002044617461547970653D2264744442446174612220446174615365743D226672784442445072696E742220446174615365744E616D653D22667278446961672220536F72744F726465723D22736F4E6F6E652220546F704E3D2230222058547970653D227874546578742220536F75726365313D22667278446961672E262333343B74656D7065726174757261262333343B2220536F75726365323D22667278446961672E262333343B74656D7065726174757261262333343B2220536F75726365333D22667278446961672E262333343B7672656D65262333343B222058536F757263653D22667278446961672E262333343B74656D7065726174757261262333343B222059536F757263653D22667278446961672E262333343B74656D7065726174757261262333343B220000"/>
</TfrxReportPage>
</TfrxReport>
#include <vcl.h>
#include <tchar.h>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{F38C0B53-0C73-4F1F-815F-60CD7C7A1611}</ProjectGuid>
<ProjectVersion>15.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<AppType>Application</AppType>
<MainSource>MlekaraCB.cpp</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<Multithreaded>true</Multithreaded>
<Icon_MainIcon>$(BDS)\bin\cbuilder_PROJECTICON.ico</Icon_MainIcon>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<AllPackageLibs>rtl.lib;vcl.lib;dbrtl.lib;dbexpress.lib;DbxCommonDriver.lib;DBXMySQLDriver.lib;dsnap.lib;cxLibraryRS19.lib;dxGDIPlusRS19.lib;dxCoreRS19.lib;dxThemeRS19.lib;vclx.lib;cxEditorsRS19.lib;cxDataRS19.lib;vclimg.lib;vcldb.lib;cxGridRS19.lib;dxLayoutControlRS19.lib;cxPageControlRS19.lib;dxComnRS19.lib;cxExportRS19.lib;xmlrtl.lib;dxServerModeRS19.lib;dxSkinsCoreRS19.lib;dxSkinscxPCPainterRS19.lib;dxSkinBlackRS19.lib;dxSkinBlueprintRS19.lib;dxSkinBlueRS19.lib;dxSkinCaramelRS19.lib;dxSkinCoffeeRS19.lib;dxSkinDarkRoomRS19.lib;dxSkinDarkSideRS19.lib;dxSkinDevExpressDarkStyleRS19.lib;dxSkinDevExpressStyleRS19.lib;dxSkinFoggyRS19.lib;dxSkinGlassOceansRS19.lib;dxSkinHighContrastRS19.lib;dxSkiniMaginaryRS19.lib;dxSkinLilianRS19.lib;dxSkinLiquidSkyRS19.lib;dxSkinLondonLiquidSkyRS19.lib;dxSkinMcSkinRS19.lib;dxSkinMoneyTwinsRS19.lib;dxSkinOffice2007BlackRS19.lib;dxSkinOffice2007BlueRS19.lib;dxSkinOffice2007GreenRS19.lib;dxSkinOffice2007PinkRS19.lib;dxSkinOffice2007SilverRS19.lib;dxSkinOffice2010BlackRS19.lib;dxSkinOffice2010BlueRS19.lib;dxSkinOffice2010SilverRS19.lib;dxSkinOffice2013WhiteRS19.lib;dxSkinPumpkinRS19.lib;dxSkinSevenClassicRS19.lib;dxSkinSevenRS19.lib;dxSkinSharpPlusRS19.lib;dxSkinSharpRS19.lib;dxSkinSilverRS19.lib;dxSkinSpringTimeRS19.lib;dxSkinStardustRS19.lib;dxSkinSummer2008RS19.lib;dxSkinTheAsphaltWorldRS19.lib;dxSkinValentineRS19.lib;dxSkinVS2010RS19.lib;dxSkinWhiteprintRS19.lib;dxSkinXmas2008BlueRS19.lib;cxPageControldxBarPopupMenuRS19.lib;dxBarRS19.lib;frx19.lib;fs19.lib;fqb190.lib;bdertl.lib;IndySystem.lib;tmsdXE5.lib;adortl.lib;vclactnband.lib;VclSmp.lib;frxDB19.lib;fsDB19.lib</AllPackageLibs>
<_TCHARMapping>wchar_t</_TCHARMapping>
<ILINK_LibraryPath>C:\Program Files (x86)\Components\FastReport 4\LibD19\;C:\projects\Embracadero\Cashit\;dbUtility\;..\..\..\Desktop\Mlekara\;$(ILINK_LibraryPath)</ILINK_LibraryPath>
<ProjectType>CppVCLApplication</ProjectType>
<IncludePath>C:\Program Files (x86)\Components\FastReport 4\LibD19\;C:\projects\Embracadero\Cashit\;dbUtility\;..\..\..\Desktop\Mlekara\;$(IncludePath)</IncludePath>
<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
<DynamicRTL>true</DynamicRTL>
<UsePackages>true</UsePackages>
<IntermediateOutputDir>.\$(Platform)\$(Config)</IntermediateOutputDir>
<FinalOutputDir>.\$(Platform)\$(Config)</FinalOutputDir>
<BCC_wpar>false</BCC_wpar>
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
<BCC_ExtendedErrorInfo>true</BCC_ExtendedErrorInfo>
<ILINK_TranslatedLibraryPath>$(BDSLIB)\$(PLATFORM)\release\$(LANGDIR);$(ILINK_TranslatedLibraryPath)</ILINK_TranslatedLibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<IncludePath>$(BDSINCLUDE)\windows\vcl;$(IncludePath)</IncludePath>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<PackageImports>A407_R;adortl;bcbie;bcbsmp;bdertl;bindengine;CloudService;CustomIPTransport;cxBarEditItemRS19;cxDataRS19;cxEditorsRS19;cxExportRS19;cxGridRS19;cxLibraryRS19;cxPageControldxBarPopupMenuRS19;cxPageControlRS19;cxPivotGridChartRS19;cxPivotGridOLAPRS19;cxPivotGridRS19;cxSchedulerGridRS19;cxSchedulerRS19;cxSchedulerTreeBrowserRS19;cxSpreadSheetRS19;cxTreeListdxBarPopupMenuRS19;cxTreeListRS19;cxVerticalGridRS19;DataSnapCommon;DataSnapIndy10ServerTransport;dbexpress;dbrtl;dbxcds;DbxClientDriver;DbxCommonDriver;DBXDb2Driver;DBXFirebirdDriver;DBXInformixDriver;DBXInterBaseDriver;DBXMSSQLDriver;DBXMySQLDriver;DBXOdbcDriver;DBXOracleDriver;DBXSqliteDriver;DBXSybaseASADriver;DBXSybaseASEDriver;dcldxSkinsCoreRS19;dsnap;dsnapcon;dxADOServerModeRS19;dxBarDBNavRS19;dxBarExtDBItemsRS19;dxBarExtItemsRS19;dxBarRS19;dxComnRS19;dxCoreRS19;dxdborRS19;dxdbtrRS19;dxDBXServerModeRS19;dxDockingRS19;dxFlowChartRS19;dxGDIPlusRS19;dxLayoutControlRS19;dxmdsRS19;dxNavBarRS19;dxorgcRS19;dxPSCoreRS19;dxPScxCommonRS19;dxPScxExtCommonRS19;dxPScxGridLnkRS19;dxPScxPCProdRS19;dxPScxPivotGridLnkRS19;dxPScxSchedulerLnkRS19;dxPScxSSLnkRS19;dxPScxTLLnkRS19;dxPScxVGridLnkRS19;dxPSDBTeeChartRS19;dxPSdxDBOCLnkRS19;dxPSdxDBTVLnkRS19;dxPSdxFCLnkRS19;dxPSdxLCLnkRS19;dxPSdxOCLnkRS19;dxPSLnksRS19;dxPsPrVwAdvRS19;dxPSPrVwRibbonRS19;dxPSTeeChartRS19;dxRibbonRS19;dxServerModeRS19;dxSkinBlackRS19;dxSkinBlueprintRS19;dxSkinBlueRS19;dxSkinCaramelRS19;dxSkinCoffeeRS19;dxSkinDarkRoomRS19;dxSkinDarkSideRS19;dxSkinDevExpressDarkStyleRS19;dxSkinDevExpressStyleRS19;dxSkinFoggyRS19;dxSkinGlassOceansRS19;dxSkinHighContrastRS19;dxSkiniMaginaryRS19;dxSkinLilianRS19;dxSkinLiquidSkyRS19;dxSkinLondonLiquidSkyRS19;dxSkinMcSkinRS19;dxSkinMoneyTwinsRS19;dxSkinOffice2007BlackRS19;dxSkinOffice2007BlueRS19;dxSkinOffice2007GreenRS19;dxSkinOffice2007PinkRS19;dxSkinOffice2007SilverRS19;dxSkinOffice2010BlackRS19;dxSkinOffice2010BlueRS19;dxSkinOffice2010SilverRS19;dxSkinOffice2013WhiteRS19;dxSkinPumpkinRS19;dxSkinsCoreRS19;dxSkinscxPCPainterRS19;dxSkinscxSchedulerPainterRS19;dxSkinsdxBarPainterRS19;dxSkinsdxDLPainterRS19;dxSkinsdxNavBarPainterRS19;dxSkinsdxRibbonPainterRS19;dxSkinSevenClassicRS19;dxSkinSevenRS19;dxSkinSharpPlusRS19;dxSkinSharpRS19;dxSkinSilverRS19;dxSkinSpringTimeRS19;dxSkinStardustRS19;dxSkinSummer2008RS19;dxSkinTheAsphaltWorldRS19;dxSkinValentineRS19;dxSkinVS2010RS19;dxSkinWhiteprintRS19;dxSkinXmas2008BlueRS19;dxSpellCheckerRS19;dxTabbedMDIRS19;dxThemeRS19;dxTileControlRS19;dxtrmdRS19;dxWizardControlRS19;FireDAC;FireDACADSDriver;FireDACASADriver;FireDACCommon;FireDACCommonDriver;FireDACDataSnapDriver;FireDACDb2Driver;FireDACDBXDriver;FireDACIBDriver;FireDACMSAccDriver;FireDACMSSQLDriver;FireDACMySQLDriver;FireDACODBCDriver;FireDACOracleDriver;FireDACPgDriver;FireDACSqliteDriver;fmx;fmxFireDAC;FMXTee;FmxTeeUI;frx19;frxADO19;frxBDE19;frxDB19;frxDBX19;frxe19;frxIBX19;frxTee19;fs19;fsADO19;fsBDE19;fsDB19;fsIBX19;fsTee19;ibxpress;IndyCore;IndyIPClient;IndyIPCommon;IndyIPServer;IndyProtocols;IndySystem;inet;inetdbbde;inetdbxpress;Intraweb;MetropolisUILiveTile;RESTComponents;rtl;soaprtl;svn;Tee;TeeDB;TeeUI;tmsdXE5;tmsexdXE5;tmswizdXE5;tmsxlsdXE5;vcl;vclactnband;vcldb;vcldbx;vcldsnap;vclFireDAC;vclib;vclie;vclimg;VCLRESTComponents;vclribbon;VclSmp;vcltouch;vclx;xmlrtl;$(PackageImports)</PackageImports>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<BCC_OptimizeForSpeed>false</BCC_OptimizeForSpeed>
<BCC_DisableOptimizations>true</BCC_DisableOptimizations>
<DCC_Optimize>false</DCC_Optimize>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<Defines>_DEBUG;$(Defines)</Defines>
<BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
<BCC_UseRegisterVariables>None</BCC_UseRegisterVariables>
<DCC_Define>DEBUG</DCC_Define>
<BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
<TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
<BCC_StackFrames>true</BCC_StackFrames>
<ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
<TASM_Debugging>Full</TASM_Debugging>
<BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
<BCC_EnableCPPExceptions>true</BCC_EnableCPPExceptions>
<BCC_DisableFramePtrElimOpt>true</BCC_DisableFramePtrElimOpt>
<BCC_DisableSpellChecking>true</BCC_DisableSpellChecking>
<CLANG_UnwindTables>true</CLANG_UnwindTables>
<ILINK_LibraryPath>$(BDSLIB)\$(PLATFORM)\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
<ILINK_TranslatedLibraryPath>$(BDSLIB)\$(PLATFORM)\debug\$(LANGDIR);$(ILINK_TranslatedLibraryPath)</ILINK_TranslatedLibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<LinkPackageStatics>fqb190.lib</LinkPackageStatics>
<LinkPackageImports>rtl.bpi;vcl.bpi;dbrtl.bpi;dbexpress.bpi;DbxCommonDriver.bpi;DBXMySQLDriver.bpi;dsnap.bpi;cxLibraryRS19.bpi;dxGDIPlusRS19.bpi;dxCoreRS19.bpi;dxThemeRS19.bpi;vclx.bpi;cxEditorsRS19.bpi;cxDataRS19.bpi;vclimg.bpi;vcldb.bpi;cxGridRS19.bpi;dxLayoutControlRS19.bpi;cxPageControlRS19.bpi;dxComnRS19.bpi;cxExportRS19.bpi;xmlrtl.bpi;dxServerModeRS19.bpi;dxSkinsCoreRS19.bpi;dxSkinscxPCPainterRS19.bpi;dxSkinBlackRS19.bpi;dxSkinBlueprintRS19.bpi;dxSkinBlueRS19.bpi;dxSkinCaramelRS19.bpi;dxSkinCoffeeRS19.bpi;dxSkinDarkRoomRS19.bpi;dxSkinDarkSideRS19.bpi;dxSkinDevExpressDarkStyleRS19.bpi;dxSkinDevExpressStyleRS19.bpi;dxSkinFoggyRS19.bpi;dxSkinGlassOceansRS19.bpi;dxSkinHighContrastRS19.bpi;dxSkiniMaginaryRS19.bpi;dxSkinLilianRS19.bpi;dxSkinLiquidSkyRS19.bpi;dxSkinLondonLiquidSkyRS19.bpi;dxSkinMcSkinRS19.bpi;dxSkinMoneyTwinsRS19.bpi;dxSkinOffice2007BlackRS19.bpi;dxSkinOffice2007BlueRS19.bpi;dxSkinOffice2007GreenRS19.bpi;dxSkinOffice2007PinkRS19.bpi;dxSkinOffice2007SilverRS19.bpi;dxSkinOffice2010BlackRS19.bpi;dxSkinOffice2010BlueRS19.bpi;dxSkinOffice2010SilverRS19.bpi;dxSkinOffice2013WhiteRS19.bpi;dxSkinPumpkinRS19.bpi;dxSkinSevenClassicRS19.bpi;dxSkinSevenRS19.bpi;dxSkinSharpPlusRS19.bpi;dxSkinSharpRS19.bpi;dxSkinSilverRS19.bpi;dxSkinSpringTimeRS19.bpi;dxSkinStardustRS19.bpi;dxSkinSummer2008RS19.bpi;dxSkinTheAsphaltWorldRS19.bpi;dxSkinValentineRS19.bpi;dxSkinVS2010RS19.bpi;dxSkinWhiteprintRS19.bpi;dxSkinXmas2008BlueRS19.bpi;cxPageControldxBarPopupMenuRS19.bpi;dxBarRS19.bpi;frx19.bpi;fs19.bpi;bdertl.bpi;IndySystem.bpi;tmsdXE5.bpi;adortl.bpi;vclactnband.bpi;VclSmp.bpi;frxDB19.bpi;fsDB19.bpi</LinkPackageImports>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<Defines>NDEBUG;$(Defines)</Defines>
<TASM_Debugging>None</TASM_Debugging>
</PropertyGroup>
<ItemGroup>
<CppCompile Include="c_poruka.cpp">
<Form>frm_poruka</Form>
<FormType>dfm</FormType>
<DependentOn>c_poruka.h</DependentOn>
<BuildOrder>5</BuildOrder>
</CppCompile>
<CppCompile Include="dbUtility\Connection.cpp">
<Form>DataModule1</Form>
<FormType>dfm</FormType>
<DesignClass>TDataModule</DesignClass>
<DependentOn>dbUtility\Connection.h</DependentOn>
<BuildOrder>3</BuildOrder>
</CppCompile>
<CppCompile Include="dbUtility\dbDm.cpp">
<Form>db</Form>
<FormType>dfm</FormType>
<DesignClass>TDataModule</DesignClass>
<DependentOn>dbUtility\dbDm.h</DependentOn>
<BuildOrder>4</BuildOrder>
</CppCompile>
<PCHCompile Include="Mlekara.h">
<BuildOrder>1</BuildOrder>
</PCHCompile>
<CppCompile Include="MlekaraCB.cpp">
<BuildOrder>0</BuildOrder>
</CppCompile>
<CppCompile Include="MlekaraMain.cpp">
<Form>MainForm</Form>
<FormType>dfm</FormType>
<DependentOn>MlekaraMain.h</DependentOn>
<BuildOrder>2</BuildOrder>
</CppCompile>
<FormResources Include="MlekaraMain.dfm"/>
<FormResources Include="c_poruka.dfm"/>
<FormResources Include="dbUtility\Connection.dfm"/>
<FormResources Include="dbUtility\dbDm.dfm"/>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>CPlusPlusBuilder.Personality.12</Borland.Personality>
<Borland.ProjectType>CppVCLApplication</Borland.ProjectType>
<BorlandProject>
<CPlusPlusBuilder.Personality>
<Source>
<Source Name="MainSource">MlekaraCB.cpp</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1033</VersionInfo>
<VersionInfo Name="CodePage">1252</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
<VersionInfoKeys Name="package"/>
<VersionInfoKeys Name="label"/>
<VersionInfoKeys Name="versionCode"/>
<VersionInfoKeys Name="versionName"/>
<VersionInfoKeys Name="persistent"/>
<VersionInfoKeys Name="restoreAnyVersion"/>
<VersionInfoKeys Name="installLocation"/>
<VersionInfoKeys Name="largeHeap"/>
<VersionInfoKeys Name="theme"/>
</VersionInfoKeys>
<ProjectProperties>
<ProjectProperties Name="AutoShowDeps">False</ProjectProperties>
<ProjectProperties Name="ManagePaths">True</ProjectProperties>
<ProjectProperties Name="VerifyPackages">True</ProjectProperties>
</ProjectProperties>
<Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\AsyncPro\packages\Delphi XE2\A407_R160.bpl">TurboPower Async Professional 4.07 Runtime Package</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxCoreRS19.bpl">ExpressCoreLibrary by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxGDIPlusRS19.bpl">ExpressGDI+ Library by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxThemeRS19.bpl">Express XP Theme Manager by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxBarRS19.bpl">ExpressBars by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxComnRS19.bpl">ExpressCommonLibrary by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxLayoutControlRS19.bpl">ExpressLayout Control by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxServerModeRS19.bpl">ExpressDataController Server Mode by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxmdsRS19.bpl">ExpressMemData by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxADOServerModeRS19.bpl">ADO Data Source for ExpressDataController Server Mode by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxBarDBNavRS19.bpl">ExpressBars DBNavigator by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxBarExtDBItemsRS19.bpl">ExpressBars extended DB items by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxBarExtItemsRS19.bpl">ExpressBars extended items by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxorgcRS19.bpl">ExpressOrgChart by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxdborRS19.bpl">ExpressDBOrgChart by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxdbtrRS19.bpl">ExpressDBTree by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxDBXServerModeRS19.bpl">dbExpress Data Source for ExpressDataController Server Mode by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxDockingRS19.bpl">ExpressDocking Library by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxFlowChartRS19.bpl">ExpressFlowChart by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxNavBarRS19.bpl">ExpressNavBar by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSCoreRS19.bpl">ExpressPrinting System by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPScxCommonRS19.bpl">ExpressPrinting System Cross Platform Library by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSLnksRS19.bpl">ExpressPrinting System ReportLinks (Standard) by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPScxExtCommonRS19.bpl">ExpressPrinting System Extended Cross Platform Library by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPScxGridLnkRS19.bpl">ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSdxLCLnkRS19.bpl">ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPScxPivotGridLnkRS19.bpl">ExpressPrinting System ReportLink for ExpressPivotGrid by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPScxSchedulerLnkRS19.bpl">ExpressPrinting System ReportLink for ExpressScheduler by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPScxSSLnkRS19.bpl">ExpressPrinting System ReportLink for ExpressSpreadSheet by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPScxTLLnkRS19.bpl">ExpressPrinting System ReportLink for ExpressQuantumTreeList by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPScxVGridLnkRS19.bpl">ExpressPrinting System ReportLink for ExpressVerticalGrid by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSDBTeeChartRS19.bpl">ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSTeeChartRS19.bpl">ExpressPrinting System ReportLink for TeeChart by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSdxDBOCLnkRS19.bpl">ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSdxOCLnkRS19.bpl">ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSdxDBTVLnkRS19.bpl">ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSdxFCLnkRS19.bpl">ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPsPrVwAdvRS19.bpl">ExpressPrinting System Advanced Preview Window by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxPSPrVwRibbonRS19.bpl">ExpressPrinting System Ribbon Preview Window by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxRibbonRS19.bpl">ExpressBars Ribbon controls by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxSkinsCoreRS19.bpl">ExpressSkins Library by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxSpellCheckerRS19.bpl">ExpressSpellChecker 2 by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxTabbedMDIRS19.bpl">ExpressBars Tabbed MDI by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxTileControlRS19.bpl">ExpressTileControl by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxtrmdRS19.bpl">ExpressTreePrintedDataSet by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="C:\Program Files (x86)\Components\DevExpressVCL.13.1.4\Library\RS19\dxWizardControlRS19.bpl">ExpressWizardControl by Developer Express Inc.</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k190.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp190.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k190.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp190.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclDataSnapClient190.bpl">Embarcadero DBExpress DataSnap Client Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclDataSnapConnectors190.bpl">Embarcadero DataSnap Connector Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclDataSnapProviderClient190.bpl">Embarcadero DBExpress DataSnap Provider Client Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclDataSnapServer190.bpl">Embarcadero DBExpress DataSnap Server Components</Excluded_Packages>
</Excluded_Packages>
</CPlusPlusBuilder.Personality>
<Deployment/>
<Platforms>
<Platform value="Win32">True</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Cpp.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Cpp.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>2020/11/24 11:00:47.000.731,=C:\Users\janko\Documents\RAD Studio\Projects\Unit1.cpp</Transaction>
<Transaction>2020/11/24 11:00:47.000.709,=C:\Users\janko\Documents\RAD Studio\Projects\Project1PCH1.h</Transaction>
<Transaction>2020/11/24 11:01:41.000.150,C:\Users\janko\Desktop\Mlekara\MlekaraMain.h=C:\Users\janko\Documents\RAD Studio\Projects\Unit1.h</Transaction>
<Transaction>2020/11/24 11:01:41.000.150,C:\Users\janko\Desktop\Mlekara\MlekaraMain.cpp=C:\Users\janko\Documents\RAD Studio\Projects\Unit1.cpp</Transaction>
<Transaction>2020/11/24 11:01:41.000.150,C:\Users\janko\Desktop\Mlekara\MlekaraMain.dfm=C:\Users\janko\Documents\RAD Studio\Projects\Unit1.dfm</Transaction>
<Transaction>2020/11/24 11:01:57.000.416,C:\Users\janko\Desktop\Mlekara\Mlekara.h=C:\Users\janko\Documents\RAD Studio\Projects\Project1PCH1.h</Transaction>
<Transaction>2020/11/24 11:02:07.000.405,C:\Users\janko\Desktop\Mlekara\MlekaraCB.cbproj=C:\Users\janko\Documents\RAD Studio\Projects\Project1.cbproj</Transaction>
<Transaction>2020/11/24 11:02:39.000.773,=C:\Users\janko\Desktop\Mlekara\Unit1.cpp</Transaction>
<Transaction>2020/11/24 11:03:18.000.668,C:\Users\janko\Desktop\Mlekara\Unit1.dfm=C:\Users\janko\Desktop\Mlekara\dbUtility\Connection.dfm</Transaction>
<Transaction>2020/11/24 11:03:18.000.668,C:\Users\janko\Desktop\Mlekara\Unit1.h=C:\Users\janko\Desktop\Mlekara\dbUtility\Connection.h</Transaction>
<Transaction>2020/11/24 11:03:18.000.668,C:\Users\janko\Desktop\Mlekara\Unit1.cpp=C:\Users\janko\Desktop\Mlekara\dbUtility\Connection.cpp</Transaction>
<Transaction>2020/11/24 11:06:28.000.911,=C:\Users\janko\Desktop\Mlekara\Unit2.cpp</Transaction>
<Transaction>2020/11/24 11:07:07.000.273,C:\Users\janko\Desktop\Mlekara\Unit2.h=C:\Users\janko\Desktop\Mlekara\dbUtility\dbDm.h</Transaction>
<Transaction>2020/11/24 11:07:07.000.273,C:\Users\janko\Desktop\Mlekara\Unit2.dfm=C:\Users\janko\Desktop\Mlekara\dbUtility\dbDm.dfm</Transaction>
<Transaction>2020/11/24 11:07:07.000.273,C:\Users\janko\Desktop\Mlekara\Unit2.cpp=C:\Users\janko\Desktop\Mlekara\dbUtility\dbDm.cpp</Transaction>
<Transaction>2020/11/25 13:20:18.000.104,=C:\projects\Embracadero\Cashit\c_poruka.cpp</Transaction>
<Transaction>2020/11/25 13:21:12.000.593,C:\projects\Embracadero\Cashit\c_poruka.cpp=</Transaction>
<Transaction>2020/11/25 13:21:45.000.385,=C:\Users\janko\Desktop\Mlekara\c_poruka.cpp</Transaction>
<Transaction>2020/11/25 16:33:42.125,=C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee6.cpp</Transaction>
<Transaction>2020/11/25 16:33:42.129,=C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee5.cpp</Transaction>
<Transaction>2020/11/25 16:33:42.132,=C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee4.cpp</Transaction>
<Transaction>2020/11/25 16:35:46.224,C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee4.cpp=</Transaction>
<Transaction>2020/11/25 16:35:49.461,C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee5.cpp=</Transaction>
<Transaction>2020/11/25 16:35:55.091,C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee6.cpp=</Transaction>
<Transaction>2020/11/25 16:36:14.254,=C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee6.cpp</Transaction>
<Transaction>2020/11/25 16:36:14.256,=C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee5.cpp</Transaction>
<Transaction>2020/11/25 16:36:14.257,=C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee4.cpp</Transaction>
<Transaction>2020/11/25 19:04:16.476,C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee4.cpp=</Transaction>
<Transaction>2020/11/25 19:04:19.066,C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee5.cpp=</Transaction>
<Transaction>2020/11/25 19:04:22.071,C:\Program Files (x86)\Components\FastReport 4\LibD19\frxTee6.cpp=</Transaction>
</Transactions>
</BorlandProject>
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <tchar.h>
//---------------------------------------------------------------------------
USEFORM("MlekaraMain.cpp", MainForm);
USEFORM("c_poruka.cpp", frm_poruka);
USEFORM("dbUtility\Connection.cpp", DataModule1); /* TDataModule: File Type */
USEFORM("dbUtility\dbDm.cpp", db); /* TDataModule: File Type */
//---------------------------------------------------------------------------
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
try
{
Application->Initialize();
Application->MainFormOnTaskBar = true;
Application->CreateForm(__classid(TMainForm), &MainForm);
Application->CreateForm(__classid(TDataModule1), &DataModule1);
Application->CreateForm(__classid(Tdb), &db);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------
File added
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "MlekaraMain.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxClasses"
#pragma link "cxControls"
#pragma link "cxCustomData"
#pragma link "cxData"
#pragma link "cxDataStorage"
#pragma link "cxDBData"
#pragma link "cxEdit"
#pragma link "cxFilter"
#pragma link "cxGraphics"
#pragma link "cxGrid"
#pragma link "cxGridCustomTableView"
#pragma link "cxGridCustomView"
#pragma link "cxGridDBTableView"
#pragma link "cxGridLevel"
#pragma link "cxGridTableView"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxNavigator"
#pragma link "cxStyles"
#pragma link "dxSkinBlack"
#pragma link "dxSkinBlue"
#pragma link "dxSkinBlueprint"
#pragma link "dxSkinCaramel"
#pragma link "dxSkinCoffee"
#pragma link "dxSkinDarkRoom"
#pragma link "dxSkinDarkSide"
#pragma link "dxSkinDevExpressDarkStyle"
#pragma link "dxSkinDevExpressStyle"
#pragma link "dxSkinFoggy"
#pragma link "dxSkinGlassOceans"
#pragma link "dxSkinHighContrast"
#pragma link "dxSkiniMaginary"
#pragma link "dxSkinLilian"
#pragma link "dxSkinLiquidSky"
#pragma link "dxSkinLondonLiquidSky"
#pragma link "dxSkinMcSkin"
#pragma link "dxSkinMoneyTwins"
#pragma link "dxSkinOffice2007Black"
#pragma link "dxSkinOffice2007Blue"
#pragma link "dxSkinOffice2007Green"
#pragma link "dxSkinOffice2007Pink"
#pragma link "dxSkinOffice2007Silver"
#pragma link "dxSkinOffice2010Black"
#pragma link "dxSkinOffice2010Blue"
#pragma link "dxSkinOffice2010Silver"
#pragma link "dxSkinOffice2013White"
#pragma link "dxSkinPumpkin"
#pragma link "dxSkinsCore"
#pragma link "dxSkinscxPCPainter"
#pragma link "dxSkinsDefaultPainters"
#pragma link "dxSkinSeven"
#pragma link "dxSkinSevenClassic"
#pragma link "dxSkinSharp"
#pragma link "dxSkinSharpPlus"
#pragma link "dxSkinSilver"
#pragma link "dxSkinSpringTime"
#pragma link "dxSkinStardust"
#pragma link "dxSkinSummer2008"
#pragma link "dxSkinTheAsphaltWorld"
#pragma link "dxSkinValentine"
#pragma link "dxSkinVS2010"
#pragma link "dxSkinWhiteprint"
#pragma link "dxSkinXmas2008Blue"
#pragma link "cxGridChartView"
#pragma link "cxGridDBChartView"
#pragma link "cxContainer"
#pragma link "cxGridCardView"
#pragma link "cxGridCustomLayoutView"
#pragma link "cxGridDBCardView"
#pragma link "cxGroupBox"
#pragma link "cxPC"
#pragma link "cxPCdxBarPopupMenu"
#pragma link "frxClass"
#pragma link "cxCalendar"
#pragma link "cxDBEdit"
#pragma link "cxDropDownEdit"
#pragma link "cxLabel"
#pragma link "cxMaskEdit"
#pragma link "cxTextEdit"
#pragma link "cxButtons"
#pragma link "AdvDateTimePicker"
#pragma link "cxDBLookupComboBox"
#pragma link "cxDBLookupEdit"
#pragma link "cxLookupEdit"
#pragma link "frxDBSet"
#pragma resource "*.dfm"
TMainForm *MainForm;
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::btNewClick(TObject *Sender)
{
db->cdsArtikli->Append();
AdvDateTimePicker1->DateTime = Now();
AdvDateTimePicker2->DateTime = Now();
db->cdsArtikli->FieldByName("od")->AsDateTime = Now();
db->cdsArtikli->FieldByName("do")->AsDateTime = Now();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::btSaveClick(TObject *Sender)
{
db->cdsArtikli->Post();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormShow(TObject *Sender)
{
db->openArtikliCds();
db->dsArtikli->OnDataChange = &ArtikliDataChange;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::ArtikliDataChange(TObject *Sender, TField *Field)
{
if (Field == NULL) {
AdvDateTimePicker1->DateTime = db->cdsArtikli->FieldByName("od")->AsDateTime;
AdvDateTimePicker2->DateTime = db->cdsArtikli->FieldByName("do")->AsDateTime;
}
}
void __fastcall TMainForm::AdvDateTimePicker1Change(TObject *Sender)
{
db->cdsArtikli->FieldByName("od")->AsDateTime = AdvDateTimePicker1->DateTime;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::AdvDateTimePicker2Change(TObject *Sender)
{
db->cdsArtikli->FieldByName("do")->AsDateTime = AdvDateTimePicker2->DateTime;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::btPrintClick(TObject *Sender)
{
db->cdsStampa->Active = false;
db->sdsStampa->ParamByName("ID")->AsInteger = db->cdsArtikli->FieldByName("id_uredjaja")->AsInteger;
db->sdsStampa->ParamByName("D1")->AsDateTime = db->cdsArtikli->FieldByName("OD")->AsDateTime;
db->sdsStampa->ParamByName("D2")->AsDateTime = db->cdsArtikli->FieldByName("DO")->AsDateTime;
db->cdsStampa->Active = false;
if ( print->LoadFromFile( GetCurrentDir() + "\\Diagram_sa_artiklom.fr3" ) )
{
print->ShowReport( );
}
else
ShowMessage( "Ne postoji fajl: " + GetCurrentDir() + "\\Diagram_sa_artiklom.fr3" );
}
//---------------------------------------------------------------------------
object MainForm: TMainForm
Left = 0
Top = 0
Caption = 'MainForm'
ClientHeight = 638
ClientWidth = 1167
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object cxPageControl1: TcxPageControl
Left = 0
Top = 0
Width = 1167
Height = 638
Align = alClient
TabOrder = 0
Properties.ActivePage = cxTabSheet1
Properties.CustomButtons.Buttons = <>
ClientRectBottom = 638
ClientRectRight = 1167
ClientRectTop = 24
object cxTabSheet1: TcxTabSheet
Caption = 'Glavna'
ImageIndex = 0
object cxGrid1: TcxGrid
Left = 0
Top = 0
Width = 1167
Height = 264
Align = alClient
TabOrder = 0
object cxGrid1DBChartView1: TcxGridDBChartView
DataController.DataSource = db.dsMlekara
DiagramColumn.Active = True
Title.Text = 'Pregled svih uredjaja i njihovih maksimalnih vrednosti'
ToolBox.Border = tbNone
ToolBox.DiagramSelector = True
ToolBox.Position = tpBottom
object cxGrid1DBChartView1DataGroup1: TcxGridDBChartDataGroup
DataBinding.FieldName = 'id'
end
object cxGrid1DBChartView1Series1: TcxGridDBChartSeries
DataBinding.FieldName = 'temperatura'
GroupSummaryKind = skMax
end
end
object cxGrid1Level1: TcxGridLevel
GridView = cxGrid1DBChartView1
end
end
object cxGroupBox1: TcxGroupBox
Left = 0
Top = 264
Align = alBottom
Alignment = alCenterCenter
TabOrder = 1
Height = 350
Width = 1167
object cxGrid5: TcxGrid
Left = 2
Top = 2
Width = 290
Height = 346
Align = alLeft
TabOrder = 0
object cxGrid5DBChartView1: TcxGridDBChartView
DataController.DataSource = db.DataSource1
DiagramColumn.Active = True
DiagramColumn.Legend.Alignment = cpaEnd
DiagramColumn.Legend.Border = lbSingle
DiagramColumn.Legend.Position = cppLeft
Title.Alignment = cpaStart
Title.Text = 'Uzivo pregled za senzor 1'
Title.Position = cppTop
ToolBox.Border = tbNone
ToolBox.DiagramSelector = True
ToolBox.Position = tpBottom
object cxGrid5DBChartView1DataGroup1: TcxGridDBChartDataGroup
DataBinding.FieldName = 'vreme'
end
object cxGrid5DBChartView1Series1: TcxGridDBChartSeries
DataBinding.FieldName = 'C'
end
end
object cxGrid5Level1: TcxGridLevel
GridView = cxGrid5DBChartView1
end
end
object cxGrid4: TcxGrid
Left = 582
Top = 2
Width = 290
Height = 346
Align = alLeft
TabOrder = 1
object cxGrid4DBChartView1: TcxGridDBChartView
DataController.DataSource = db.DataSource3
DiagramArea.Active = True
DiagramColumn.Legend.Alignment = cpaEnd
DiagramColumn.Legend.Border = lbSingle
DiagramColumn.Legend.Position = cppLeft
Title.Alignment = cpaStart
Title.Text = 'Uzivo pregled za senzor 3'
Title.Position = cppTop
ToolBox.Border = tbNone
ToolBox.DiagramSelector = True
ToolBox.Position = tpBottom
object cxGrid4DBChartView1DataGroup1: TcxGridDBChartDataGroup
DataBinding.FieldName = 'vreme'
end
object cxGrid4DBChartView1Series1: TcxGridDBChartSeries
DataBinding.FieldName = 'C'
end
end
object cxGrid4Level1: TcxGridLevel
GridView = cxGrid4DBChartView1
end
end
object cxGrid3: TcxGrid
Left = 872
Top = 2
Width = 290
Height = 346
Align = alLeft
TabOrder = 2
object cxGrid3DBChartView1: TcxGridDBChartView
DataController.DataSource = db.DataSource4
DiagramArea.Active = True
DiagramColumn.Legend.Alignment = cpaEnd
DiagramColumn.Legend.Border = lbSingle
DiagramColumn.Legend.Position = cppLeft
Title.Alignment = cpaStart
Title.Text = 'Uzivo pregled za senzor 4'
Title.Position = cppTop
ToolBox.Border = tbNone
ToolBox.DiagramSelector = True
ToolBox.Position = tpBottom
object cxGrid3DBChartView1DataGroup1: TcxGridDBChartDataGroup
DataBinding.FieldName = 'vreme'
end
object cxGrid3DBChartView1Series1: TcxGridDBChartSeries
DataBinding.FieldName = 'C'
end
end
object cxGrid3Level1: TcxGridLevel
GridView = cxGrid3DBChartView1
end
end
object cxGrid2: TcxGrid
Left = 292
Top = 2
Width = 290
Height = 346
Align = alLeft
TabOrder = 3
object cxGrid2DBChartView1: TcxGridDBChartView
DataController.DataSource = db.DataSource2
DiagramArea.Active = True
DiagramColumn.Legend.Alignment = cpaEnd
DiagramColumn.Legend.Border = lbSingle
DiagramColumn.Legend.KeyBorder = lbSingle
DiagramColumn.Legend.Position = cppLeft
Title.Alignment = cpaStart
Title.Text = 'Uzivo pregled za senzor 2'
Title.Position = cppTop
ToolBox.Border = tbNone
ToolBox.DiagramSelector = True
ToolBox.Position = tpBottom
object cxGrid2DBChartView1DataGroup1: TcxGridDBChartDataGroup
DataBinding.FieldName = 'vreme'
end
object cxGrid2DBChartView1Series1: TcxGridDBChartSeries
DataBinding.FieldName = 'C'
end
end
object cxGrid2Level1: TcxGridLevel
GridView = cxGrid2DBChartView1
end
end
end
end
object cxTabSheet2: TcxTabSheet
Caption = 'Stampa'
ImageIndex = 1
object cxGroupBox2: TcxGroupBox
Left = 0
Top = 0
Align = alLeft
Alignment = alCenterCenter
TabOrder = 0
Transparent = True
Height = 614
Width = 361
object cxDBTextEdit1: TcxDBTextEdit
Left = 16
Top = 102
DataBinding.DataField = 'Artikal'
DataBinding.DataSource = db.dsArtikli
TabOrder = 0
Width = 305
end
object cxDBTextEdit2: TcxDBTextEdit
Left = 16
Top = 152
DataBinding.DataField = 'Kolicina'
DataBinding.DataSource = db.dsArtikli
TabOrder = 1
Width = 105
end
object cxLabel1: TcxLabel
Left = 16
Top = 79
Caption = 'Artikal'
Transparent = True
end
object cxLabel2: TcxLabel
Left = 16
Top = 129
Caption = 'Kolicina'
Transparent = True
end
object cxLabel3: TcxLabel
Left = 16
Top = 179
Caption = 'Datum i vreme od'
Transparent = True
end
object cxGroupBox4: TcxGroupBox
Left = 2
Top = 2
Align = alTop
Alignment = alCenterCenter
TabOrder = 5
Height = 55
Width = 357
object btPrint: TcxButton
Left = 236
Top = 2
Width = 117
Height = 51
Align = alLeft
Caption = 'Stampaj'
TabOrder = 0
OnClick = btPrintClick
end
object btSave: TcxButton
Left = 119
Top = 2
Width = 117
Height = 51
Align = alLeft
Caption = 'Snimi'
TabOrder = 1
OnClick = btSaveClick
end
object btNew: TcxButton
Left = 2
Top = 2
Width = 117
Height = 51
Align = alLeft
Caption = 'Novi'
TabOrder = 2
OnClick = btNewClick
end
end
object cxLabel4: TcxLabel
Left = 16
Top = 229
Caption = 'Datum i vreme do'
Transparent = True
end
object AdvDateTimePicker2: TAdvDateTimePicker
Left = 16
Top = 252
Width = 186
Height = 21
Date = 44160.096412037030000000
Format = ''
Time = 44160.096412037030000000
DoubleBuffered = True
Kind = dkDateTime
ParentDoubleBuffered = False
TabOrder = 7
OnChange = AdvDateTimePicker2Change
BorderStyle = bsSingle
Ctl3D = True
DateTime = 44160.096412037030000000
Version = '1.2.0.6'
LabelFont.Charset = DEFAULT_CHARSET
LabelFont.Color = clWindowText
LabelFont.Height = -11
LabelFont.Name = 'Tahoma'
LabelFont.Style = []
end
object Uredjaj: TcxLabel
Left = 16
Top = 279
Caption = 'Uredjaj'
Transparent = True
end
end
object cxGroupBox3: TcxGroupBox
Left = 361
Top = 0
Align = alClient
Alignment = alCenterCenter
TabOrder = 1
Height = 614
Width = 806
object cxGrid6: TcxGrid
Left = 2
Top = 2
Width = 802
Height = 610
Align = alClient
TabOrder = 0
object cxGrid6DBTableView1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
DataController.DataSource = db.dsArtikli
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnsQuickCustomization = True
OptionsData.CancelOnExit = False
OptionsData.Deleting = False
OptionsData.DeletingConfirmation = False
OptionsData.Editing = False
OptionsData.Inserting = False
OptionsView.GroupByBox = False
OptionsView.HeaderHeight = 50
object cxGrid6DBTableView1idArtikli: TcxGridDBColumn
DataBinding.FieldName = 'idArtikli'
end
object cxGrid6DBTableView1Artikal: TcxGridDBColumn
DataBinding.FieldName = 'Artikal'
Width = 187
end
object cxGrid6DBTableView1Kolicina: TcxGridDBColumn
DataBinding.FieldName = 'Kolicina'
Width = 75
end
object cxGrid6DBTableView1od: TcxGridDBColumn
DataBinding.FieldName = 'od'
end
object cxGrid6DBTableView1do: TcxGridDBColumn
DataBinding.FieldName = 'do'
end
end
object cxGrid6Level1: TcxGridLevel
GridView = cxGrid6DBTableView1
end
end
end
end
end
object AdvDateTimePicker1: TAdvDateTimePicker
Left = 16
Top = 226
Width = 186
Height = 21
Date = 44160.096412037030000000
Format = ''
Time = 44160.096412037030000000
DoubleBuffered = True
Kind = dkDateTime
ParentDoubleBuffered = False
TabOrder = 1
OnChange = AdvDateTimePicker1Change
BorderStyle = bsSingle
Ctl3D = True
DateTime = 44160.096412037030000000
Version = '1.2.0.6'
LabelFont.Charset = DEFAULT_CHARSET
LabelFont.Color = clWindowText
LabelFont.Height = -11
LabelFont.Name = 'Tahoma'
LabelFont.Style = []
end
object cxDBLookupComboBox1: TcxDBLookupComboBox
Left = 16
Top = 326
DataBinding.DataField = 'id_uredjaja'
DataBinding.DataSource = db.dsArtikli
Properties.KeyFieldNames = 'id'
Properties.ListColumns = <
item
FieldName = 'id'
end>
Properties.ListSource = db.dsUredjaj
TabOrder = 2
Width = 88
end
object print: TfrxReport
Version = '4.15'
DotMatrixReport = False
IniFile = '\Software\Fast Reports'
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
PreviewOptions.Zoom = 1.000000000000000000
PrintOptions.Printer = 'Default'
PrintOptions.PrintOnSheet = 0
ReportOptions.CreateDate = 44160.455634942100000000
ReportOptions.LastChange = 44160.681096701390000000
ScriptLanguage = 'PascalScript'
ScriptText.Strings = (
'begin'
''
'end.')
Left = 928
Top = 120
Datasets = <
item
DataSet = frxDBArtikal
DataSetName = 'frxArtikal'
end
item
DataSet = frxDBDPrint
DataSetName = 'frxDiag'
end>
Variables = <>
Style = <>
object Data: TfrxDataPage
Height = 1000.000000000000000000
Width = 1000.000000000000000000
end
object Page1: TfrxReportPage
PaperWidth = 215.900000000000000000
PaperHeight = 279.400000000000000000
PaperSize = 1
LeftMargin = 10.000000000000000000
RightMargin = 10.000000000000000000
TopMargin = 10.000000000000000000
BottomMargin = 10.000000000000000000
object Chart1: TfrxChartView
Left = 3.779530000000000000
Top = 15.118120000000000000
Width = 714.331170000000000000
Height = 396.850650000000000000
ShowHint = False
Chart = {
5450463006544368617274054368617274044C656674020003546F7002000557
696474680390010648656967687403FA00144261636B57616C6C2E50656E2E56
697369626C65080B4178697356697369626C650825426F74746F6D417869732E
4C6162656C73466F726D61742E54657874416C69676E6D656E74070874614365
6E746572244465707468417869732E4C6162656C73466F726D61742E54657874
416C69676E6D656E740708746143656E746572274465707468546F7041786973
2E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143
656E7465720D4672616D652E56697369626C6508234C656674417869732E4C61
62656C73466F726D61742E54657874416C69676E6D656E740708746143656E74
6572245269676874417869732E4C6162656C73466F726D61742E54657874416C
69676E6D656E740708746143656E74657222546F70417869732E4C6162656C73
466F726D61742E54657874416C69676E6D656E740708746143656E7465720656
696577334408175669657733444F7074696F6E732E456C65766174696F6E033B
01185669657733444F7074696F6E732E4F7274686F676F6E616C081956696577
33444F7074696F6E732E50657273706563746976650200165669657733444F70
74696F6E732E526F746174696F6E0368010B56696577334457616C6C73080D5A
6F6F6D2E50656E2E4D6F64650708706D4E6F74586F720A426576656C4F757465
72070662764E6F6E6505436F6C6F720707636C57686974650D44656661756C74
43616E766173060E54474449506C757343616E76617311436F6C6F7250616C65
747465496E646578020D000A5450696553657269657307536572696573310D4D
61726B732E56697369626C65090D5856616C7565732E4F72646572070B6C6F41
7363656E64696E670C5956616C7565732E4E616D6506035069650D5956616C75
65732E4F7264657207066C6F4E6F6E651A4672616D652E496E6E657242727573
682E4261636B436F6C6F720705636C526564224672616D652E496E6E65724272
7573682E4772616469656E742E456E64436F6C6F720706636C47726179224672
616D652E496E6E657242727573682E4772616469656E742E4D6964436F6C6F72
0707636C5768697465244672616D652E496E6E657242727573682E4772616469
656E742E5374617274436F6C6F720440404000214672616D652E496E6E657242
727573682E4772616469656E742E56697369626C65091B4672616D652E4D6964
646C6542727573682E4261636B436F6C6F720708636C59656C6C6F7723467261
6D652E4D6964646C6542727573682E4772616469656E742E456E64436F6C6F72
0482828200234672616D652E4D6964646C6542727573682E4772616469656E74
2E4D6964436F6C6F720707636C5768697465254672616D652E4D6964646C6542
727573682E4772616469656E742E5374617274436F6C6F720706636C47726179
224672616D652E4D6964646C6542727573682E4772616469656E742E56697369
626C65091A4672616D652E4F7574657242727573682E4261636B436F6C6F7207
07636C477265656E224672616D652E4F7574657242727573682E477261646965
6E742E456E64436F6C6F720440404000224672616D652E4F7574657242727573
682E4772616469656E742E4D6964436F6C6F720707636C576869746524467261
6D652E4F7574657242727573682E4772616469656E742E5374617274436F6C6F
720708636C53696C766572214672616D652E4F7574657242727573682E477261
6469656E742E56697369626C65090B4672616D652E57696474680204194F7468
6572536C6963652E4C6567656E642E56697369626C6508000000}
ChartElevation = 315
SeriesData = <
item
DataType = dtDBData
DataSet = frxDBDPrint
DataSetName = 'frxDiag'
SortOrder = soNone
TopN = 0
XType = xtText
Source1 = 'frxDiag."temperatura"'
Source2 = 'frxDiag."vreme"'
Source3 = 'frxDiag."temperatura"'
XSource = 'frxDiag."temperatura"'
YSource = 'frxDiag."vreme"'
end>
end
end
end
object frxDBDPrint: TfrxDBDataset
UserName = 'frxDiag'
CloseDataSource = False
FieldAliases.Strings = (
'temperatura=temperatura'
'vreme=vreme')
DataSource = db.dsStampa
BCDToCurrency = False
Left = 928
Top = 176
end
object frxDBArtikal: TfrxDBDataset
UserName = 'frxArtikal'
CloseDataSource = False
DataSource = db.dsArtikli
BCDToCurrency = False
Left = 936
Top = 232
end
end
//---------------------------------------------------------------------------
#ifndef MlekaraMainH
#define MlekaraMainH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
//USER INCLUDE
#include "dbDm.h"
#include "cxClasses.hpp"
#include "cxControls.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.hpp"
#include "cxDBData.hpp"
#include "cxEdit.hpp"
#include "cxFilter.hpp"
#include "cxGraphics.hpp"
#include "cxGrid.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridDBTableView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxNavigator.hpp"
#include "cxStyles.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinBlueprint.hpp"
#include "dxSkinCaramel.hpp"
#include "dxSkinCoffee.hpp"
#include "dxSkinDarkRoom.hpp"
#include "dxSkinDarkSide.hpp"
#include "dxSkinDevExpressDarkStyle.hpp"
#include "dxSkinDevExpressStyle.hpp"
#include "dxSkinFoggy.hpp"
#include "dxSkinGlassOceans.hpp"
#include "dxSkinHighContrast.hpp"
#include "dxSkiniMaginary.hpp"
#include "dxSkinLilian.hpp"
#include "dxSkinLiquidSky.hpp"
#include "dxSkinLondonLiquidSky.hpp"
#include "dxSkinMcSkin.hpp"
#include "dxSkinMoneyTwins.hpp"
#include "dxSkinOffice2007Black.hpp"
#include "dxSkinOffice2007Blue.hpp"
#include "dxSkinOffice2007Green.hpp"
#include "dxSkinOffice2007Pink.hpp"
#include "dxSkinOffice2007Silver.hpp"
#include "dxSkinOffice2010Black.hpp"
#include "dxSkinOffice2010Blue.hpp"
#include "dxSkinOffice2010Silver.hpp"
#include "dxSkinOffice2013White.hpp"
#include "dxSkinPumpkin.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "dxSkinsDefaultPainters.hpp"
#include "dxSkinSeven.hpp"
#include "dxSkinSevenClassic.hpp"
#include "dxSkinSharp.hpp"
#include "dxSkinSharpPlus.hpp"
#include "dxSkinSilver.hpp"
#include "dxSkinSpringTime.hpp"
#include "dxSkinStardust.hpp"
#include "dxSkinSummer2008.hpp"
#include "dxSkinTheAsphaltWorld.hpp"
#include "dxSkinValentine.hpp"
#include "dxSkinVS2010.hpp"
#include "dxSkinWhiteprint.hpp"
#include "dxSkinXmas2008Blue.hpp"
#include <Data.DB.hpp>
#include "cxGridChartView.hpp"
#include "cxGridDBChartView.hpp"
#include "cxContainer.hpp"
#include "cxGridCardView.hpp"
#include "cxGridCustomLayoutView.hpp"
#include "cxGridDBCardView.hpp"
#include "cxGroupBox.hpp"
#include "cxPC.hpp"
#include "cxPCdxBarPopupMenu.hpp"
#include "frxClass.hpp"
#include "cxCalendar.hpp"
#include "cxDBEdit.hpp"
#include "cxDropDownEdit.hpp"
#include "cxLabel.hpp"
#include "cxMaskEdit.hpp"
#include "cxTextEdit.hpp"
#include "cxButtons.hpp"
#include <Vcl.Menus.hpp>
#include <Vcl.ComCtrls.hpp>
#include "AdvDateTimePicker.hpp"
#include "cxDBLookupComboBox.hpp"
#include "cxDBLookupEdit.hpp"
#include "cxLookupEdit.hpp"
#include "frxDBSet.hpp"
//---------------------------------------------------------------------------
class TMainForm : public TForm
{
__published: // IDE-managed Components
TfrxReport *print;
TcxPageControl *cxPageControl1;
TcxTabSheet *cxTabSheet1;
TcxTabSheet *cxTabSheet2;
TcxGrid *cxGrid1;
TcxGridDBChartView *cxGrid1DBChartView1;
TcxGridDBChartDataGroup *cxGrid1DBChartView1DataGroup1;
TcxGridDBChartSeries *cxGrid1DBChartView1Series1;
TcxGridLevel *cxGrid1Level1;
TcxGroupBox *cxGroupBox1;
TcxGrid *cxGrid5;
TcxGridDBChartView *cxGrid5DBChartView1;
TcxGridDBChartDataGroup *cxGrid5DBChartView1DataGroup1;
TcxGridDBChartSeries *cxGrid5DBChartView1Series1;
TcxGridLevel *cxGrid5Level1;
TcxGrid *cxGrid4;
TcxGridDBChartView *cxGrid4DBChartView1;
TcxGridDBChartDataGroup *cxGrid4DBChartView1DataGroup1;
TcxGridDBChartSeries *cxGrid4DBChartView1Series1;
TcxGridLevel *cxGrid4Level1;
TcxGrid *cxGrid3;
TcxGridDBChartView *cxGrid3DBChartView1;
TcxGridDBChartDataGroup *cxGrid3DBChartView1DataGroup1;
TcxGridDBChartSeries *cxGrid3DBChartView1Series1;
TcxGridLevel *cxGrid3Level1;
TcxGrid *cxGrid2;
TcxGridDBChartView *cxGrid2DBChartView1;
TcxGridDBChartDataGroup *cxGrid2DBChartView1DataGroup1;
TcxGridDBChartSeries *cxGrid2DBChartView1Series1;
TcxGridLevel *cxGrid2Level1;
TcxGroupBox *cxGroupBox2;
TcxGroupBox *cxGroupBox3;
TcxDBTextEdit *cxDBTextEdit1;
TcxDBTextEdit *cxDBTextEdit2;
TcxLabel *cxLabel1;
TcxLabel *cxLabel2;
TcxLabel *cxLabel3;
TcxGroupBox *cxGroupBox4;
TcxButton *btPrint;
TcxButton *btSave;
TcxButton *btNew;
TcxGrid *cxGrid6;
TcxGridDBTableView *cxGrid6DBTableView1;
TcxGridLevel *cxGrid6Level1;
TcxGridDBColumn *cxGrid6DBTableView1idArtikli;
TcxGridDBColumn *cxGrid6DBTableView1Artikal;
TcxGridDBColumn *cxGrid6DBTableView1Kolicina;
TcxGridDBColumn *cxGrid6DBTableView1od;
TcxGridDBColumn *cxGrid6DBTableView1do;
TcxLabel *cxLabel4;
TAdvDateTimePicker *AdvDateTimePicker1;
TAdvDateTimePicker *AdvDateTimePicker2;
TcxLabel *Uredjaj;
TcxDBLookupComboBox *cxDBLookupComboBox1;
TfrxDBDataset *frxDBDPrint;
TfrxDBDataset *frxDBArtikal;
void __fastcall btNewClick(TObject *Sender);
void __fastcall btSaveClick(TObject *Sender);
void __fastcall FormShow(TObject *Sender);
void __fastcall AdvDateTimePicker1Change(TObject *Sender);
void __fastcall AdvDateTimePicker2Change(TObject *Sender);
void __fastcall btPrintClick(TObject *Sender);
private: // User declarations
Tdb *dbGets;
void __fastcall TMainForm::ArtikliDataChange(TObject *Sender, TField *Field);
public: // User declarations
__fastcall TMainForm(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TMainForm *MainForm;
//---------------------------------------------------------------------------
#endif
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<TfrxReport Version="4.15" DotMatrixReport="False" IniFile="\Software\Fast Reports" PreviewOptions.Buttons="4095" PreviewOptions.Zoom="1" PrintOptions.Printer="Default" PrintOptions.PrintOnSheet="0" ReportOptions.CreateDate="44160.4556349421" ReportOptions.Description.Text="" ReportOptions.LastChange="44160.6799266898" ScriptLanguage="PascalScript" ScriptText.Text="begin&#13;&#10;&#13;&#10;end." PropData="044C65667403A00303546F7002780844617461736574730101063020446174615365743D226672784442417274696B616C2220446174615365744E616D653D22667278417274696B616C220001062C20446174615365743D226672784442445072696E742220446174615365744E616D653D2266727844696167220000095661726961626C65730100055374796C650100">
<TfrxDataPage Name="Data" Height="1000" Left="0" Top="0" Width="1000"/>
<TfrxReportPage Name="Page1" PaperWidth="215.9" PaperHeight="279.4" PaperSize="1" LeftMargin="10" RightMargin="10" TopMargin="10" BottomMargin="10" ColumnWidth="0" ColumnPositions.Text="" HGuides.Text="" VGuides.Text="">
<TfrxChartView Name="Chart1" Left="3.77953" Top="15.11812" Width="714.33117" Height="396.85065" ShowHint="False" PropData="0543686172740A520500005450463006544368617274054368617274044C656674020003546F7002000557696474680390010648656967687403FA00144261636B57616C6C2E50656E2E56697369626C65080B4178697356697369626C650825426F74746F6D417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E746572244465707468417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E746572274465707468546F70417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E7465720D4672616D652E56697369626C6508234C656674417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E746572245269676874417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E74657222546F70417869732E4C6162656C73466F726D61742E54657874416C69676E6D656E740708746143656E746572175669657733444F7074696F6E732E456C65766174696F6E033B01185669657733444F7074696F6E732E4F7274686F676F6E616C08195669657733444F7074696F6E732E50657273706563746976650200165669657733444F7074696F6E732E526F746174696F6E0368010B56696577334457616C6C73080D5A6F6F6D2E50656E2E4D6F64650708706D4E6F74586F720A426576656C4F75746572070662764E6F6E6505436F6C6F720707636C57686974650D44656661756C7443616E766173060E54474449506C757343616E76617311436F6C6F7250616C65747465496E646578020D000A5450696553657269657307536572696573310D4D61726B732E56697369626C65090D5856616C7565732E4F72646572070B6C6F417363656E64696E670C5956616C7565732E4E616D6506035069650D5956616C7565732E4F7264657207066C6F4E6F6E651A4672616D652E496E6E657242727573682E4261636B436F6C6F720705636C526564224672616D652E496E6E657242727573682E4772616469656E742E456E64436F6C6F720706636C47726179224672616D652E496E6E657242727573682E4772616469656E742E4D6964436F6C6F720707636C5768697465244672616D652E496E6E657242727573682E4772616469656E742E5374617274436F6C6F720440404000214672616D652E496E6E657242727573682E4772616469656E742E56697369626C65091B4672616D652E4D6964646C6542727573682E4261636B436F6C6F720708636C59656C6C6F77234672616D652E4D6964646C6542727573682E4772616469656E742E456E64436F6C6F720482828200234672616D652E4D6964646C6542727573682E4772616469656E742E4D6964436F6C6F720707636C5768697465254672616D652E4D6964646C6542727573682E4772616469656E742E5374617274436F6C6F720706636C47726179224672616D652E4D6964646C6542727573682E4772616469656E742E56697369626C65091A4672616D652E4F7574657242727573682E4261636B436F6C6F720707636C477265656E224672616D652E4F7574657242727573682E4772616469656E742E456E64436F6C6F720440404000224672616D652E4F7574657242727573682E4772616469656E742E4D6964436F6C6F720707636C5768697465244672616D652E4F7574657242727573682E4772616469656E742E5374617274436F6C6F720708636C53696C766572214672616D652E4F7574657242727573682E4772616469656E742E56697369626C65090B4672616D652E57696474680204194F74686572536C6963652E4C6567656E642E56697369626C65080000000E4368617274456C65766174696F6E033B010A5365726965734461746101010C270100002044617461547970653D2264744442446174612220446174615365743D226672784442445072696E742220446174615365744E616D653D22667278446961672220536F72744F726465723D22736F4E6F6E652220546F704E3D2230222058547970653D227874546578742220536F75726365313D22667278446961672E262333343B74656D7065726174757261262333343B2220536F75726365323D22667278446961672E262333343B7672656D65262333343B2220536F75726365333D22667278446961672E262333343B74656D7065726174757261262333343B222058536F757263653D22667278446961672E262333343B74656D7065726174757261262333343B222059536F757263653D22667278446961672E262333343B7672656D65262333343B220000"/>
</TfrxReportPage>
</TfrxReport>
11/25/2020 2:03:50 PM Radnik: - -pocetak-
11/25/2020 2:03:50 PM Radnik: - Broj gresaka=1 cdsArtikli
11/25/2020 2:03:50 PM Radnik: - 11/25/2020 2:03:50 PM - DataSet: cdsArtikli -Radnik: - Greska:
11/25/2020 2:03:50 PM Radnik: - INSERT INTO cdsArtikli
11/25/2020 2:03:50 PM Radnik: - (idArtikli,Artikal,Kolicina,od,do)
11/25/2020 2:03:50 PM Radnik: - VALUES (1,'Test',12.3000001907349,'11/19/2020 1:46:52 PM',NULL)
11/25/2020 2:03:50 PM Radnik: - -kraj-
11/25/2020 2:04:22 PM Radnik: - -pocetak-
11/25/2020 2:04:22 PM Radnik: - Broj gresaka=1 cdsArtikli
11/25/2020 2:04:22 PM Radnik: - 11/25/2020 2:04:22 PM - DataSet: cdsArtikli -Radnik: - Greska:
11/25/2020 2:04:22 PM Radnik: - INSERT INTO cdsArtikli
11/25/2020 2:04:22 PM Radnik: - (idArtikli,Artikal,Kolicina,od,do)
11/25/2020 2:04:22 PM Radnik: - VALUES (2,'dadaee',123,'11/14/2020',NULL)
11/25/2020 2:04:22 PM Radnik: - -kraj-
11/25/2020 2:30:04 PM Radnik: - -pocetak-
11/25/2020 2:30:04 PM Radnik: - Broj gresaka=1 cdsArtikli
11/25/2020 2:30:04 PM Radnik: - 11/25/2020 2:30:04 PM - DataSet: cdsArtikli -Radnik: - Greska:
11/25/2020 2:30:04 PM Radnik: - INSERT INTO cdsArtikli
11/25/2020 2:30:04 PM Radnik: - (idArtikli,Artikal,Kolicina,od,do)
11/25/2020 2:30:04 PM Radnik: - VALUES (NULL,NULL,NULL,NULL,NULL)
11/25/2020 2:30:04 PM Radnik: - -kraj-
11/25/2020 2:42:24 PM Radnik: - -pocetak-
11/25/2020 2:42:24 PM Radnik: - Broj gresaka=1 cdsArtikli
11/25/2020 2:42:24 PM Radnik: - 11/25/2020 2:42:24 PM - DataSet: cdsArtikli -Radnik: - Greska:
11/25/2020 2:42:24 PM Radnik: - INSERT INTO cdsArtikli
11/25/2020 2:42:24 PM Radnik: - (idArtikli,Artikal,Kolicina,od,do,id_uredjaja)
11/25/2020 2:42:24 PM Radnik: - VALUES (12,'testera',12.3299999237061,'11/12/2020 2:45:22 PM','11/25/2020 2:41:22 PM',1)
11/25/2020 2:42:24 PM Radnik: - -kraj-
11/25/2020 3:25:15 PM Radnik: - -pocetak-
11/25/2020 3:25:15 PM Radnik: - Broj gresaka=1 cdsArtikli
11/25/2020 3:25:15 PM Radnik: - 11/25/2020 3:25:15 PM - DataSet: cdsArtikli -Radnik: - Greska:
11/25/2020 3:25:15 PM Radnik: - INSERT INTO cdsArtikli
11/25/2020 3:25:15 PM Radnik: - (idArtikli,Artikal,Kolicina,od,do,id_uredjaja)
11/25/2020 3:25:15 PM Radnik: - VALUES (1,'Test',12.3000001907349,'11/25/2020 1:46:52 PM','11/25/2020 12:01:00 AM',1)
11/25/2020 3:25:15 PM Radnik: - -kraj-
11/25/2020 4:11:11 PM Radnik: - -pocetak-
11/25/2020 4:11:11 PM Radnik: - Broj gresaka=1 cdsArtikli
11/25/2020 4:11:11 PM Radnik: - 11/25/2020 4:11:11 PM - DataSet: cdsArtikli -Radnik: - Greska:
11/25/2020 4:11:11 PM Radnik: - INSERT INTO cdsArtikli
11/25/2020 4:11:11 PM Radnik: - (idArtikli,Artikal,Kolicina,od,do,id_uredjaja)
11/25/2020 4:11:11 PM Radnik: - VALUES (7,'deerane',12.3000001907349,'11/25/2020 5:53:00 AM','11/25/2020 12:10:00 AM',2)
11/25/2020 4:11:11 PM Radnik: - -kraj-
Start Length Name Class
0001:00401000 0000097BCH _TEXT CODE
0002:0040B000 000003390H _DATA DATA
0003:0040E390 0000001C8H _BSS BSS
0004:00000000 00000009CH _TLS TLS
cxPageControldxBarPopupMenuRS19.bpl
dxBarRS19.bpl
dxSkinXmas2008BlueRS19.bpl
dxSkinWhiteprintRS19.bpl
dxSkinVS2010RS19.bpl
dxSkinValentineRS19.bpl
dxSkinTheAsphaltWorldRS19.bpl
dxSkinSummer2008RS19.bpl
dxSkinStardustRS19.bpl
dxSkinSpringTimeRS19.bpl
dxSkinSilverRS19.bpl
dxSkinSharpRS19.bpl
dxSkinSharpPlusRS19.bpl
dxSkinSevenRS19.bpl
dxSkinSevenClassicRS19.bpl
dxSkinPumpkinRS19.bpl
dxSkinOffice2013WhiteRS19.bpl
dxSkinOffice2010SilverRS19.bpl
dxSkinOffice2010BlueRS19.bpl
dxSkinOffice2010BlackRS19.bpl
dxSkinOffice2007SilverRS19.bpl
dxSkinOffice2007PinkRS19.bpl
dxSkinOffice2007GreenRS19.bpl
dxSkinOffice2007BlueRS19.bpl
dxSkinOffice2007BlackRS19.bpl
dxSkinMoneyTwinsRS19.bpl
dxSkinMcSkinRS19.bpl
dxSkinLondonLiquidSkyRS19.bpl
dxSkinLiquidSkyRS19.bpl
dxSkinLilianRS19.bpl
dxSkiniMaginaryRS19.bpl
dxSkinHighContrastRS19.bpl
dxSkinGlassOceansRS19.bpl
dxSkinFoggyRS19.bpl
dxSkinDevExpressStyleRS19.bpl
dxSkinDevExpressDarkStyleRS19.bpl
dxSkinDarkSideRS19.bpl
dxSkinDarkRoomRS19.bpl
dxSkinCoffeeRS19.bpl
dxSkinCaramelRS19.bpl
dxSkinBlueRS19.bpl
dxSkinBlueprintRS19.bpl
dxSkinBlackRS19.bpl
dxSkinscxPCPainterRS19.bpl
cxPageControlRS19.bpl
cxDataRS19.bpl
dxGDIPlusRS19.bpl
dxThemeRS19.bpl
dxCoreRS19.bpl
dsnap190.bpl
DBXMySQLDriver190.bpl
DbxCommonDriver190.bpl
dbexpress190.bpl
dbrtl190.bpl
rtl190.bpl
fqb190.bpl
fsDB19.bpl
frxDB19.bpl
VclSmp190.bpl
vclactnband190.bpl
adortl190.bpl
tmsdXE5.bpl
IndySystem190.bpl
bdertl190.bpl
fs19.bpl
frx19.bpl
dxSkinsCoreRS19.bpl
dxServerModeRS19.bpl
xmlrtl190.bpl
cxExportRS19.bpl
dxComnRS19.bpl
dxLayoutControlRS19.bpl
cxGridRS19.bpl
vcldb190.bpl
vclimg190.bpl
cxEditorsRS19.bpl
vclx190.bpl
cxLibraryRS19.bpl
vcl190.bpl
// ---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "c_poruka.h"
// ---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxContainer"
#pragma link "cxControls"
#pragma link "cxEdit"
#pragma link "cxGraphics"
#pragma link "cxLabel"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxButtons"
#pragma link "dxSkinBlack"
#pragma link "dxSkinBlue"
#pragma link "dxSkinBlueprint"
#pragma link "dxSkinCaramel"
#pragma link "dxSkinCoffee"
#pragma link "dxSkinDarkRoom"
#pragma link "dxSkinDarkSide"
#pragma link "dxSkinDevExpressDarkStyle"
#pragma link "dxSkinDevExpressStyle"
#pragma link "dxSkinFoggy"
#pragma link "dxSkinGlassOceans"
#pragma link "dxSkinHighContrast"
#pragma link "dxSkiniMaginary"
#pragma link "dxSkinLilian"
#pragma link "dxSkinLiquidSky"
#pragma link "dxSkinLondonLiquidSky"
#pragma link "dxSkinMcSkin"
#pragma link "dxSkinMoneyTwins"
#pragma link "dxSkinOffice2007Black"
#pragma link "dxSkinOffice2007Blue"
#pragma link "dxSkinOffice2007Green"
#pragma link "dxSkinOffice2007Pink"
#pragma link "dxSkinOffice2007Silver"
#pragma link "dxSkinOffice2010Black"
#pragma link "dxSkinOffice2010Blue"
#pragma link "dxSkinOffice2010Silver"
#pragma link "dxSkinOffice2013White"
#pragma link "dxSkinPumpkin"
#pragma link "dxSkinsCore"
#pragma link "dxSkinsDefaultPainters"
#pragma link "dxSkinSeven"
#pragma link "dxSkinSevenClassic"
#pragma link "dxSkinSharp"
#pragma link "dxSkinSharpPlus"
#pragma link "dxSkinSilver"
#pragma link "dxSkinSpringTime"
#pragma link "dxSkinStardust"
#pragma link "dxSkinSummer2008"
#pragma link "dxSkinTheAsphaltWorld"
#pragma link "dxSkinValentine"
#pragma link "dxSkinVS2010"
#pragma link "dxSkinWhiteprint"
#pragma link "dxSkinXmas2008Blue"
#pragma resource "*.dfm"
// Tfrm_poruka *frm_poruka;
// ---------------------------------------------------------------------------
__fastcall Tfrm_poruka::Tfrm_poruka(TComponent* Owner)
:TForm(Owner)
{
}
// ---------------------------------------------------------------------------
__fastcall Tfrm_poruka::Tfrm_poruka(AnsiString poruka, TComponent* Owner)
:TForm(Owner)
{
Application->ProcessMessages();
lblPoruka->Caption = poruka;
}
// ---------------------------------------------------------------------------
__fastcall Tfrm_poruka::Tfrm_poruka(AnsiString poruka, TColor boja, TComponent* Owner)
:TForm(Owner)
{
Application->ProcessMessages();
lblPoruka->Caption = poruka;
Color = boja;
}
// ---------------------------------------------------------------------------
void __fastcall Tfrm_poruka::FormClose(TObject* Sender, TCloseAction& Action)
{
Action = caFree;
}
// ---------------------------------------------------------------------------
void __fastcall Tfrm_poruka::Timer1Timer(TObject* Sender)
{
btnOkClick(this);
}
// ---------------------------------------------------------------------------
void __fastcall Tfrm_poruka::FormCreate(TObject* Sender)
{
// frm_poruka->Left = 350;
// frm_poruka->Top = 350;
}
// ---------------------------------------------------------------------------
void __fastcall Tfrm_poruka::btnOkClick(TObject* Sender)
{
Close();
}
// ---------------------------------------------------------------------------
void __fastcall Tfrm_poruka::FormActivate(TObject* Sender)
{
Left = Screen->DesktopWidth - 400;
Top = Screen->DesktopHeight - 300;
}
// ---------------------------------------------------------------------------
object frm_poruka: Tfrm_poruka
Left = 200
Top = 200
ParentCustomHint = False
AlphaBlend = True
AlphaBlendValue = 200
BiDiMode = bdLeftToRight
BorderStyle = bsNone
Caption = 'Poruka'
ClientHeight = 208
ClientWidth = 400
Color = 8905208
TransparentColorValue = clBtnShadow
DragKind = dkDock
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
FormStyle = fsStayOnTop
OldCreateOrder = False
ParentBiDiMode = False
Position = poScreenCenter
OnActivate = FormActivate
OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
AlignWithMargins = True
Left = 5
Top = 5
Width = 390
Height = 198
Margins.Left = 5
Margins.Top = 5
Margins.Right = 5
Margins.Bottom = 5
Align = alClient
BevelOuter = bvNone
Caption = 'Panel1'
Color = 8976369
ParentBackground = False
TabOrder = 2
end
object lblPoruka: TcxLabel
AlignWithMargins = True
Left = 20
Top = 20
Margins.Left = 20
Margins.Top = 20
Margins.Right = 20
Margins.Bottom = 20
Align = alClient
AutoSize = False
Caption = 'Poruka - nebitna '
ParentColor = False
ParentFont = False
Style.Color = 8976369
Style.Font.Charset = DEFAULT_CHARSET
Style.Font.Color = clWindowText
Style.Font.Height = -24
Style.Font.Name = 'Tahoma'
Style.Font.Style = []
Style.IsFontAssigned = True
Properties.WordWrap = True
Height = 168
Width = 360
end
object btnOk: TcxButton
Left = 311
Top = 170
Width = 75
Height = 25
Caption = 'OK'
TabOrder = 0
DragMode = dmAutomatic
OnClick = btnOkClick
end
object Timer1: TTimer
Interval = 3000
OnTimer = Timer1Timer
Top = 56
end
end
// ---------------------------------------------------------------------------
#ifndef c_porukaH
#define c_porukaH
// ---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxEdit.hpp"
#include "cxGraphics.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include <ExtCtrls.hpp>
#include "cxButtons.hpp"
#include <Menus.hpp>
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinBlueprint.hpp"
#include "dxSkinCaramel.hpp"
#include "dxSkinCoffee.hpp"
#include "dxSkinDarkRoom.hpp"
#include "dxSkinDarkSide.hpp"
#include "dxSkinDevExpressDarkStyle.hpp"
#include "dxSkinDevExpressStyle.hpp"
#include "dxSkinFoggy.hpp"
#include "dxSkinGlassOceans.hpp"
#include "dxSkinHighContrast.hpp"
#include "dxSkiniMaginary.hpp"
#include "dxSkinLilian.hpp"
#include "dxSkinLiquidSky.hpp"
#include "dxSkinLondonLiquidSky.hpp"
#include "dxSkinMcSkin.hpp"
#include "dxSkinMoneyTwins.hpp"
#include "dxSkinOffice2007Black.hpp"
#include "dxSkinOffice2007Blue.hpp"
#include "dxSkinOffice2007Green.hpp"
#include "dxSkinOffice2007Pink.hpp"
#include "dxSkinOffice2007Silver.hpp"
#include "dxSkinOffice2010Black.hpp"
#include "dxSkinOffice2010Blue.hpp"
#include "dxSkinOffice2010Silver.hpp"
#include "dxSkinOffice2013White.hpp"
#include "dxSkinPumpkin.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinsDefaultPainters.hpp"
#include "dxSkinSeven.hpp"
#include "dxSkinSevenClassic.hpp"
#include "dxSkinSharp.hpp"
#include "dxSkinSharpPlus.hpp"
#include "dxSkinSilver.hpp"
#include "dxSkinSpringTime.hpp"
#include "dxSkinStardust.hpp"
#include "dxSkinSummer2008.hpp"
#include "dxSkinTheAsphaltWorld.hpp"
#include "dxSkinValentine.hpp"
#include "dxSkinVS2010.hpp"
#include "dxSkinWhiteprint.hpp"
#include "dxSkinXmas2008Blue.hpp"
// ---------------------------------------------------------------------------
class Tfrm_poruka:public TForm
{
__published: // IDE-managed Components
TcxLabel* lblPoruka;
TTimer* Timer1;
TcxButton* btnOk;
TPanel* Panel1;
void __fastcall FormClose(TObject* Sender, TCloseAction& Action);
void __fastcall Timer1Timer(TObject* Sender);
void __fastcall FormCreate(TObject* Sender);
void __fastcall btnOkClick(TObject* Sender);
void __fastcall FormActivate(TObject* Sender);
private: // User declarations
public: // User declarations
__fastcall Tfrm_poruka(TComponent* Owner);
__fastcall Tfrm_poruka(AnsiString poruka, TComponent* Owner);
__fastcall Tfrm_poruka(AnsiString poruka, TColor boja, TComponent* Owner);
};
// ---------------------------------------------------------------------------
// extern PACKAGE Tfrm_poruka *frm_poruka;
// ---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#pragma hdrstop
#include "Connection.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
TDataModule1 *DataModule1;
//---------------------------------------------------------------------------
__fastcall TDataModule1::TDataModule1(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
object DataModule1: TDataModule1
OldCreateOrder = False
Height = 114
Width = 179
object mysql: TSQLConnection
ConnectionName = 'MySQLConnection'
DriverName = 'MySQL'
LoginPrompt = False
Params.Strings = (
'DriverUnit=Data.DBXMySQL'
'DriverPackageLoader=TDBXDynalinkDriverLoader,DbxCommonDriver190.' +
'bpl'
'DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borla' +
'nd.Data.DbxCommonDriver,Version=19.0.0.0,Culture=neutral,PublicK' +
'eyToken=91d62ebb5b0d1b1b'
'MetaDataPackageLoader=TDBXMySqlMetaDataCommandFactory,DbxMySQLDr' +
'iver190.bpl'
'MetaDataAssemblyLoader=Borland.Data.TDBXMySqlMetaDataCommandFact' +
'ory,Borland.Data.DbxMySQLDriver,Version=19.0.0.0,Culture=neutral' +
',PublicKeyToken=91d62ebb5b0d1b1b'
'GetDriverFunc=getSQLDriverMYSQL'
'LibraryName=dbxmys.dll'
'LibraryNameOsx=libsqlmys.dylib'
'VendorLib=LIBMYSQL.dll'
'VendorLibWin64=libmysql.dll'
'VendorLibOsx=libmysqlclient.dylib'
'MaxBlobSize=-1'
'DriverName=MySQL'
'HostName=46.174.100.13'
'Database=c0mlekaraadmin'
'User_Name=c0mlekaraadmin'
'Password=Ml3K@rA!'
'ServerCharSet='
'BlobSize=-1'
'ErrorResourceFile='
'LocaleCode=0000'
'Compressed=False'
'Encrypted=False'
'ConnectTimeout=60')
Connected = True
Left = 64
Top = 24
end
end
//---------------------------------------------------------------------------
#ifndef ConnectionH
#define ConnectionH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Data.DB.hpp>
#include <Data.SqlExpr.hpp>
#include <Data.DBXMySQL.hpp>
//---------------------------------------------------------------------------
class TDataModule1 : public TDataModule
{
__published: // IDE-managed Components
TSQLConnection *mysql;
private: // User declarations
public: // User declarations
__fastcall TDataModule1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TDataModule1 *DataModule1;
//---------------------------------------------------------------------------
#endif
object DataModule1: TDataModule1
OldCreateOrder = False
Height = 421
Width = 606
object SQLConnection1: TSQLConnection
Left = 112
Top = 32
end
end
object DataModule1: TDataModule1
OldCreateOrder = False
Height = 186
Width = 303
object mysql: TSQLConnection
ConnectionName = 'MySQLConnection'
DriverName = 'MySQL'
LoginPrompt = False
Params.Strings = (
'DriverUnit=Data.DBXMySQL'
'DriverPackageLoader=TDBXDynalinkDriverLoader,DbxCommonDriver190.' +
'bpl'
'DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borla' +
'nd.Data.DbxCommonDriver,Version=19.0.0.0,Culture=neutral,PublicK' +
'eyToken=91d62ebb5b0d1b1b'
'MetaDataPackageLoader=TDBXMySqlMetaDataCommandFactory,DbxMySQLDr' +
'iver190.bpl'
'MetaDataAssemblyLoader=Borland.Data.TDBXMySqlMetaDataCommandFact' +
'ory,Borland.Data.DbxMySQLDriver,Version=19.0.0.0,Culture=neutral' +
',PublicKeyToken=91d62ebb5b0d1b1b'
'GetDriverFunc=getSQLDriverMYSQL'
'LibraryName=dbxmys.dll'
'LibraryNameOsx=libsqlmys.dylib'
'VendorLib=LIBMYSQL.dll'
'VendorLibWin64=libmysql.dll'
'VendorLibOsx=libmysqlclient.dylib'
'MaxBlobSize=-1'
'DriverName=MySQL'
'HostName=46.174.100.13'
'Database=c0mlekaraadmin'
'User_Name=c0mlekaraadmin'
'Password=Ml3K@rA!'
'ServerCharSet='
'BlobSize=-1'
'ErrorResourceFile='
'LocaleCode=0000'
'Compressed=False'
'Encrypted=False'
'ConnectTimeout=60')
Left = 64
Top = 24
end
end
object DataModule1: TDataModule1
OldCreateOrder = False
Height = 186
Width = 303
object mysql: TSQLConnection
ConnectionName = 'MySQLConnection'
DriverName = 'MySQL'
LoginPrompt = False
Params.Strings = (
'DriverUnit=Data.DBXMySQL'
'DriverPackageLoader=TDBXDynalinkDriverLoader,DbxCommonDriver190.' +
'bpl'
'DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borla' +
'nd.Data.DbxCommonDriver,Version=19.0.0.0,Culture=neutral,PublicK' +
'eyToken=91d62ebb5b0d1b1b'
'MetaDataPackageLoader=TDBXMySqlMetaDataCommandFactory,DbxMySQLDr' +
'iver190.bpl'
'MetaDataAssemblyLoader=Borland.Data.TDBXMySqlMetaDataCommandFact' +
'ory,Borland.Data.DbxMySQLDriver,Version=19.0.0.0,Culture=neutral' +
',PublicKeyToken=91d62ebb5b0d1b1b'
'GetDriverFunc=getSQLDriverMYSQL'
'LibraryName=dbxmys.dll'
'LibraryNameOsx=libsqlmys.dylib'
'VendorLib=LIBMYSQL.dll'
'VendorLibWin64=libmysql.dll'
'VendorLibOsx=libmysqlclient.dylib'
'MaxBlobSize=-1'
'DriverName=MySQL'
'HostName=46.174.100.13'
'Database=c0mlekaraadmin'
'User_Name=c0mlekaraadmin'
'Password=Ml3K@rA!'
'ServerCharSet='
'BlobSize=-1'
'ErrorResourceFile='
'LocaleCode=0000'
'Compressed=False'
'Encrypted=False'
'ConnectTimeout=60')
Left = 64
Top = 24
end
end
object DataModule1: TDataModule1
OldCreateOrder = False
Height = 114
Width = 179
object mysql: TSQLConnection
ConnectionName = 'MySQLConnection'
DriverName = 'MySQL'
LoginPrompt = False
Params.Strings = (
'DriverUnit=Data.DBXMySQL'
'DriverPackageLoader=TDBXDynalinkDriverLoader,DbxCommonDriver190.' +
'bpl'
'DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borla' +
'nd.Data.DbxCommonDriver,Version=19.0.0.0,Culture=neutral,PublicK' +
'eyToken=91d62ebb5b0d1b1b'
'MetaDataPackageLoader=TDBXMySqlMetaDataCommandFactory,DbxMySQLDr' +
'iver190.bpl'
'MetaDataAssemblyLoader=Borland.Data.TDBXMySqlMetaDataCommandFact' +
'ory,Borland.Data.DbxMySQLDriver,Version=19.0.0.0,Culture=neutral' +
',PublicKeyToken=91d62ebb5b0d1b1b'
'GetDriverFunc=getSQLDriverMYSQL'
'LibraryName=dbxmys.dll'
'LibraryNameOsx=libsqlmys.dylib'
'VendorLib=LIBMYSQL.dll'
'VendorLibWin64=libmysql.dll'
'VendorLibOsx=libmysqlclient.dylib'
'MaxBlobSize=-1'
'DriverName=MySQL'
'HostName=46.174.100.13'
'Database=c0mlekaraadmin'
'User_Name=c0mlekaraadmin'
'Password=Ml3K@rA!'
'ServerCharSet='
'BlobSize=-1'
'ErrorResourceFile='
'LocaleCode=0000'
'Compressed=False'
'Encrypted=False'
'ConnectTimeout=60')
Connected = True
Left = 64
Top = 24
end
end
object DataModule1: TDataModule1
OldCreateOrder = False
Height = 114
Width = 179
object mysql: TSQLConnection
ConnectionName = 'MySQLConnection'
DriverName = 'MySQL'
LoginPrompt = False
Params.Strings = (
'DriverUnit=Data.DBXMySQL'
'DriverPackageLoader=TDBXDynalinkDriverLoader,DbxCommonDriver190.' +
'bpl'
'DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borla' +
'nd.Data.DbxCommonDriver,Version=19.0.0.0,Culture=neutral,PublicK' +
'eyToken=91d62ebb5b0d1b1b'
'MetaDataPackageLoader=TDBXMySqlMetaDataCommandFactory,DbxMySQLDr' +
'iver190.bpl'
'MetaDataAssemblyLoader=Borland.Data.TDBXMySqlMetaDataCommandFact' +
'ory,Borland.Data.DbxMySQLDriver,Version=19.0.0.0,Culture=neutral' +
',PublicKeyToken=91d62ebb5b0d1b1b'
'GetDriverFunc=getSQLDriverMYSQL'
'LibraryName=dbxmys.dll'
'LibraryNameOsx=libsqlmys.dylib'
'VendorLib=LIBMYSQL.dll'
'VendorLibWin64=libmysql.dll'
'VendorLibOsx=libmysqlclient.dylib'
'MaxBlobSize=-1'
'DriverName=MySQL'
'HostName=46.174.100.13'
'Database=c0mlekaraadmin'
'User_Name=c0mlekaraadmin'
'Password=Ml3K@rA!'
'ServerCharSet='
'BlobSize=-1'
'ErrorResourceFile='
'LocaleCode=0000'
'Compressed=False'
'Encrypted=False'
'ConnectTimeout=60')
Connected = True
Left = 64
Top = 24
end
end
object DataModule1: TDataModule1
OldCreateOrder = False
Height = 114
Width = 179
object mysql: TSQLConnection
ConnectionName = 'MySQLConnection'
DriverName = 'MySQL'
LoginPrompt = False
Params.Strings = (
'DriverUnit=Data.DBXMySQL'
'DriverPackageLoader=TDBXDynalinkDriverLoader,DbxCommonDriver190.' +
'bpl'
'DriverAssemblyLoader=Borland.Data.TDBXDynalinkDriverLoader,Borla' +
'nd.Data.DbxCommonDriver,Version=19.0.0.0,Culture=neutral,PublicK' +
'eyToken=91d62ebb5b0d1b1b'
'MetaDataPackageLoader=TDBXMySqlMetaDataCommandFactory,DbxMySQLDr' +
'iver190.bpl'
'MetaDataAssemblyLoader=Borland.Data.TDBXMySqlMetaDataCommandFact' +
'ory,Borland.Data.DbxMySQLDriver,Version=19.0.0.0,Culture=neutral' +
',PublicKeyToken=91d62ebb5b0d1b1b'
'GetDriverFunc=getSQLDriverMYSQL'
'LibraryName=dbxmys.dll'
'LibraryNameOsx=libsqlmys.dylib'
'VendorLib=LIBMYSQL.dll'
'VendorLibWin64=libmysql.dll'
'VendorLibOsx=libmysqlclient.dylib'
'MaxBlobSize=-1'
'DriverName=MySQL'
'HostName=46.174.100.13'
'Database=c0mlekaraadmin'
'User_Name=c0mlekaraadmin'
'Password=Ml3K@rA!'
'ServerCharSet='
'BlobSize=-1'
'ErrorResourceFile='
'LocaleCode=0000'
'Compressed=False'
'Encrypted=False'
'ConnectTimeout=60')
Connected = True
Left = 64
Top = 24
end
end
//---------------------------------------------------------------------------
#ifndef ConnectionH
#define ConnectionH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Data.DB.hpp>
#include <Data.SqlExpr.hpp>
//---------------------------------------------------------------------------
class TDataModule1 : public TDataModule
{
__published: // IDE-managed Components
TSQLConnection *SQLConnection1;
private: // User declarations
public: // User declarations
__fastcall TDataModule1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TDataModule1 *DataModule1;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef ConnectionH
#define ConnectionH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Data.DB.hpp>
#include <Data.SqlExpr.hpp>
#include <Data.DBXMySQL.hpp>
//---------------------------------------------------------------------------
class TDataModule1 : public TDataModule
{
__published: // IDE-managed Components
TSQLConnection *mysql;
private: // User declarations
public: // User declarations
__fastcall TDataModule1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TDataModule1 *DataModule1;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
// CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
// CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
void __fastcall Tdb::cdsArtikliAfterPost(TDataSet *DataSet)
{
SnimiCDS(cdsArtikli,DataModule1.mysql);
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
// CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
void __fastcall Tdb::cdsArtikliAfterPost(TDataSet *DataSet)
{
SnimiCDS(cdsArtikli,DataModule1->mysql);
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
// CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
void __fastcall Tdb::cdsArtikliAfterPost(TDataSet *DataSet)
{
SnimiCDS(cdsArtikli,DataModule1->mysql);
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openArtikliCds(){
cdsArtikli->Active = false;
cdsArtikli->Active = true;
}
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
// CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
void __fastcall Tdb::cdsArtikliAfterPost(TDataSet *DataSet)
{
SnimiCDS(cdsArtikli,DataModule1->mysql);
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openArtikliCds(){
cdsArtikli->Active = false;
cdsArtikli->Active = true;
}
void __fastcall Tdb::dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName)
{
TableName = "Artikli";
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
// CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
void __fastcall Tdb::cdsArtikliAfterPost(TDataSet *DataSet)
{
SnimiCDS(cdsArtikli,DataModule1->mysql);
openArtikliCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openArtikliCds(){
cdsArtikli->Active = false;
cdsArtikli->Active = true;
}
void __fastcall Tdb::dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName)
{
TableName = "Artikli";
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
// CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
void __fastcall Tdb::cdsArtikliAfterPost(TDataSet *DataSet)
{
SnimiCDS(cdsArtikli,DataModule1->mysql);
cdsArtikli->Refresh()'
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openArtikliCds(){
cdsArtikli->Active = false;
cdsArtikli->Active = true;
}
void __fastcall Tdb::dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName)
{
TableName = "Artikli";
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
// CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
void __fastcall Tdb::cdsArtikliAfterPost(TDataSet *DataSet)
{
SnimiCDS(cdsArtikli,DataModule1->mysql);
cdsArtikli->Refresh();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openArtikliCds(){
cdsArtikli->Active = false;
cdsArtikli->Active = true;
}
void __fastcall Tdb::dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName)
{
TableName = "Artikli";
}
//---------------------------------------------------------------------------
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from c0mlekaraadmin.Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
end
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
end
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
end
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
end
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
end
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
object sdsUredjaj: TSQLDataSet
CommandText = 'SELECT id FROM c0mlekaraadmin.mlekara group by 1'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 152
object sdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dspUredjaj: TDataSetProvider
DataSet = sdsUredjaj
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 152
end
object cdsUredjaj: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspUredjaj'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 152
object cdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dsUredjaj: TDataSource
DataSet = cdsUredjaj
Left = 784
Top = 152
end
end
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object sdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object cdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
object sdsUredjaj: TSQLDataSet
CommandText = 'SELECT id FROM c0mlekaraadmin.mlekara group by 1'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 152
object sdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dspUredjaj: TDataSetProvider
DataSet = sdsUredjaj
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 152
end
object cdsUredjaj: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspUredjaj'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 152
object cdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dsUredjaj: TDataSource
DataSet = cdsUredjaj
Left = 784
Top = 152
end
end
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object sdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object cdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
object sdsUredjaj: TSQLDataSet
Active = True
CommandText = 'SELECT id FROM c0mlekaraadmin.mlekara group by 1'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 152
object sdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dspUredjaj: TDataSetProvider
DataSet = sdsUredjaj
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 152
end
object cdsUredjaj: TClientDataSet
Active = True
Aggregates = <>
Params = <>
ProviderName = 'dspUredjaj'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 152
object cdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dsUredjaj: TDataSource
DataSet = cdsUredjaj
Left = 784
Top = 152
end
end
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object sdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object cdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
object sdsUredjaj: TSQLDataSet
Active = True
CommandText = 'SELECT id FROM c0mlekaraadmin.mlekara group by 1'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 152
object sdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dspUredjaj: TDataSetProvider
DataSet = sdsUredjaj
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 152
end
object cdsUredjaj: TClientDataSet
Active = True
Aggregates = <>
Params = <>
ProviderName = 'dspUredjaj'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 152
object cdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dsUredjaj: TDataSource
DataSet = cdsUredjaj
Left = 784
Top = 152
end
object sdsStampa: TSQLDataSet
CommandText =
'select temperatura,DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vreme '#13#10'from' +
' c0mlekaraadmin.mlekara '#13#10'where id = :ID and vreme between :D1 a' +
'nd :D2'
MaxBlobSize = -1
Params = <
item
DataType = ftInteger
Name = 'ID'
ParamType = ptInput
end
item
DataType = ftDateTime
Name = 'D1'
ParamType = ptInput
end
item
DataType = ftDateTime
Name = 'D2'
ParamType = ptInput
end>
SQLConnection = DataModule1.mysql
Left = 520
Top = 232
object sdsStampatemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsStampavreme: TStringField
FieldName = 'vreme'
Size = 13
end
end
object dspStampa: TDataSetProvider
DataSet = sdsStampa
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 232
end
object cdsStampa: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspStampa'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 232
object cdsStampatemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsStampavreme: TStringField
FieldName = 'vreme'
Size = 13
end
end
object dsStampa: TDataSource
DataSet = cdsStampa
Left = 784
Top = 232
end
end
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object sdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object cdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
object sdsUredjaj: TSQLDataSet
Active = True
CommandText = 'SELECT id FROM c0mlekaraadmin.mlekara group by 1'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 152
object sdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dspUredjaj: TDataSetProvider
DataSet = sdsUredjaj
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 152
end
object cdsUredjaj: TClientDataSet
Active = True
Aggregates = <>
Params = <>
ProviderName = 'dspUredjaj'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 152
object cdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dsUredjaj: TDataSource
DataSet = cdsUredjaj
Left = 784
Top = 152
end
object sdsStampa: TSQLDataSet
CommandText =
'select temperatura,DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vreme '#13#10'from' +
' c0mlekaraadmin.mlekara '#13#10'where id = :ID and vreme between :D1 a' +
'nd :D2'
MaxBlobSize = -1
Params = <
item
DataType = ftInteger
Name = 'ID'
ParamType = ptInput
end
item
DataType = ftDateTime
Name = 'D1'
ParamType = ptInput
end
item
DataType = ftDateTime
Name = 'D2'
ParamType = ptInput
end>
SQLConnection = DataModule1.mysql
Left = 520
Top = 232
object sdsStampatemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsStampavreme: TStringField
FieldName = 'vreme'
Size = 13
end
end
object dspStampa: TDataSetProvider
DataSet = sdsStampa
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 232
end
object cdsStampa: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspStampa'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 232
object cdsStampatemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsStampavreme: TStringField
FieldName = 'vreme'
Size = 13
end
end
object dsStampa: TDataSource
DataSet = cdsStampa
Left = 784
Top = 232
end
end
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
int __fastcall SnimiCDS(TClientDataSet* cds, TSQLConnection* sc);
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
int __fastcall SnimiCDS(TClientDataSet* cds, TSQLConnection* sc);
void __fastcall NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele);
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
void __fastcall cdsArtikliAfterPost(TDataSet *DataSet);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
int __fastcall SnimiCDS(TClientDataSet* cds, TSQLConnection* sc);
void __fastcall NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele);
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
void __fastcall cdsArtikliAfterPost(TDataSet *DataSet);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
int __fastcall SnimiCDS(TClientDataSet* cds, TSQLConnection* sc);
void __fastcall NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele);
void __fastcall openArtikliCds();
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
void __fastcall cdsArtikliAfterPost(TDataSet *DataSet);
void __fastcall dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
int __fastcall SnimiCDS(TClientDataSet* cds, TSQLConnection* sc);
void __fastcall NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele);
void __fastcall openArtikliCds();
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
void __fastcall cdsArtikliAfterPost(TDataSet *DataSet);
void __fastcall dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
int __fastcall SnimiCDS(TClientDataSet* cds, TSQLConnection* sc);
void __fastcall NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele);
void __fastcall openArtikliCds();
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
TSQLDataSet *sdsUredjaj;
TDataSetProvider *dspUredjaj;
TClientDataSet *cdsUredjaj;
TDataSource *dsUredjaj;
TIntegerField *sdsUredjajid;
TIntegerField *cdsUredjajid;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
void __fastcall cdsArtikliAfterPost(TDataSet *DataSet);
void __fastcall dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
int __fastcall SnimiCDS(TClientDataSet* cds, TSQLConnection* sc);
void __fastcall NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele);
void __fastcall openArtikliCds();
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
TSQLDataSet *sdsUredjaj;
TDataSetProvider *dspUredjaj;
TClientDataSet *cdsUredjaj;
TDataSource *dsUredjaj;
TIntegerField *sdsUredjajid;
TIntegerField *cdsUredjajid;
TIntegerField *sdsArtikliid_uredjaja;
TIntegerField *cdsArtikliid_uredjaja;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
void __fastcall cdsArtikliAfterPost(TDataSet *DataSet);
void __fastcall dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
int __fastcall SnimiCDS(TClientDataSet* cds, TSQLConnection* sc);
void __fastcall NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele);
void __fastcall openArtikliCds();
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#pragma hdrstop
#include "dbDm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma classgroup "Vcl.Controls.TControl"
#pragma resource "*.dfm"
#include "c_poruka.h"
#include <IdGlobal.hpp>
#include <System.SysUtils.hpp>
#include <System.hpp>
Tdb *db;
AnsiString LOG_FAJL = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//;// = APP_DIR + "\\Log\\CashIT\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log" ;//Sysutils::ChangeFileExt(Application->ExeName, ".log");
AnsiString LOG_FAJL1 = GetCurrentDir() + "\\Log\\" + Sysutils::ExtractFileName(Sysutils::ChangeFileExt(Application->ExeName, "")) + ".log1" ;
int VELICINA_LOG_FAJLA=900;
//---------------------------------------------------------------------------
__fastcall Tdb::Tdb(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openMlekaraCds(){
cdsMlekara->Active = false;
cdsMlekara->Active = true;
}
void __fastcall Tdb::Timer1Timer(TObject *Sender)
{
openMlekaraCds();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::Timer2Timer(TObject *Sender)
{
ClientDataSet1->Active = false;
ClientDataSet1->Active = true;
ClientDataSet2->Active = false;
ClientDataSet2->Active = true;
ClientDataSet3->Active = false;
ClientDataSet3->Active = true;
ClientDataSet4->Active = false;
ClientDataSet4->Active = true;
}
//---------------------------------------------------------------------------
int __fastcall Tdb::SnimiCDS(TClientDataSet* cds, TSQLConnection* sc)
{
TTransactionDesc TD;
TD.TransactionID = 1;
TD.IsolationLevel = 1;
if (sc->InTransaction)
{
sc->Commit(TD);
}
OleVariant MasterVar, OwnerData;
int ErrCount = 0;
if (cds->OnPostError == NULL ) {
// cds->OnPostError = DM->cdsHostPostError;
}
cds->CheckBrowseMode();
if (cds->ChangeCount > 0)
MasterVar = cds->Delta;
else
MasterVar.ChangeType(VT_NULL);
try
{
if (!sc->InTransaction)
{
sc->StartTransaction(TD);
try
{
if (!MasterVar.IsNull())
{
ErrCount = cds->ApplyUpdates(0);
if (ErrCount > 0)
{
LogError(cds , "Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name, 0) ;
throw Exception("Broj gresaka=" + IntToStr(ErrCount) + " " + cds->Name);
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (sc->InTransaction)
{
if (ErrCount == 0)
{
sc->Commit(TD);
}
else
{
sc->Rollback(TD);
}
}
}
}
catch (Exception& e)
{
if (sc->InTransaction)
sc->Rollback(TD);
PosaljiPoruku("Greska snimanja!! " + e.Message);
}
if (ErrCount > 0) {
cds->Reconcile(MasterVar);
}
return 0;
}
void __fastcall Tdb::PosaljiPoruku(AnsiString poruka)
{
Tfrm_poruka* frm_poruka = new Tfrm_poruka(poruka, Application);
frm_poruka->Show();
Application->ProcessMessages();
}
void __fastcall Tdb::LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku)
{
// ScreenCaptureJPG("frmMP.jpg");
AnsiString greska;
AnsiString forma = DataSet->Owner->Name;
greska = DateTimeToStr(Now()) + " - DataSet: " + DataSet->Name + " -Radnik: - Greska: ";
UpisiULogFile(LOG_FAJL, "-pocetak-", 2);
UpisiULogFile(LOG_FAJL, poruka, 2);
UpisiULogFile(LOG_FAJL, greska, 2);
NamestiInsert( DataSet, DataSet->Name) ;
UpisiULogFile(LOG_FAJL, "-kraj-", 2);
if (posalji_poruku == 1)
{
PosaljiPoruku("Greska: ");
}
}
void __fastcall Tdb::UpisiULogFile(AnsiString filename, AnsiString text, int pocetak)
{
char szFileName[300];
char cr;
char* pszBuffer;
int velicina_fajla;
int iFileHandle;
int iPom;
// HANDLE iFileHandle;
text = DateTimeToStr(Now()) + " Radnik: - " + text;
int iLength,
iFileLength;
//iBytesRead; /* defined but never used */
AnsiString duzina, pom_fajl;
if (filename == "")
{
filename = FormatDateTime("yymmddhhmm", Now()) + ".txt";
}
if (FileExists(filename))
{
iFileHandle = FileOpen(filename, fmOpenReadWrite);
iFileLength = FileSeek(iFileHandle, 0, 2);
// velicina_fajla = FileSizeByName(filename);
// if (velicina_fajla > VELICINA_LOG_FAJLA * 1000)
// {
// FileClose(iFileHandle);
// pom_fajl = Sysutils::ChangeFileExt(Application->ExeName, ".log1");
// CopyFileTo(filename, pom_fajl);
// DeleteFile(filename);
// iFileHandle = FileOpen(filename, fmOpenReadWrite);
// iFileLength = FileSeek(iFileHandle, 0, 2);
// }
FileSeek(iFileHandle, 0, pocetak);
if (pocetak == 0) // dodajes na pocetak fajla
{
// otvoris pomocni file
iPom = FileCreate("pom" + filename, fmOpenReadWrite);
// upises sta treba da je na pocetku fajla
FileWrite(iPom, text.c_str(), text.Length());
cr = 13;
FileWrite(iPom, & cr, 1);
cr = 10;
FileWrite(iPom, & cr, 1);
pszBuffer = new char[iFileLength + 1]; // kopiras stari sadrzaj na pomocni file
//iBytesRead = /* defined but never used */
FileRead(iFileHandle, pszBuffer, iFileLength);
FileClose(iFileHandle);
FileWrite(iPom, pszBuffer, iFileLength);
FileClose(iPom);
delete[]pszBuffer;
DeleteFile(filename);
// CopyFileTo("pom" + filename, filename);
DeleteFile("pom" + filename);
return;
}
}
else
{
iFileHandle = FileCreate(filename);
}
iLength = text.Length();
duzina = IntToStr(iLength);
duzina += "@";
// FileWrite(iFileHandle, duzina.c_str(), duzina.Length());
FileWrite(iFileHandle, text.c_str(), text.Length());
cr = 13;
FileWrite(iFileHandle, & cr, 1);
cr = 10;
FileWrite(iFileHandle, & cr, 1);
FileClose(iFileHandle);
}
void __fastcall Tdb::NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele)
{
//
if (DataSet->Active == true)
{
int broj_polja = DataSet->FieldCount;
AnsiString insert1 = "(";
AnsiString insert2 = "VALUES (";
for (int i = 0; i < broj_polja; i++)
{
insert1 = insert1 + DataSet->Fields->Fields[i]->FieldName;
if (i <broj_polja-1) {
insert1 = insert1 + ",";
}
if (i == broj_polja-1) {
insert1 = insert1 + ")";
}
if ( DataSet->Fields->Fields[i]->DataType == ftString ||
DataSet->Fields->Fields[i]->DataType == ftTimeStamp ||
DataSet->Fields->Fields[i]->DataType == ftDate ) {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else
insert2 = insert2 + "'" + DataSet->Fields->Fields[i]->AsString + "'";
}
else {
if (DataSet->Fields->Fields[i]->IsNull) {
insert2 = insert2 + "NULL";
}
else {
insert2 = insert2 + DataSet->Fields->Fields[i]->AsString ;
}
}
if (i <broj_polja-1) {
insert2 = insert2 + ",";
}
if (i == broj_polja-1) {
insert2 = insert2 + ")";
}
}
UpisiULogFile(LOG_FAJL, "INSERT INTO " + imeTabele, 2);
UpisiULogFile(LOG_FAJL, insert1, 2);
UpisiULogFile(LOG_FAJL, insert2, 2);
}
}
void __fastcall Tdb::cdsArtikliAfterPost(TDataSet *DataSet)
{
SnimiCDS(cdsArtikli,DataModule1->mysql);
cdsArtikli->Refresh();
}
//---------------------------------------------------------------------------
void __fastcall Tdb::openArtikliCds(){
cdsArtikli->Active = false;
cdsArtikli->Active = true;
}
void __fastcall Tdb::dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName)
{
TableName = "Artikli";
}
//---------------------------------------------------------------------------
object db: Tdb
OldCreateOrder = False
Height = 654
Width = 1042
object sdsMlekara: TSQLDataSet
CommandText =
'select id,temperatura,(temperatura / 20) as temper,'#13#10'DATE_FORMAT' +
'(vreme,'#39'%H:%i:%s'#39') as vreme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraad' +
'min.mlekara ORDER BY vreme1 DESC LIMIT 20'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 40
Top = 16
object sdsMlekaraid: TIntegerField
FieldName = 'id'
end
object sdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object sdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dspMlekara: TDataSetProvider
DataSet = sdsMlekara
Left = 128
Top = 16
end
object cdsMlekara: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspMlekara'
Left = 216
Top = 16
object cdsMlekaraid: TIntegerField
FieldName = 'id'
end
object cdsMlekaratemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsMlekaravreme: TStringField
FieldName = 'vreme'
Size = 13
end
object cdsMlekaratemper: TFMTBCDField
FieldName = 'temper'
Precision = 16
Size = 4
end
end
object dsMlekara: TDataSource
DataSet = cdsMlekara
Left = 304
Top = 16
end
object Timer1: TTimer
Interval = 5000
OnTimer = Timer1Timer
Left = 392
Top = 16
end
object SQLDataSet1: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 1'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 112
object IntegerField1: TIntegerField
FieldName = 'id'
end
object StringField1: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider1: TDataSetProvider
DataSet = SQLDataSet1
Left = 112
Top = 112
end
object ClientDataSet1: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider1'
Left = 200
Top = 112
object IntegerField3: TIntegerField
FieldName = 'id'
end
object StringField2: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet1C: TIntegerField
FieldName = 'C'
end
end
object DataSource1: TDataSource
DataSet = ClientDataSet1
Left = 288
Top = 112
end
object SQLDataSet2: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 2'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 32
Top = 192
object IntegerField5: TIntegerField
FieldName = 'id'
end
object StringField3: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider2: TDataSetProvider
DataSet = SQLDataSet2
Left = 120
Top = 192
end
object ClientDataSet2: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider2'
Left = 208
Top = 192
object IntegerField7: TIntegerField
FieldName = 'id'
end
object StringField4: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet2C: TIntegerField
FieldName = 'C'
end
end
object DataSource2: TDataSource
DataSet = ClientDataSet2
Left = 296
Top = 192
end
object SQLDataSet3: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 3'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 280
object IntegerField9: TIntegerField
FieldName = 'id'
end
object StringField5: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider3: TDataSetProvider
DataSet = SQLDataSet3
Left = 112
Top = 280
end
object ClientDataSet3: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider3'
Left = 200
Top = 280
object IntegerField11: TIntegerField
FieldName = 'id'
end
object StringField6: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet3C: TIntegerField
FieldName = 'C'
end
end
object DataSource3: TDataSource
DataSet = ClientDataSet3
Left = 288
Top = 280
end
object SQLDataSet4: TSQLDataSet
CommandText =
'select id,temperatura as C,'#13#10'DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vr' +
'eme,'#13#10'vreme as vreme1 '#13#10'from c0mlekaraadmin.mlekara '#13#10'where id =' +
' 4'#13#10'ORDER BY vreme1 DESC LIMIT 7'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 24
Top = 368
object IntegerField13: TIntegerField
FieldName = 'id'
end
object StringField7: TStringField
FieldName = 'vreme'
Size = 13
end
object SQLDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSetProvider4: TDataSetProvider
DataSet = SQLDataSet4
Left = 112
Top = 368
end
object ClientDataSet4: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'DataSetProvider4'
Left = 200
Top = 368
object IntegerField15: TIntegerField
FieldName = 'id'
end
object StringField8: TStringField
FieldName = 'vreme'
Size = 13
end
object ClientDataSet4C: TIntegerField
FieldName = 'C'
end
end
object DataSource4: TDataSource
DataSet = ClientDataSet4
Left = 288
Top = 368
end
object Timer2: TTimer
Interval = 3000
OnTimer = Timer2Timer
Left = 384
Top = 240
end
object sdsArtikli: TSQLDataSet
CommandText = 'select *'#13#10'from Artikli'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 32
object sdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object sdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object sdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object sdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object sdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object sdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dspArtikli: TDataSetProvider
DataSet = sdsArtikli
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 32
end
object cdsArtikli: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspArtikli'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 32
object cdsArtikliidArtikli: TIntegerField
FieldName = 'idArtikli'
ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
end
object cdsArtikliArtikal: TStringField
FieldName = 'Artikal'
Size = 100
end
object cdsArtikliKolicina: TSingleField
FieldName = 'Kolicina'
end
object cdsArtikliod: TSQLTimeStampField
FieldName = 'od'
end
object cdsArtiklido: TSQLTimeStampField
FieldName = 'do'
end
object cdsArtikliid_uredjaja: TIntegerField
FieldName = 'id_uredjaja'
end
end
object dsArtikli: TDataSource
DataSet = cdsArtikli
Left = 784
Top = 32
end
object sdsUredjaj: TSQLDataSet
Active = True
CommandText = 'SELECT id FROM c0mlekaraadmin.mlekara group by 1'
MaxBlobSize = -1
Params = <>
SQLConnection = DataModule1.mysql
Left = 520
Top = 152
object sdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dspUredjaj: TDataSetProvider
DataSet = sdsUredjaj
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 152
end
object cdsUredjaj: TClientDataSet
Active = True
Aggregates = <>
Params = <>
ProviderName = 'dspUredjaj'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 152
object cdsUredjajid: TIntegerField
FieldName = 'id'
end
end
object dsUredjaj: TDataSource
DataSet = cdsUredjaj
Left = 784
Top = 152
end
object sdsStampa: TSQLDataSet
CommandText =
'select temperatura,DATE_FORMAT(vreme,'#39'%H:%i:%s'#39') as vreme '#13#10'from' +
' c0mlekaraadmin.mlekara '#13#10'where id = :ID and vreme between :D1 a' +
'nd :D2'
MaxBlobSize = -1
Params = <
item
DataType = ftInteger
Name = 'ID'
ParamType = ptInput
end
item
DataType = ftDateTime
Name = 'D1'
ParamType = ptInput
end
item
DataType = ftDateTime
Name = 'D2'
ParamType = ptInput
end>
SQLConnection = DataModule1.mysql
Left = 520
Top = 232
object sdsStampatemperatura: TIntegerField
FieldName = 'temperatura'
end
object sdsStampavreme: TStringField
FieldName = 'vreme'
Size = 13
end
end
object dspStampa: TDataSetProvider
DataSet = sdsStampa
OnGetTableName = dspArtikliGetTableName
Left = 608
Top = 232
end
object cdsStampa: TClientDataSet
Aggregates = <>
Params = <>
ProviderName = 'dspStampa'
AfterPost = cdsArtikliAfterPost
Left = 696
Top = 232
object cdsStampatemperatura: TIntegerField
FieldName = 'temperatura'
end
object cdsStampavreme: TStringField
FieldName = 'vreme'
Size = 13
end
end
object dsStampa: TDataSource
DataSet = cdsStampa
Left = 784
Top = 232
end
end
//---------------------------------------------------------------------------
#ifndef dbDmH
#define dbDmH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
//USER INCLUDES
#include "Connection.h"
#include <Data.DB.hpp>
#include <Data.FMTBcd.hpp>
#include <Data.SqlExpr.hpp>
#include <Datasnap.DBClient.hpp>
#include <Datasnap.Provider.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Tdb : public TDataModule
{
__published: // IDE-managed Components
TSQLDataSet *sdsMlekara;
TDataSetProvider *dspMlekara;
TClientDataSet *cdsMlekara;
TDataSource *dsMlekara;
TIntegerField *sdsMlekaraid;
TIntegerField *sdsMlekaratemperatura;
TStringField *sdsMlekaravreme;
TIntegerField *cdsMlekaraid;
TIntegerField *cdsMlekaratemperatura;
TStringField *cdsMlekaravreme;
TTimer *Timer1;
TSQLDataSet *SQLDataSet1;
TIntegerField *IntegerField1;
TStringField *StringField1;
TDataSetProvider *DataSetProvider1;
TClientDataSet *ClientDataSet1;
TIntegerField *IntegerField3;
TStringField *StringField2;
TDataSource *DataSource1;
TSQLDataSet *SQLDataSet2;
TIntegerField *IntegerField5;
TStringField *StringField3;
TDataSetProvider *DataSetProvider2;
TClientDataSet *ClientDataSet2;
TIntegerField *IntegerField7;
TStringField *StringField4;
TDataSource *DataSource2;
TSQLDataSet *SQLDataSet3;
TIntegerField *IntegerField9;
TStringField *StringField5;
TDataSetProvider *DataSetProvider3;
TClientDataSet *ClientDataSet3;
TIntegerField *IntegerField11;
TStringField *StringField6;
TDataSource *DataSource3;
TSQLDataSet *SQLDataSet4;
TIntegerField *IntegerField13;
TStringField *StringField7;
TDataSetProvider *DataSetProvider4;
TClientDataSet *ClientDataSet4;
TIntegerField *IntegerField15;
TStringField *StringField8;
TDataSource *DataSource4;
TTimer *Timer2;
TIntegerField *SQLDataSet1C;
TIntegerField *ClientDataSet1C;
TIntegerField *SQLDataSet2C;
TIntegerField *ClientDataSet2C;
TIntegerField *SQLDataSet3C;
TIntegerField *ClientDataSet3C;
TIntegerField *SQLDataSet4C;
TIntegerField *ClientDataSet4C;
TFMTBCDField *sdsMlekaratemper;
TFMTBCDField *cdsMlekaratemper;
TSQLDataSet *sdsArtikli;
TDataSetProvider *dspArtikli;
TClientDataSet *cdsArtikli;
TDataSource *dsArtikli;
TIntegerField *sdsArtikliidArtikli;
TStringField *sdsArtikliArtikal;
TSingleField *sdsArtikliKolicina;
TSQLTimeStampField *sdsArtikliod;
TSQLTimeStampField *sdsArtiklido;
TIntegerField *cdsArtikliidArtikli;
TStringField *cdsArtikliArtikal;
TSingleField *cdsArtikliKolicina;
TSQLTimeStampField *cdsArtikliod;
TSQLTimeStampField *cdsArtiklido;
TSQLDataSet *sdsUredjaj;
TDataSetProvider *dspUredjaj;
TClientDataSet *cdsUredjaj;
TDataSource *dsUredjaj;
TIntegerField *sdsUredjajid;
TIntegerField *cdsUredjajid;
TIntegerField *sdsArtikliid_uredjaja;
TIntegerField *cdsArtikliid_uredjaja;
TSQLDataSet *sdsStampa;
TDataSetProvider *dspStampa;
TClientDataSet *cdsStampa;
TDataSource *dsStampa;
TIntegerField *sdsStampatemperatura;
TStringField *sdsStampavreme;
TIntegerField *cdsStampatemperatura;
TStringField *cdsStampavreme;
void __fastcall Timer1Timer(TObject *Sender);
void __fastcall Timer2Timer(TObject *Sender);
void __fastcall cdsArtikliAfterPost(TDataSet *DataSet);
void __fastcall dspArtikliGetTableName(TObject *Sender, TDataSet *DataSet,
UnicodeString &TableName);
private: // User declarations
public: // User declarations
__fastcall Tdb(TComponent* Owner);
void __fastcall openMlekaraCds();
void __fastcall UpisiULogFile(AnsiString filename, AnsiString text, int pocetak);
void __fastcall LogError(TCustomClientDataSet* DataSet, AnsiString poruka, int posalji_poruku);
void __fastcall PosaljiPoruku(AnsiString poruka);
int __fastcall SnimiCDS(TClientDataSet* cds, TSQLConnection* sc);
void __fastcall NamestiInsert( TCustomClientDataSet *DataSet, AnsiString imeTabele);
void __fastcall openArtikliCds();
};
//---------------------------------------------------------------------------
extern PACKAGE Tdb *db;
//---------------------------------------------------------------------------
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment