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

#ifndef CDSTrafficOprLinkFH
#define CDSTrafficOprLinkFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <ADODB.hpp>
#include <DB.hpp>
#include "cxCustomData.hpp"
#include "ITSLibF.h"
#include "ITSDbF.h"
//---------------------------------------------------------------------------

/*
*  TrafficOprLink class
*/
class TItsTrafficOprLink
{
public:
    TItsTrafficOprLink();
    virtual ~TItsTrafficOprLink();

private:
    int     FEditMode;
    bool    FModified;
    bool    FCompleted;

public:
    String LINK_ID;        // 링크ID
    String CRTN_DT;        // 생성 일시
    String APLY_STRT_DT;   // 적용 시작 일시
    String APLY_END_DT;    // 적용 종료 일시
    String TFVL;           // 교통량
    String SPED;           // 속도
    String OCPY_RATE;      // 점유율
    String TRVL_HH;        // 통행 시간

	int    FGridIndex;	    // 메인폼에 뿌려지는 그리드 인덱스

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

/*
* TrafficOprLink Manager
*/
class TItsTrafficOprLinkManager
{
public:
    TItsTrafficOprLinkManager();
    virtual ~TItsTrafficOprLinkManager();

public:
    int    FDataSeq;
    TItsMap<String, TItsTrafficOprLink*>   FLists;

public:
    bool LoadFromDb(TADOConnection *ADbConn=NULL);
    bool AllDelete(TADOConnection *ADbConn=NULL);
    bool AllApply(int ALinkLevel, TADOConnection *ADbConn=NULL);
};
//---------------------------------------------------------------------------
extern TItsTrafficOprLinkManager *ItsTrafficOprLinkManager;
//---------------------------------------------------------------------------

#endif

