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

#ifndef CDSBlackBoxFH
#define CDSBlackBoxFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <ADODB.hpp>
#include <DB.hpp>
#include "LibSTLF.hpp"
//---------------------------------------------------------------------------


class TBlackBox
{
public:
    TBlackBox();
    virtual ~TBlackBox();
    void Clear();
private:
    bool    FCompleted;
    int     FEditMode;
	int     FGridIndex;
    String  FMEM_DEL;

public:
    int     BDS_MNGM_NMBR;      //	N	NUMBER(10)	    N			블랙박스 관리 번호
    String  OPNC_NMBR;          //	N	VARCHAR2(128)	Y			개통 번호
    String  MDM_NMBR;           //	N	VARCHAR2(10)	Y			모뎀 번호
    String  USIM_NMBR;          //	N	VARCHAR2(10)	Y			유심 번호
    String  VHCL_NMBR;          //	N	VARCHAR2(15)	Y			차량 번호
    String  OWNR_NM;            //	N   VARCHAR2(30)	Y			소유자 명
    String  PRCT_NM;            //	N   VARCHAR2(30)	Y			제품 명

public:
    __property bool   Completed = {read = FCompleted, write = FCompleted};
	__property int    EditMode  = {read = FEditMode,  write = FEditMode };
	__property int    GridIndex = {read = FGridIndex, write = FGridIndex };
	__property String MEM_DEL   = {read = FMEM_DEL,   write = FMEM_DEL };
};
//---------------------------------------------------------------------------

/*
* BlackBox Manager
*/
class TBlackBoxManager
{
public:
    TBlackBoxManager();
    virtual ~TBlackBoxManager();

public:
    IntMap<TBlackBox>       FLists;

public:
    bool LoadFromDb(TADOConnection *ADbConn=NULL);

    bool LoadBlackBoxTrmn(TADOConnection *ADbConn=NULL);

    bool GetNextBlackBoxId(String &ANewId, TADOConnection *ADbConn=NULL);
    bool DeleteBlackBox(TBlackBox *AObj, TADOConnection *ADbConn=NULL);
    bool UpdateBlackBox(TBlackBox *AObj, TADOConnection *ADbConn=NULL);
    bool InsertBlackBox(TBlackBox *AObj, TADOConnection *ADbConn=NULL);
};
//---------------------------------------------------------------------------
extern TBlackBoxManager *BlackBoxManager;
//---------------------------------------------------------------------------

#endif
