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

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

class TItsTrafficSubGrade
{
public:
    TItsTrafficSubGrade();
    TItsTrafficSubGrade(String ACode, String ASubCode);
    virtual ~TItsTrafficSubGrade();

private:
    bool    FModified;
    bool    FCompleted;

public:
    String SECT_GRAD_CD;       // VARCHAR2(7 BYTE)              NOT NULL,		'소통 등급 분류';
    String CMTR_GRAD_CD;       // VARCHAR(7 BYTE) NOT NULL,		'공통 코드';
    int    LWST_TRVL_SPED;     // VARCHAR(3 BYTE) NOT NULL,  '공통 분류 코드';
    int    HGHS_TRVL_SPED;     // VARCHAR(60 BYTE),        '공통 코드 한글 명';
    String CNGS_GRAD_YN;       // VARCHAR(60 BYTE),       '공통 코드 영문 명';

public:
    __property bool   Modified  = {read = FModified};
    __property bool   Completed = {read = FCompleted, write = FCompleted};

};

/*
*  Traffic Grade class
*/
class TItsTrafficGrade
{
public:
    TItsTrafficGrade();
    TItsTrafficGrade(String ACode);
    virtual ~TItsTrafficGrade();
private:
    bool    FModified;
    bool    FCompleted;

public:
    String SECT_GRAD_CD;
    String SECT_GRAD_NM;

    TItsMap<String, TItsTrafficSubGrade*>    FSubLists;

public:
    __property bool   Modified  = {read = FModified};
    __property bool   Completed = {read = FCompleted, write = FCompleted};

};
//---------------------------------------------------------------------------

/*
* ItsTrafficGrade Manager
*/
class TItsTrafficGradeManager
{
public:
    TItsTrafficGradeManager();
    virtual ~TItsTrafficGradeManager();

public:
    TItsMap<String, TItsTrafficGrade*>   FLists;

public:
    bool LoadFromDb(TADOConnection *ADbConn=NULL);
    bool LoadTrafficGrade(TADOConnection *ADbConn=NULL);
    bool LoadTrafficSubGrade(TADOConnection *ADbConn=NULL);
};
//---------------------------------------------------------------------------
extern TItsTrafficGradeManager *ItsTrafficGradeManager;
//---------------------------------------------------------------------------


#endif

