#ifndef T2DLL_T2GUESTROOMTABLE_H #define T2DLL_T2GUESTROOMTABLE_H #include "../common.h" #include "LArray.h" #include "T2VerticalTable.h" class AFX_CLASS_EXPORT T2GuestroomTable : T2VerticalTable { public: T2GuestroomTable(T2TowerDoc* inDoc, T2ImageObj* inImageObj, CPalette* inPalette); virtual ~T2GuestroomTable(); virtual void Add(T2GuestroomItem* inItem); virtual void AddList(T2Tenant* inTenant, int inRoomNumber); virtual void SetFront(unsigned int inFront) { mFront = inFront; } virtual void ResetRoomList(int inRoomType); virtual void ValidRelation(); virtual void RevertRelation(); virtual int CountRooms(int inRoomType, int inRoomStatus); virtual void ToggleRelation(const TableCellT& inCell, int inMoneyIndex); virtual void SetInMoneyIndex(int inMoneyIndex); virtual int GetInMoneyIndex(int inRoomType); virtual int CalcInMoney(int inRoomType); void UpdateTenantEstimation(T2TowerDoc* inDoc, int inRoomType); protected: virtual int OnT2DlgItemCreate(CREATESTRUCT* cs); virtual void DrawCellSelf(CDC* pDC, const TableCellT& inCell, BOOL inSelected); virtual void DrawCell(CDC* pDC, const TableCellT& inCell); virtual void ClickCell(const TableCellT& inCell, const CPoint& inPt); virtual void OnT2DlgItemLButtonDown(UINT inFlags, CPoint inPt); virtual BOOL OnT2DlgItemEraseBkgnd(CDC* pDC); unsigned int mFront; LArray mArray; DWORD mClickTime; }; class AFX_CLASS_EXPORT T2GuestroomItem { public: T2GuestroomItem(T2Tenant* inTenant, int inSaveTenantID, long inRoomNumber); int GetRoomNumber(); int GetRoomStatus(); int GetCapacity(); int GetRoomType(); static int GetRoomType(T2Tenant* inTenant); void ToggleRelation(int inMoneyIndex); BOOL IsRelation(); BOOL WasRelation(); void ValidRelation(); void InvalidRelation(); void RevertRelation(); BOOL IsFreeRelation(); BOOL IsStay(); void SetInMoneyIndex(int inIndex); int GetInMoneyIndex(); int GetInMoney(); int GetOutMoney(); void UpdateTenantEstimation(T2TowerDoc* inDoc); T2Tenant* GetTenant() { return mTenant; } protected: T2Tenant *mTenant; unsigned int mSaveTenantID; int mRoomNumber; BOOL mRelation; int mDefaultInMoneyIndex; }; #endif