//---------------------------------------------------------------------------

#ifndef IST0080MFH
#define IST0080MFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <jpeg.hpp>
#include <Buttons.hpp>
#include <ImgList.hpp>
#include <Graphics.hpp>
#include <DB.hpp>
#include <DBClient.hpp>
#include <Provider.hpp>
#include <Menus.hpp>
#include <ComCtrls.hpp>
#include <ADODB.hpp>
//---------------------------------------------------------------------------
#include "DataTypesF.h"
#include "PlugInChartF.h"
#include "CDSAtrdF.h"
#include "cxButtons.hpp"
#include "cxClasses.hpp"
#include "cxContainer.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 "cxGridBandedTableView.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridDBBandedTableView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxPC.hpp"
#include "cxPCdxBarPopupMenu.hpp"
#include "cxSpinEdit.hpp"
#include "cxSplitter.hpp"
#include "cxStyles.hpp"
#include "cxTextEdit.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "dxSkinMcSkin.hpp"

//---------------------------------------------------------------------------
#define  MAX_CHART      3
//---------------------------------------------------------------------------
class TIST0080M : public TForm
{
__published:	// IDE-managed Components
	TTimer *TmrRefresh;
	TShape *ShpList;
    TcxPageControl *PgQuery;
    TcxTabSheet *TsDay;
    TcxTabSheet *TsMon;
    TcxTabSheet *TsYear;
    TcxButton *BtnSearch;
    TcxButton *BtnGraph;
    TcxButton *BtnPrint;
    TcxButton *BtnExlSave;
    TcxPageControl *PgList;
    TcxTabSheet *TsListDay;
    TcxTabSheet *TsListMon;
    TcxTabSheet *TsListYear;
    TDateTimePicker *DtDay;
    TDateTimePicker *DtMon;
    TDateTimePicker *DtYear;
    TcxLabel *Lbl2;
    TcxLabel *cxLabel1;
    TcxLabel *cxLabel2;
    TPanel *PnlDayGraph;
    TPanel *PnlMonGraph;
    TPanel *PnlYearGraph;
    TcxSplitter *SplDay;
    TcxSplitter *SplMon;
    TcxSplitter *SplYear;
    TLabel *LblRptTitle;
    TLabel *LblQryTm;
    TLabel *LblQryDay;
    TLabel *LblQryYear;
    TShape *ShpTitle;
    TcxButton *BtnClose;
    TLabel *LblCaption;
    TImageList *LimgTmp;
    TADOQuery *ADOD;
    TDataSource *DSD;
    TADOQuery *ADOM;
    TDataSource *DSM;
    TADOQuery *ADOY;
    TDataSource *DSY;
    TcxGrid *CxMon;
    TcxGridDBBandedTableView *TvMon;
    TcxGridDBBandedColumn *vMonColumnNo;
    TcxGridDBBandedColumn *vMonColumnNm;
    TcxGridDBBandedColumn *vMonColumnTot;
    TcxGridDBBandedColumn *vMonColumn1;
    TcxGridDBBandedColumn *vMonColumn2;
    TcxGridDBBandedColumn *vMonColumn3;
    TcxGridDBBandedColumn *vMonColumn4;
    TcxGridDBBandedColumn *vMonColumn5;
    TcxGridDBBandedColumn *vMonColumn6;
    TcxGridDBBandedColumn *vMonColumn7;
    TcxGridDBBandedColumn *vMonColumn8;
    TcxGridDBBandedColumn *vMonColumn9;
    TcxGridDBBandedColumn *vMonColumn10;
    TcxGridDBBandedColumn *vMonColumn11;
    TcxGridDBBandedColumn *vMonColumn12;
    TcxGridDBBandedColumn *vMonColumn13;
    TcxGridDBBandedColumn *vMonColumn14;
    TcxGridDBBandedColumn *vMonColumn15;
    TcxGridDBBandedColumn *vMonColumn16;
    TcxGridDBBandedColumn *vMonColumn17;
    TcxGridDBBandedColumn *vMonColumn18;
    TcxGridDBBandedColumn *vMonColumn19;
    TcxGridDBBandedColumn *vMonColumn20;
    TcxGridDBBandedColumn *vMonColumn21;
    TcxGridDBBandedColumn *vMonColumn22;
    TcxGridDBBandedColumn *vMonColumn23;
    TcxGridDBBandedColumn *vMonColumn24;
    TcxGridDBBandedColumn *vMonColumn25;
    TcxGridDBBandedColumn *vMonColumn26;
    TcxGridDBBandedColumn *vMonColumn27;
    TcxGridDBBandedColumn *vMonColumn28;
    TcxGridDBBandedColumn *vMonColumn29;
    TcxGridDBBandedColumn *vMonColumn30;
    TcxGridDBBandedColumn *vMonColumn31;
    TcxGridDBBandedColumn *vMonColumnAvg;
    TcxGridLevel *GlMon;
    TcxGrid *CxYear;
    TcxGridDBBandedTableView *TvYear;
    TcxGridDBBandedColumn *vYearColumnNo;
    TcxGridDBBandedColumn *vYearColumnNm;
    TcxGridDBBandedColumn *vYearColumnTot;
    TcxGridDBBandedColumn *vYearColumnAvg;
    TcxGridDBBandedColumn *vYearColumn1;
    TcxGridDBBandedColumn *vYearColumn2;
    TcxGridDBBandedColumn *vYearColumn3;
    TcxGridDBBandedColumn *vYearColumn4;
    TcxGridDBBandedColumn *vYearColumn5;
    TcxGridDBBandedColumn *vYearColumn6;
    TcxGridDBBandedColumn *vYearColumn7;
    TcxGridDBBandedColumn *vYearColumn8;
    TcxGridDBBandedColumn *vYearColumn9;
    TcxGridDBBandedColumn *vYearColumn10;
    TcxGridDBBandedColumn *vYearColumn11;
    TcxGridDBBandedColumn *vYearColumn12;
    TcxGridLevel *GlYear;
    TcxGrid *CxDay;
    TcxGridDBBandedTableView *TvDay;
    TcxGridDBBandedColumn *vDayColumnNo;
    TcxGridDBBandedColumn *vDayColumnNm;
    TcxGridDBBandedColumn *vDayColumnTot;
    TcxGridDBBandedColumn *vDayColumn1;
    TcxGridDBBandedColumn *cxGridDBBandedColumn32;
    TcxGridDBBandedColumn *cxGridDBBandedColumn33;
    TcxGridDBBandedColumn *cxGridDBBandedColumn34;
    TcxGridDBBandedColumn *cxGridDBBandedColumn35;
    TcxGridDBBandedColumn *cxGridDBBandedColumn36;
    TcxGridDBBandedColumn *cxGridDBBandedColumn37;
    TcxGridDBBandedColumn *cxGridDBBandedColumn38;
    TcxGridDBBandedColumn *cxGridDBBandedColumn39;
    TcxGridDBBandedColumn *cxGridDBBandedColumn40;
    TcxGridDBBandedColumn *cxGridDBBandedColumn41;
    TcxGridDBBandedColumn *cxGridDBBandedColumn42;
    TcxGridDBBandedColumn *cxGridDBBandedColumn43;
    TcxGridDBBandedColumn *cxGridDBBandedColumn44;
    TcxGridDBBandedColumn *cxGridDBBandedColumn45;
    TcxGridDBBandedColumn *cxGridDBBandedColumn46;
    TcxGridDBBandedColumn *cxGridDBBandedColumn47;
    TcxGridDBBandedColumn *cxGridDBBandedColumn48;
    TcxGridDBBandedColumn *cxGridDBBandedColumn49;
    TcxGridDBBandedColumn *cxGridDBBandedColumn50;
    TcxGridDBBandedColumn *cxGridDBBandedColumn51;
    TcxGridDBBandedColumn *cxGridDBBandedColumn52;
    TcxGridDBBandedColumn *cxGridDBBandedColumn53;
    TcxGridDBBandedColumn *cxGridDBBandedColumn54;
    TcxGridDBBandedColumn *vDayColumnAvg;
    TcxGridLevel *GlDay;
    TComboBox *CbLinkLevel;
    TComboBox *CbStatCfg;
    TcxGridDBBandedColumn *TvDayColumn1;
    TcxGridDBBandedColumn *TvMonColumn1;
    TcxGridDBBandedColumn *TvYearColumn1;
    TLabel *LblRecordsTm;
    TDateTimePicker *DtStTime;
    TDateTimePicker *DtEdTime;
    TcxLabel *cxLabel3;
    TLabel *LblRecordsDay;
    TLabel *LblRecordsYear;
    TcxLabel *lblText1;
    TcxLabel *lblText2;
    TcxLabel *lblText3;
    TcxLabel *cxLabel4;
    TcxLabel *cxLabel5;
    TcxLabel *lblText4;
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall TmrRefreshTimer(TObject *Sender);
	void __fastcall BtnSearchClick(TObject *Sender);
    void __fastcall BtnGraphClick(TObject *Sender);
    void __fastcall BtnPrintClick(TObject *Sender);
    void __fastcall BtnExlSaveClick(TObject *Sender);
    void __fastcall PgQueryChange(TObject *Sender);
    void __fastcall TvListDataControllerSummaryFooterSummaryItemsSummary(TcxDataSummaryItems *ASender, TcxSummaryEventArguments &Arguments,
          TcxSummaryEventOutArguments &OutArguments);
    void __fastcall TvListDataControllerSummaryDefaultGroupSummaryItemsSummary(TcxDataSummaryItems *ASender, TcxSummaryEventArguments &Arguments,
          TcxSummaryEventOutArguments &OutArguments);
    void __fastcall BtnCloseClick(TObject *Sender);
    void __fastcall vDayColumnCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
          bool &ADone);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
private:	// User declarations

    TPlugInChart    *m_pFrmChart[MAX_CHART];
    String          m_sFooterRight;
    String          m_sLinkLevel;
    String          FTitle;
	String          FStDateTime;
	String          FEdDateTime;

    TItsAtrdManager   *MyItsAtrdManager;

public:		// User declarations
	__fastcall TIST0080M(TComponent* Owner);

    void __fastcall LoadLocalSkin();
    void __fastcall LoadConfig();
	void __fastcall CommClose();
    void __fastcall FormInit();

	void __fastcall RefreshData();

    void __fastcall DispDayStatistics();
    void __fastcall DispMonthStatistics();
    void __fastcall DispYearStatistics();
    void __fastcall ShowRecordCount(int nRecCnt);

    void __fastcall DrawChart(String sTitle);
};
//---------------------------------------------------------------------------
extern PACKAGE TIST0080M *IST0080M;
//---------------------------------------------------------------------------
#endif
