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

#ifndef IDB0110MFH
#define IDB0110MFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <DB.hpp>
#include <DBClient.hpp>
#include <FMTBcd.hpp>
#include <Provider.hpp>
#include <SqlExpr.hpp>
#include <Menus.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include <ComCtrls.hpp>
#include <ADODB.hpp>
//---------------------------------------------------------------------------
#include "DataTypesF.h"
#include "CDSCodeF.h"
#include "CDSOrganF.h"
#include "cxButtons.hpp"
#include "cxCalc.hpp"
#include "cxCheckBox.hpp"
#include "cxClasses.hpp"
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.hpp"
#include "cxDropDownEdit.hpp"
#include "cxEdit.hpp"
#include "cxFilter.hpp"
#include "cxGraphics.hpp"
#include "cxGrid.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxStyles.hpp"
#include "cxTextEdit.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"

class TIDB0110M : public TForm
{
__published:	// IDE-managed Components
    TTimer *TmrShow;
    TShape *ShpTitle;
    TcxButton *BtnSearch;
    TcxButton *BtnClose;
    TLabel *LblCaption;
    TShape *ShpList;
    TEdit *EdFocus;
    TcxGrid *CxList;
    TcxGridLevel *GlList;
    TcxButton *BtnExlSave;
    TcxButton *BtnInsert;
    TcxButton *BtnDelete;
    TcxButton *BtnApply;
    TcxButton *BtnEdit;
    TcxGridTableView *TvList;
    TcxGridColumn *Column00;
    TcxGridColumn *Column01;
    TcxGridColumn *Column02;
    TcxGridColumn *Column03;
    TcxGridColumn *Column04;
    TcxGridColumn *Column05;
    TcxGridColumn *Column06;
    TcxGridColumn *Column07;
    TcxGridColumn *Column08;
    TcxGridColumn *Column09;
    TcxGridColumn *Column10;
    TcxGridColumn *Column99;
    TcxButton *BtnBestFit;
    TcxLabel *LblRecords;
    TcxCheckBox *ChkAutoWidth;
    TPopupMenu *PopupMenu1;
    TMenuItem *MnuInsert;
    TMenuItem *MnuDelete;
    TMenuItem *MnuDeleteCancel;
    TMenuItem *N5;
    TMenuItem *MnuApply;
    TMenuItem *N8;
    TMenuItem *MnuSave;
    TcxGridColumn *Column88;
    TcxLabel *lblInput;
    TcxLabel *lblInQry;
    TcxLabel *lblDigit;
    TcxLabel *lblDigitErr;
    void __fastcall FormShow(TObject *Sender);
    void __fastcall TmrShowTimer(TObject *Sender);
    void __fastcall BtnSearchClick(TObject *Sender);
    void __fastcall BtnCloseClick(TObject *Sender);
    void __fastcall BtnExlSaveClick(TObject *Sender);
    void __fastcall BtnInsertClick(TObject *Sender);
    void __fastcall BtnDeleteClick(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall BtnEditClick(TObject *Sender);
    void __fastcall TvListColumnPropertiesValidate(TObject *Sender, Variant &DisplayValue, TCaption &ErrorText, bool &Error);
    void __fastcall BtnBestFitClick(TObject *Sender);
    void __fastcall ChkAutoWidthPropertiesChange(TObject *Sender);
    void __fastcall MnuDeleteCancelClick(TObject *Sender);
    void __fastcall BtnApplyClick(TObject *Sender);
    void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
    void __fastcall TvListKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
    void __fastcall TvListDataControllerFilterChanged(TObject *Sender);
    void __fastcall TvListCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
          bool &ADone);
          
private:	// User declarations
    void __fastcall CommClose();
    String             FTitle;
    TcxDataController *m_pGDC;
    bool               FUpdate;

public:
    TItsOrganManager *MyItsOrganManager;
    TItsCode         *FCodeCOT;
    String            FInitCombo1;

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

    void __fastcall FormInit();
    void __fastcall InitListCombo();
    void __fastcall RefreshData();
    void __fastcall SelListData();

    void __fastcall ChangeEditMode(bool AEdit);

    bool __fastcall AddObjectItem(TItsOrgan *pObj, String AMode);
    bool __fastcall IsUpdate();
    void __fastcall SaveData();
};
//---------------------------------------------------------------------------
extern PACKAGE TIDB0110M *IDB0110M;
//---------------------------------------------------------------------------

#endif

