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

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

/*
*  Company class
*/
class TItsCompany
{
public:
    TItsCompany();
    virtual ~TItsCompany();
    void Clear();
private:
    int     FEditMode;
    bool    FModified;
    bool    FCompleted;

public:
    String  CMPY_ID;
    String  CMPY_NM;
    String  BRNO;
    String  ADDR;
    String  TEL;
    String  FCSM_NMBR;
    String  RPRV_NM;
    String  CHGR_NM;
    String  CHGR_HP_NMBR;
    String  CHGR_EMAL;
    String  ADTN_NM;
    String  ADTN_DT;
    String  CHNG_NM;
    String  CHNG_DT;
    String  DEL_YN;
	int     FGridIndex;	    // 메인폼에 뿌려지는 그리드 인덱스

protected:

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 };
};
//---------------------------------------------------------------------------

/*
* Company Manager
*/
class TItsCompanyManager
{
public:
    TItsCompanyManager();
    virtual ~TItsCompanyManager();

public:
    TItsMap<String, TItsCompany*>   FLists;

public:
    bool LoadFromDb(TADOConnection *ADbConn=NULL);
};
//---------------------------------------------------------------------------
extern TItsCompanyManager *ItsCompanyManager;
//---------------------------------------------------------------------------

#endif

