179 lines
3.2 KiB
C++
179 lines
3.2 KiB
C++
#include "StdAfx.h"
|
|
#include ".\statusinfo.h"
|
|
|
|
CStatusInfo::CStatusInfo(void)
|
|
{
|
|
m_wStateID = 0;
|
|
m_strType= "";
|
|
m_strStateName = "";
|
|
m_wNameCode = 0;
|
|
m_wDescCode = 0;
|
|
m_wIconCode = 0;
|
|
m_wByType = 0;
|
|
}
|
|
|
|
CStatusInfo::~CStatusInfo(void)
|
|
{
|
|
|
|
}
|
|
|
|
|
|
BOOL CStatusInfo::SetStateID(VARIANT value, int& nErrorCode)
|
|
{
|
|
m_wStateID = CheckWORD(value, nErrorCode);
|
|
|
|
if(nErrorCode == ERROR_NOTHING)
|
|
return TRUE;
|
|
else
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
BOOL CStatusInfo::SetType(VARIANT value, int& nErrorCode)
|
|
{
|
|
m_strType = CheckString(value, nErrorCode);
|
|
|
|
if(nErrorCode == ERROR_NOTHING)
|
|
return TRUE;
|
|
else
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
|
|
BOOL CStatusInfo::SetStateName(VARIANT value, int& nErrorCode)
|
|
{
|
|
m_strStateName = CheckString(value, nErrorCode);
|
|
|
|
if(nErrorCode == ERROR_NOTHING)
|
|
return TRUE;
|
|
else
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
|
|
BOOL CStatusInfo::SetNameCode(VARIANT value, int& nErrorCode)
|
|
{
|
|
m_wNameCode = CheckWORD(value, nErrorCode);
|
|
|
|
if(nErrorCode == ERROR_NOTHING)
|
|
return TRUE;
|
|
else
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
|
|
BOOL CStatusInfo::SetDescCode(VARIANT value, int& nErrorCode)
|
|
{
|
|
m_wDescCode = CheckWORD(value, nErrorCode);
|
|
|
|
if(nErrorCode == ERROR_NOTHING)
|
|
return TRUE;
|
|
else
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
BOOL CStatusInfo::SetIconInfo(VARIANT value, int& nErrorCode)
|
|
{
|
|
m_wIconCode = CheckWORD(value, nErrorCode);
|
|
|
|
if(nErrorCode == ERROR_NOTHING)
|
|
return TRUE;
|
|
else
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
BOOL CStatusInfo::SetByType(VARIANT value, int& nErrorCode)
|
|
{
|
|
m_wByType = CheckWORD(value, nErrorCode);
|
|
|
|
if(nErrorCode == ERROR_NOTHING)
|
|
return TRUE;
|
|
else
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
|
|
BOOL CStatusInfo::SaveData(int nCol,COleVariant value, int& nErrorCode)
|
|
{
|
|
BOOL bSuccess = FALSE;
|
|
unsigned int nNumCol = 1;
|
|
|
|
if(nCol == nNumCol++)
|
|
bSuccess = SetStateID(value, nErrorCode);
|
|
else if(nCol == nNumCol++)
|
|
bSuccess = SetType(value, nErrorCode);
|
|
else if(nCol == nNumCol++)
|
|
bSuccess = SetStateName(value, nErrorCode);
|
|
else if(nCol == nNumCol++)
|
|
bSuccess = SetNameCode(value, nErrorCode);
|
|
else if(nCol == nNumCol++)
|
|
bSuccess = SetDescCode(value, nErrorCode);
|
|
else if(nCol == nNumCol++)
|
|
bSuccess = SetIconInfo(value, nErrorCode);
|
|
else if(nCol == nNumCol++)
|
|
bSuccess = SetByType(value, nErrorCode);
|
|
|
|
return bSuccess;
|
|
}
|
|
|
|
|
|
CString CStatusInfo::GetContentsAll(void)
|
|
{
|
|
CString str, str2;
|
|
|
|
str2.Format("%d", m_wStateID);
|
|
str += str2 + "\t";
|
|
|
|
str += m_strType + "\t";
|
|
str += m_strStateName + "\t";
|
|
|
|
str2.Format("%d", m_wNameCode);
|
|
str += str2 + "\t";
|
|
|
|
str2.Format("%d", m_wDescCode);
|
|
str += str2 + "\t";
|
|
|
|
str2.Format("%d", m_wIconCode);
|
|
str += str2 + "\t";
|
|
|
|
str2.Format("%d", m_wByType);
|
|
str += str2 + "\t";
|
|
|
|
return str;
|
|
}
|
|
|
|
|
|
//이미 메모리에 저장되어 있는것을 가져오는 단계이다...
|
|
//따라서 별다른 체크를 하지 않아도 GetText... 함수를 제외하고
|
|
//별다른 체크를 하지 않아도 된다.
|
|
CString CStatusInfo::GetItem(int nCol)
|
|
{
|
|
CString str;
|
|
|
|
int nNum = 1;
|
|
|
|
if(nCol == nNum++)
|
|
str = GetTextFromWORD( m_wStateID );
|
|
else if(nCol == nNum++)
|
|
str = m_strType;
|
|
else if(nCol == nNum++)
|
|
str = m_strStateName;
|
|
else if(nCol == nNum++)
|
|
str = GetTextFromWORD( m_wNameCode );
|
|
else if(nCol == nNum++)
|
|
str = GetTextFromWORD( m_wDescCode );
|
|
else if(nCol == nNum++)
|
|
str = GetTextFromWORD( m_wIconCode );
|
|
else if(nCol == nNum++)
|
|
str = GetTextFromWORD( m_wByType );
|
|
|
|
return str;
|
|
}
|
|
|