Example #1
0
WUser::WUser(QString userName)
{
    QSqlQuery query;
    query.prepare("SELECT * FROM user WHERE name = ?");
    query.addBindValue(userName);
    query.exec();
    query.next();
    name = query.value(1).toString();
    password = query.value(2).toString();
    id = query.value(3).toString();
    createdDate = query.value(4).toString();
    tel = query.value(5).toString();
    email = query.value(6).toString();
    address = query.value(7).toString();
    zipCode = query.value(8).toString();
    type = query.value(9).toString();
    WCurrentUser::userName = name;
    query.prepare("SELECT number FROM account WHERE userKey = ?");
    query.addBindValue(DBUserManip::dbSelectUserKey());
    query.exec();
    int i = 0;
    while(query.next() && i < 3)
    {
        account.push_back(query.value(0).toString());
        i++;
    }
    WMessage message;
    messageAmount = message.getMessageNumber();
}
Example #2
0
std::wstring WMessageResourceBundle::getValue(const WMessage& message)
{
  std::wstring result;

  for (unsigned i = 0; i < messageResources_.size(); ++i) {
    if (messageResources_[i]->getValue(message, result))
      return result;
  }

  return L"??" + widen(message.key()) + L"??";
}
Example #3
0
bool WMessageResources::getValue(const WMessage& message,
				 std::wstring& result)
{
  if (!loaded_)
    refresh();

  KeyValueMap::const_iterator j;

  j = local_.find(message.key());
  if (j != local_.end()) {
    result = j->second;
    substitute(result, message.args());
    return true;
  }

  j = defaults_.find(message.key());
  if (j != defaults_.end()) {
    result = j->second;
    substitute(result, message.args());
    return true;
  }

  return false;
}
Example #4
0
void WPushButton::setMessage(const WMessage& message)
{
  setText(message.value());
  message_ = message;
}
Example #5
0
void WWebWidget::setToolTipMessage(const WMessage& message)
{
  setToolTip(message.value());
  toolTipMessage_ = message;
}