Added sell commodity feature.
This commit is contained in:
@@ -17,3 +17,15 @@ QList<QSharedPointer<ShopItem> > CommodityService::shopItems()
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void CommodityService::addedToVoucher(int itemId, int countAdded)
|
||||
{
|
||||
QSharedPointer<CommodityData> commodity = loadById(itemId);
|
||||
|
||||
if (!commodity.isNull())
|
||||
{
|
||||
commodity->setCount(commodity->count() - countAdded);
|
||||
}
|
||||
|
||||
update(commodity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user