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

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

/*
*  RepeatCongest class
*/
class TItsRepeatCongest
{
public:
    TItsRepeatCongest();
    virtual ~TItsRepeatCongest();

private:
    bool    FModified;
    bool    FCompleted;

public:
    String IFSC_ID;                // 정보제공구간 ID
    String STAT_YM;                // 통계 년월
    String DAY_TYPE_CD;            // 요일 유형 코드
    String CNFS_STRT_HM;           // 혼잡 시작 시분
    String CNFS_END_HM;            // 혼잡 종료 시분
    String AVRG_SPED;              // 평균 속도
    String AVRG_TRVL_HH;           // 평균 통행 시간
    String DCSN_YN;                // 확정 여부
    String CRTN_YMD;               // 생성 일자
    String REPT_CNGS_SECT_ORGN_CD;	// 반복 정체 구간 원본 코드


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

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

class TItsRepeatCongestWthr
{
public:
    TItsRepeatCongestWthr() {};
    virtual ~TItsRepeatCongestWthr() {};
    void Clear();
private:
    bool    FModified;
    bool    FCompleted;

public:
    String IFSC_ID;                 // 정보제공구간 ID
    String CRTN_YMD;                // 생성 일자
    String WTHR_TYPE_CD;            // 기상 코드
    String CNFS_STRT_HM;            // 혼잡 시작 시분
    String CNFS_END_HM;             // 혼잡 종료 시분
    String AVRG_SPED;               // 평균 속도
    String AVRG_TRVL_HH;            // 평균 통행 시간
    String DCSN_YN;                 // 확정 여부
    String REPT_CNGS_SECT_ORGN_CD;	// 반복 정체 구간 원본 코드

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

/*
* RepeatCongest Manager
*/
class TItsRepeatCongestManager
{
public:
    TItsRepeatCongestManager();
    virtual ~TItsRepeatCongestManager();

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

    TItsMap<String, TItsRepeatCongestWthr*> FListsWthr;
    TItsMap<String, TItsRepeatCongestWthr*> FListsCnfmWthr;
    int                                     FDataSeqWthr;
public:
    bool LoadFromDb(TADOConnection *ADbConn=NULL);
    bool LoadFromDbWthr(TADOConnection *ADbConn=NULL);
    bool LoadFromDbWthrCnfm(TADOConnection *ADbConn=NULL);
};
//---------------------------------------------------------------------------
extern TItsRepeatCongestManager *ItsRepeatCongestManager;
//---------------------------------------------------------------------------

#endif

