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

#ifndef PRK0010MFH
#define PRK0010MFH
//---------------------------------------------------------------------------
#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 <Dialogs.hpp>
#include <ExtDlgs.hpp>
//---------------------------------------------------------------------------
#include "WindowMsgF.h"
#include "CDSPrkPlceF.h"
#include "cxButtons.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 "cxGroupBox.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxMaskEdit.hpp"
#include "cxSpinEdit.hpp"
#include "cxSplitter.hpp"
#include "cxStyles.hpp"
#include "cxTextEdit.hpp"
#include "cxTimeEdit.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "FRAME_OpenMapF.h"
#include "dxSkinMcSkin.hpp"
#include "cxCalc.hpp"

class TPRK0010M : public TForm
{
__published:	// IDE-managed Components
    TTimer *TmrShow;
    TShape *ShpTitle;
    TcxButton *BtnClose;
    TLabel *LblCaption;
    TShape *ShpList;
    TEdit *EdFocus;
    TPanel *PnlBack;
    TPanel *PnlBottom;
    TPanel *Panel1;
    TPanel *PnlLeft;
    TcxGroupBox *cxGroupBox3;
    TcxGroupBox *GrpMap;
    TFRAMEOpenMap *FRAMEOpenMap1;
    TcxSplitter *cxSplitter1;
    TcxGrid *CxList;
    TcxGridTableView *TvList;
    TcxGridColumn *ColumnSel;
    TcxGridColumn *Column00;
    TcxGridColumn *Column01;
    TcxGridColumn *Column11;
    TcxGridColumn *Column02;
    TcxGridColumn *Column03;
    TcxGridColumn *Column04;
    TcxGridColumn *Column13;
    TcxGridColumn *Column06;
    TcxGridColumn *Column07;
    TcxGridColumn *Column08;
    TcxGridColumn *Column09;
    TcxGridColumn *Column10;
    TcxGridColumn *Column12;
    TcxGridColumn *Column05;
    TcxGridColumn *Column99;
    TcxGridLevel *GlList;
    TImage *PRK_PLCE_IMAGE_DATA;
    TcxSplitter *cxSplitter3;
    TPanel *PnlEdit;
    TPanel *PnlMenu;
    TcxButton *BtnEdit;
    TcxButton *BtnInsert;
    TcxButton *BtnDelete;
    TcxButton *BtnSave;
    TcxGroupBox *GrpInfo;
    TImage *ImgDesc02;
    TImage *ImgDesc03;
    TImage *ImgDesc04;
    TImage *ImgDesc99;
    TImage *ImgDesc24;
    TImage *ImgDesc79;
    TImage *ImgDesc05;
    TImage *ImgDesc35;
    TcxTextEdit *PRK_PLCE_MANAGE_NO;
    TcxLabel *cxLabel2;
    TcxLabel *cxLabel6;
    TcxTextEdit *PRK_PLCE_NM;
    TcxLabel *cxLabel15;
    TcxTextEdit *PRK_PLCE_NMBR;
    TcxLabel *cxLabel18;
    TcxSpinEdit *PRK_PLCE_ENTRC_LA;
    TcxSpinEdit *PRK_PLCE_ENTRC_LO;
    TcxTextEdit *PRK_PLCE_ADRES;
    TcxButton *BtnOPR_CHRGE;
    TcxButton *BtnOPR_SCHED;
    TcxButton *BtnFLR_NO;
    TPanel *Panel2;
    TImage *ImgDesc07;
    TImage *ImgDesc28;
    TImage *ImgDesc27;
    TImage *ImgDesc29;
    TImage *ImgDesc30;
    TImage *ImgDesc31;
    TImage *ImgDesc32;
    TcxLabel *cxLabel3;
    TcxLabel *cxLabel10;
    TcxComboBox *PARKING_TY;
    TcxComboBox *PARKING_US;
    TcxLabel *cxLabel12;
    TcxLabel *cxLabel13;
    TcxSpinEdit *COLCT_DEVICE_QTY;
    TcxTextEdit *PRK_PLCE_IMAGE_DC;
    TcxLabel *cxLabel1;
    TcxLabel *cxLabel8;
    TcxLabel *cxLabel16;
    TcxLabel *cxLabel20;
    TcxSpinEdit *MASTER_CONTROLLER;
    TcxComboBox *AR_LEVEL_SE;
    TcxLabel *cxLabel25;
    TcxButton *BtnPRK_PLCE_IMAGE_DATA;
    TcxTextEdit *PRK_PLCE_IMAGE_TYPE;
    TcxTextEdit *SYS_NE;
    TcxLabel *cxLabel26;
    TcxTextEdit *PARKING_CNTRL_SYS_INSTL_DE;
    TcxTextEdit *RELATION_LAW_AND_ORDINANCES;
    TcxCheckBox *PRK_AVAIL_CARTYPE0;
    TcxTextEdit *PRK_AVAIL_CARTYPE;
    TcxCheckBox *PRK_AVAIL_CARTYPE1;
    TcxCheckBox *PRK_AVAIL_CARTYPE2;
    TcxCheckBox *PRK_AVAIL_CARTYPE3;
    TcxCheckBox *PRK_AVAIL_CARTYPE6;
    TcxCheckBox *PRK_AVAIL_CARTYPE5;
    TcxCheckBox *PRK_AVAIL_CARTYPE4;
    TcxCheckBox *COLCT_DEVICE_INSTL_AT;
    TcxSpinEdit *SLAVE_CONTROLLER;
    TcxLabel *cxLabel27;
    TcxCheckBox *COLCT_DEVICE_KND0;
    TcxCheckBox *COLCT_DEVICE_KND1;
    TcxCheckBox *COLCT_DEVICE_KND2;
    TcxCheckBox *COLCT_DEVICE_KND3;
    TcxCheckBox *COLCT_DEVICE_KND4;
    TcxCheckBox *COLCT_DEVICE_KND5;
    TcxTextEdit *COLCT_DEVICE_KND;
    TcxCheckBox *CRM_PRV_CCTV_INSTL_AT;
    TcxSpinEdit *CRM_PRV_CCTV_INSTL_CO;
    TcxLabel *cxLabel14;
    TcxComboBox *PIS_TYPE;
    TcxLabel *cxLabel19;
    TcxLabel *cxLabel28;
    TcxTextEdit *PRK_PLCE_OPR_VER;
    TcxLabel *cxLabel29;
    TcxTextEdit *CMPT_INST_NM;
    TcxLabel *cxLabel30;
    TcxTextEdit *OPER_DEPT_NM;
    TcxLabel *cxLabel31;
    TcxTextEdit *OPER_PERSON_NM;
    TcxLabel *cxLabel32;
    TcxTextEdit *OPER_CTT_PC_TEL;
    TcxLabel *cxLabel33;
    TcxTextEdit *OPER_CTT_PC_EMAIL;
    TcxLabel *cxLabel34;
    TcxComboBox *NO_DRV_DAY_OPERTN_AT;
    TcxTextEdit *OPERTN_BS_FREE_TIME;
    TcxLabel *cxLabel35;
    TcxLabel *cxLabel36;
    TcxCheckBox *OPN_CODE;
    TcxLabel *cxLabel37;
    TcxLabel *cxLabel38;
    TcxComboBox *PARKING_CHRGE_EXCCLC_MTHD;
    TcxLabel *cxLabel39;
    TcxCheckBox *PARKING_CHRGE_PYMNT_MN1;
    TcxCheckBox *PARKING_CHRGE_PYMNT_MN2;
    TcxCheckBox *PARKING_CHRGE_PYMNT_MN3;
    TcxCheckBox *PARKING_CHRGE_PYMNT_MN4;
    TcxCheckBox *PARKING_CHRGE_PYMNT_MN5;
    TcxCheckBox *PARKING_CHRGE_PYMNT_MN6;
    TcxCheckBox *PARKING_CHRGE_PYMNT_MN7;
    TcxCheckBox *PARKING_CHRGE_PYMNT_MN8;
    TcxTextEdit *PARKING_CHRGE_PYMNT_MN;
    TcxLabel *cxLabel40;
    TcxComboBox *PARKING_RESVE_OPERTN_AT;
    TcxLabel *cxLabel41;
    TcxTextEdit *PARTCLR_MATTER;
    TcxLabel *cxLabel42;
    TcxSpinEdit *VHCTY_AR_SE0;
    TcxSpinEdit *VHCTY_AR_SE1;
    TcxSpinEdit *VHCTY_AR_SE3;
    TcxSpinEdit *VHCTY_AR_SE2;
    TcxSpinEdit *VHCTY_AR_SE4;
    TcxSpinEdit *VHCTY_AR_SE5;
    TcxSpinEdit *VHCTY_AR_SE6;
    TcxSpinEdit *VHCTY_AR_SE7;
    TcxLabel *cxLabel43;
    TcxLabel *cxLabel44;
    TcxLabel *cxLabel45;
    TcxLabel *cxLabel46;
    TcxLabel *cxLabel47;
    TcxLabel *cxLabel48;
    TcxLabel *cxLabel49;
    TcxLabel *cxLabel50;
    TcxLabel *cxLabel51;
    TcxLabel *cxLabel52;
    TcxSpinEdit *PARKING_CHRGE_BS_TIME;
    TcxSpinEdit *PARKING_CHRGE_BS_CHRGE;
    TcxLabel *cxLabel55;
    TcxSpinEdit *PARKING_CHRGE_ADIT_UNIT_TIME;
    TcxSpinEdit *PARKING_CHRGE_ADIT_UNIT_CHRGE;
    TcxLabel *cxLabel4;
    TcxLabel *cxLabel7;
    TcxTextEdit *COLCT_DEVICE_INSTL_DE;
    TcxLabel *cxLabel24;
    TcxComboBox *PRK_PLCE_ENTRC_EXTTY;
    TcxLabel *cxLabel23;
    TcxTextEdit *PRK_PLCE_ENTRC_NM;
    TcxLabel *cxLabel5;
    TcxTextEdit *PRK_PLCE_ABL_DE;
    TcxTextEdit *PRK_PLCE_INSTL_DE;
    TcxLabel *cxLabel22;
    TcxLabel *cxLabel21;
    TcxTextEdit *PRK_PLCE_STTUS_VER;
    TcxTextEdit *OPR_INFO;
    TcxLabel *cxLabel9;
    TcxLabel *cxLabel11;
    TcxLabel *cxLabel17;
    TcxLabel *cxLabel53;
    TcxLabel *cxLabel54;
    TcxSpinEdit *MIN30_FEE;
    TcxSpinEdit *MIN10_FEE;
    TcxSpinEdit *MON_FEE;
    TcxSpinEdit *DAY_FEE;
    TcxSpinEdit *PRK_CMPRT_CO;
    TcxLabel *cxLabel56;
    void __fastcall FormShow(TObject *Sender);
    void __fastcall TmrShowTimer(TObject *Sender);
    void __fastcall BtnCloseClick(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
    void __fastcall BtnEditClick(TObject *Sender);
    void __fastcall BtnInsertClick(TObject *Sender);
    void __fastcall BtnDeleteClick(TObject *Sender);
    void __fastcall BtnSaveClick(TObject *Sender);
    void __fastcall TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo, TMouseButton AButton,
          TShiftState AShift, bool &AHandled);
    void __fastcall BtnPRK_PLCE_IMAGE_DATAClick(TObject *Sender);
    void __fastcall BtnOPR_CHRGEClick(TObject *Sender);
    void __fastcall BtnOPR_SCHEDClick(TObject *Sender);
    void __fastcall BtnFLR_NOClick(TObject *Sender);

private:	// User declarations
    void __fastcall CommClose();
    TcxDataController *m_pGDC;
    String          FTitle;
    bool            FUpdate;
    bool            FNewDb;
    bool            EditMode;
    bool            MapStart;

public:
    String sJs;
    int    FLayerIdx;
    TItsMap<int, TPrkPlceOprChrge*> FChrges;
    TItsMap<int, TPrkPlceOprSched*> FScheds;
    TItsMap<String, TPrkPlceFlr*>   FFlrs;
    TItsMap<int,    TPrkPlcePrv*>   FPrvs;
    TItsMap<String, TPrkPlceDev*>   FDevs;

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

    void __fastcall FormInit();
    void __fastcall UpdateList();
    void __fastcall UpdateIcon();
    void __fastcall DisplayInfo(TPrkPlce* AObj, bool AMoveObj=true);
    void __fastcall LoadPrkPlceImage(String APrkNmbr);
    bool __fastcall AssignPrkPlceImage(int AImageType, TMemoryStream *AImgStream);
    bool __fastcall UpdatePrkPlceImage(TPrkPlce *AObj);
    bool __fastcall MergePrkPlcePrv(TPrkPlce *AObj);
    bool __fastcall MergePrkPlceFlr(TPrkPlce *AObj);
    bool __fastcall MergePrkPlceFlrDev(TPrkPlce *AObj);
    bool __fastcall MergePrkPlceOprChrge(TPrkPlce *AObj);
    bool __fastcall MergePrkPlceOprSched(TPrkPlce *AObj);

    void __fastcall ChangeEditMode(int AEdit);

    void __fastcall OpenMapCallback(TObject *ASender, const String AFunc, const String AArgs, const bool AFirst);
};
//---------------------------------------------------------------------------
extern PACKAGE TPRK0010M *PRK0010M;
//---------------------------------------------------------------------------

#endif

