Add getter/setter for CREATE_TIME/SERIAL

--HG--
branch : item_group
This commit is contained in:
Guillaume Dupuy 2017-04-07 12:34:19 +02:00
parent ae6b3e38a0
commit ccd8454d60
2 changed files with 60 additions and 1 deletions

View file

@ -4046,7 +4046,6 @@ void CDBCtrlSheet::setItemPrice(sint32 price)
node->setValue32(price);
}
// ***************************************************************************
sint32 CDBCtrlSheet::getItemResaleFlag() const
{
@ -4071,6 +4070,54 @@ void CDBCtrlSheet::setItemResaleFlag(sint32 rf)
node->setValue32(rf);
}
// ***************************************************************************
sint32 CDBCtrlSheet::getItemCreateTime() const
{
CCDBNodeLeaf *node = getItemCreateTimePtr();
if (!node) return 0;
return node->getValue32();
}
// ***************************************************************************
CCDBNodeLeaf *CDBCtrlSheet::getItemCreateTimePtr() const
{
CCDBNodeBranch *root = getRootBranch();
if (!root) return NULL;
return dynamic_cast<CCDBNodeLeaf *>(root->getNode(ICDBNode::CTextId("CREATE_TIME"), false));
}
// ***************************************************************************
void CDBCtrlSheet::setItemCreateTime(sint32 ct)
{
CCDBNodeLeaf *node = getItemCreateTimePtr();
if (!node) return;
node->setValue32(ct);
}
// ***************************************************************************
sint32 CDBCtrlSheet::getItemSerial() const
{
CCDBNodeLeaf *node = getItemSerialPtr();
if (!node) return 0;
return node->getValue32();
}
// ***************************************************************************
CCDBNodeLeaf *CDBCtrlSheet::getItemSerialPtr() const
{
CCDBNodeBranch *root = getRootBranch();
if (!root) return NULL;
return dynamic_cast<CCDBNodeLeaf *>(root->getNode(ICDBNode::CTextId("SERIAL"), false));
}
// ***************************************************************************
void CDBCtrlSheet::setItemSerial(sint32 rf)
{
CCDBNodeLeaf *node = getItemSerialPtr();
if (!node) return;
node->setValue32(rf);
}
// ***************************************************************************
bool CDBCtrlSheet::getLockedByOwner() const
{

View file

@ -514,6 +514,18 @@ public:
// set item RESALE_FLAG
void setItemResaleFlag(sint32 rf);
//get item CREATE_TIME. 0 if no DB
sint32 getItemCreateTime() const;
NLMISC::CCDBNodeLeaf *getItemCreateTimePtr() const;
// set item CREATE_TIME
void setItemCreateTime(sint32 ct);
//get item SERIAL. 0 if no DB
sint32 getItemSerial() const;
NLMISC::CCDBNodeLeaf *getItemSerialPtr() const;
// set item CREATE_TIME
void setItemSerial(sint32 serial);
// get item locked by owner
bool getLockedByOwner() const;