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

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

/*
*  FacilityFail class
*/
class TItsFacilityFailAction
{
public:
    TItsFacilityFailAction();
    virtual ~TItsFacilityFailAction();
    void Clear();
private:
    bool    FCompleted;
    int     FEditMode;
	int     FGridIndex;
public:
    String  CRTN_DT;        //'생성 일시
    String  FAIL_HS_SEQ;    //'장애 이력 일련번호
    String  WRKR_NM;        //'작업자 명
    String  WORK_CONT;      //'작업 내용
    String  WORK_STRT_DT;   //'작업 시작 일시
    String  WORK_END_DT;    //'작업 종료 일시
    String  WORK_FINS_YN;   //'작업 완료 여부
    String  ADTN_NM;        //'추가자 명
    String  CHNG_NM;        //'변경자 명
    String  CHNG_DT;        //'변경 일시*/
    String  DEL_YN;

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

/*
*  FacilityFail class
*/
class TItsFacilityFail

{
public:
    TItsFacilityFail();
    virtual ~TItsFacilityFail();
    void Clear();
private:
    bool    FCompleted;
    int     FEditMode;
	int     FGridIndex;
    int     FActionCnt;
public:
    String  FAIL_HS_SEQ;    //"장애이력일련번호";
    String  OCRR_DT;        //"발생일시";
    String  RCPR_NM;        //"접수자명";
    String  ADTN_NM;        //"추가자명";
    String  ADTN_DT;        //"추가일시";
    String  CHNG_NM;        //"변경자명";
    String  CHNG_DT;        //"변경일시";
    String  FAIL_TYPE;      //"장애 유형";
    String  FAIL_CONT;      //"장애 내용";
    String  FCLT_ID;        //"시설물 ID";
    String  DEL_YN;

    TItsMap<String, TItsFacilityFailAction*> FLists;

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

/*
* FacilityFail Manager
*/
class TItsFacilityFailManager
{
public:
    TItsFacilityFailManager();
    virtual ~TItsFacilityFailManager();

public:
    TItsMap<String, TItsFacilityFail*>   FLists;

public:
    bool LoadFromDb(TADOConnection *ADbConn=NULL);
    bool LoadFromDbFail(TADOConnection *ADbConn=NULL);
    bool LoadFromDbFailAction(TADOConnection *ADbConn=NULL);
};
//---------------------------------------------------------------------------
extern TItsFacilityFailManager *ItsFacilityFailManager;
//---------------------------------------------------------------------------

/*
* FacilityFailAction Manager
*/
class TItsFacilityFailActionManager
{
public:
    TItsFacilityFailActionManager();
    virtual ~TItsFacilityFailActionManager();

public:
    int     FDataCnt;
    TItsMap<String, TItsFacilityFailAction*> FLists;

public:
    bool LoadFromDb(TADOConnection *ADbConn=NULL);
    bool LoadFromDbFailAction(String AKeySeq, TADOConnection *ADbConn=NULL);
};
//---------------------------------------------------------------------------
extern TItsFacilityFailActionManager *ItsFacilityFailActionManager;
//---------------------------------------------------------------------------

#endif

