当前位置: 首页>>代码示例>>C++>>正文


C++ sPopulate函数代码示例

本文整理汇总了C++中sPopulate函数的典型用法代码示例。如果您正苦于以下问题:C++ sPopulate函数的具体用法?C++ sPopulate怎么用?C++ sPopulate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sPopulate函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: releaseCRMAccountNumber

void salesRep::sCheck()
{
  _number->setText(_number->text().trimmed());
  if ((_mode == cNew) && (_number->text().length()))
  {
    if (cNew == _mode && -1 != _NumberGen && _number->text().toInt() != _NumberGen)
    {
      XSqlQuery query;
      query.prepare("SELECT releaseCRMAccountNumber(:Number);");
      query.bindValue(":Number", _NumberGen);
      query.exec();
      _NumberGen = -1;
    }

    XSqlQuery getq;
    getq.prepare( "SELECT salesrep_id "
               "FROM salesrep "
               "WHERE (UPPER(salesrep_number)=UPPER(:salesrep_number));" );
    getq.bindValue(":salesrep_number", _number->text());
    getq.exec();
    if (getq.first())
    {
      _salesrepid = getq.value("salesrep_id").toInt();
      _mode = cEdit;
      sPopulate();

      _number->setEnabled(FALSE);
    }
    else if (ErrorReporter::error(QtCriticalMsg, this,
                                  tr("Error checking for existing Sales Rep"),
                                  getq, __FILE__, __LINE__))
      return;
  }
}
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:34,代码来源:salesRep.cpp

示例2: WHERE

void vendor::sNext()
{
  XSqlQuery vendorNext;
  // Find Next
  vendorNext.prepare("SELECT vend_id "
            "  FROM vendinfo"
            " WHERE (:number < vend_number)"
            " ORDER BY vend_number"
            " LIMIT 1;");
  vendorNext.bindValue(":number", _number->text());
  vendorNext.exec();
  if(!vendorNext.first())
  {
    QMessageBox::information(this, tr("At Last Record"),
       tr("You are already on the last record.") );
    return;
  }
  int newid = vendorNext.value("vend_id").toInt();

  if(!sCheckSave())
    return;

  clear();

  _vendid = newid;
  sPopulate();
}
开发者ID:Saturn49,项目名称:qt-client,代码行数:27,代码来源:vendor.cpp

示例3: releaseCRMAccountNumber

void prospect::sCheckNumber()
{
  _number->setText(_number->text().trimmed().toUpper());

  if (_mode == cNew)
  {
    if (-1 != _NumberGen && _number->text().toInt() != _NumberGen)
    {
      XSqlQuery query;
      query.prepare( "SELECT releaseCRMAccountNumber(:Number);" );
      query.bindValue(":Number", _NumberGen);
      query.exec();
      _NumberGen = -1;
    }

    XSqlQuery getq;
    getq.prepare( "SELECT prospect_id "
               "FROM prospect "
               "WHERE (prospect_number=:prospect);" );
    getq.bindValue(":prospect", _number->text());
    getq.exec();
    if (getq.first())
    {
      _prospectid = getq.value("prospect_id").toInt();
      _mode = cEdit;
      sPopulate();
      emit newId(_prospectid);
      _name->setFocus();
    }
  }
}
开发者ID:Fortyseven,项目名称:qt-client,代码行数:31,代码来源:prospect.cpp

示例4: XDialog

allocateARCreditMemo::allocateARCreditMemo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);
  
  _aropen->setRootIsDecorated(true);
  _aropen->addColumn(tr("Doc. Type"),                   -1, Qt::AlignLeft,   true,  "doctype");
  _aropen->addColumn(tr("Doc. #"),            _orderColumn, Qt::AlignLeft,   true,  "docnumber");
  _aropen->addColumn(tr("Doc. Date"),          _dateColumn, Qt::AlignCenter, true,  "docdate");
  _aropen->addColumn(tr("Due Date"),           _dateColumn, Qt::AlignCenter, true,  "duedate");
  _aropen->addColumn(tr("Amount"),            _moneyColumn, Qt::AlignRight,  true,  "amount");
  _aropen->addColumn(tr("Paid"),              _moneyColumn, Qt::AlignRight,  true,  "paid");
  _aropen->addColumn(tr("Balance"),           _moneyColumn, Qt::AlignRight,  true,  "balance");
  _aropen->addColumn(tr("This Alloc."),       _moneyColumn, Qt::AlignRight,  true,  "allocated");
  _aropen->addColumn(tr("Total Alloc."),      _moneyColumn, Qt::AlignRight,  true,  "totalallocated");

  connect(omfgThis, SIGNAL(creditMemosUpdated()), this, SLOT(sPopulate()));

  if (omfgThis->singleCurrency())
  {
    _aropen->hideColumn("currAbbr");
    _aropen->hideColumn("balance");
  }

  connect(_aropen,      SIGNAL(valid(bool)),    this,           SLOT(sHandleButton()));
  connect(_allocate,	SIGNAL(clicked()),	this,           SLOT(sAllocate()));
  connect(_cancel,	SIGNAL(clicked()),	this,           SLOT(sCancel()));

  _coheadid = -1;
  _invcheadid = -1;
  
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:32,代码来源:allocateARCreditMemo.cpp

示例5: releaseCRMAccountNumber

void taxAuthority::sCheck()
{
  _code->setText(_code->text().trimmed());
  if ( (_mode == cNew) && (_code->text().length()) )
  {
    if(cNew == _mode && -1 != _NumberGen && _code->text().toInt() != _NumberGen)
    {
      XSqlQuery query;
      query.prepare( "SELECT releaseCRMAccountNumber(:Number);" );
      query.bindValue(":Number", _NumberGen);
      query.exec();
      _NumberGen = -1;
    }

    XSqlQuery getq;
    getq.prepare( "SELECT taxauth_id "
               "FROM taxauth "
               "WHERE (UPPER(taxauth_code)=UPPER(:taxauth_code));" );
    getq.bindValue(":taxauth_code", _code->text());
    getq.exec();
    if (getq.first())
    {
      _taxauthid = getq.value("taxauth_id").toInt();
      _mode = cEdit;
      sPopulate();

      _code->setEnabled(FALSE);
    }
    else if (ErrorReporter::error(QtCriticalMsg, this,
                                  tr("Error checking for existing Tax Authority"),
                                  getq, __FILE__, __LINE__))
      return;
  }
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:34,代码来源:taxAuthority.cpp

示例6: reprintMulticopyDocument

reprintCreditMemos::reprintCreditMemos(QWidget    *parent,
                                       const char *name,
                                       bool        modal,
                                       Qt::WFlags  fl)
    : reprintMulticopyDocument("CreditMemoCopies",     "CreditMemoWatermark",
                               "CreditMemoShowPrices", parent, name, modal, fl)
{
  setupUi(optionsWidget());
  setWindowTitle(optionsWidget()->windowTitle());

  list()->addColumn(tr("C/M #"),    _orderColumn, Qt::AlignRight, true,  "docnumber");
  list()->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter,true,  "cmhead_docdate");
  list()->addColumn(tr("Cust. #"),            -1, Qt::AlignLeft,  true,  "cust_number");
  list()->addColumn(tr("Customer"),           -1, Qt::AlignLeft,  true,  "cust_name");
  list()->addColumn(tr("Report"),             -1, Qt::AlignLeft,  false, "reportname");

  _docListQueryString = "SELECT cmhead_id, cust_id,"
                        "      cmhead_number AS docnumber, cmhead_docdate,"
                        "      cust_number, cust_name,"
                        "      findCustomerForm(cust_id, 'C') AS reportname"
                        "  FROM cmhead"
                        "  JOIN custinfo ON (cmhead_cust_id=cust_id)"
                        " WHERE checkCreditMemoSitePrivs(cmhead_id)"
                        " ORDER BY cmhead_docdate DESC;" ;
  setDoctype("CM");
  setReportKey("cmhead_id");

  sPopulate();
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:29,代码来源:reprintCreditMemos.cpp

示例7: sPopulate

void printSinglecopyDocument::setId(int docid)
{
  if (_data->_docid != docid)
  {
    _data->_docid = docid;
    sPopulate();
    emit newId(_data->_docid);
  }
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:9,代码来源:printSinglecopyDocument.cpp

示例8: re

void user::sCheck()
{
    //This regexp checks to make sure the user name starts with a letter.
    QRegExp re("^\\d"); // just digits
    QRegExp re2("^\\w"); // this includes all letters & numbers of all alphabets
    _cUsername = _username->text().trimmed().toLower();
    if (((re.indexIn(_cUsername) != -1) || (re2.indexIn(_cUsername) == -1)) && _username->text() != "")
    {
        QMessageBox::critical(this, tr("Error"), tr("User names must begin with a letter."));
        _username->clear();
        _username->setFocus();
        return;
    }

    if (_cUsername.length() > 0)
    {
        XSqlQuery usrq;
        usrq.prepare("SELECT * FROM usr WHERE (usr_username=:username);");
        usrq.bindValue(":username", _cUsername);
        usrq.exec();
        if (usrq.first())
        {
            sPopulate();
            _mode = cEdit;
            _username->setEnabled(false);
            _properName->setFocus();
        }
        else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting User Account"),
                                      usrq, __FILE__, __LINE__))
            return;

        XSqlQuery dupq;
        dupq.prepare("SELECT crmacct_id"
                     "  FROM crmacct "
                     " WHERE (UPPER(crmacct_number)=UPPER(:username))"
                     "   AND crmacct_usr_username IS NULL;");
        dupq.bindValue(":username", _cUsername);
        dupq.exec();
        if (dupq.first())
        {
            if (QMessageBox::question(this, tr("Convert"),
                                      tr("<p>This number is currently assigned to CRM Account. "
                                         "Do you want to convert the CRM Account to a User Account?"),
                                      QMessageBox::Yes,
                                      QMessageBox::No | QMessageBox::Default) == QMessageBox::No)
            {
                _username->clear();
                _username->setFocus();
                return;
            }
        }
        else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting User CRM"),
                                      dupq, __FILE__, __LINE__))
            return;
    }
}
开发者ID:chengzhou,项目名称:qt-client,代码行数:56,代码来源:user.cpp

示例9: tr

void adjustInvValue::sPost()
{
  XSqlQuery adjustPost;
  struct {
    bool        condition;
    QString     msg;
    QWidget     *widget;
  } error[] = {
    { _itemsiteid == -1,
      tr("You must select a valid Itemsite before posting this transaction."), _item },
    { _newValue->text().length() == 0,
      tr("<p>You must enter a valid New Value before posting this transaction."),
      _newValue },
    { _altAccnt->isChecked() && ! _accnt->isValid(),
      tr("<p>You must enter a valid Alternate G/L Account before posting this transaction."),
      _accnt },
    { true, "", NULL }
  };

  int errIndex;
  for (errIndex = 0; ! error[errIndex].condition; errIndex++)
    ;
  if (! error[errIndex].msg.isEmpty())
  {
    QMessageBox::critical(this, tr("Cannot Post Transaction"),
                          error[errIndex].msg);
    error[errIndex].widget->setFocus();
    return;
  }

  ParameterList params;
  params.append("newValue", _newValue->toDouble());
  params.append("itemsite_id", _itemsiteid);
  if (_altAccnt->isChecked() && _accnt->id() != -1)
    params.append("accnt_id", _accnt->id());

  QString sql = "SELECT adjustInvValue(<? value('itemsite_id') ?>, "
                "                      <? value('newValue') ?>, "
                "                      <? value('accnt_id') ?>) AS result;";

  MetaSQLQuery mql(sql);
  adjustPost = mql.toQuery(params);
  if (adjustPost.lastError().type() != QSqlError::NoError)
  {
    systemError(this, adjustPost.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }

  QMessageBox::information( this, tr("Post Successful"),
                         tr( "<p>Value successfully updated. ") );
  sPopulate();
  _newValue->clear();
}
开发者ID:fblauer,项目名称:qt-client,代码行数:53,代码来源:adjustInvValue.cpp

示例10: sPopulate

void adjustInvValue::sValidateSite(int siteid)
{
  if (siteid != -1)
  {
    _item->setEnabled(true);
  }
  else
  {
    _item->setId(-1);
    _item->setEnabled(false);
  }
  sPopulate();
}
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:13,代码来源:adjustInvValue.cpp

示例11: newdlg

void taxDetail::sNew()
{
  taxAdjustment newdlg(this, "", true);
  ParameterList params;
  params.append("order_id", _orderid);
  params.append("order_type", _ordertype);
  params.append("date", _subtotal->effective());
  params.append("curr_id", _subtotal->id());
  params.append("sense", _sense);
  params.append("mode", "new");
  if (newdlg.set(params) == NoError)
    newdlg.exec();
  sPopulate();
}
开发者ID:dwatson78,项目名称:qt-client,代码行数:14,代码来源:taxDetail.cpp

示例12: XDialog

reprintMulticopyDocument::reprintMulticopyDocument(QWidget    *parent,
                                                   const char *name,
                                                   bool        modal,
                                                   Qt::WindowFlags  fl)
  : XDialog(parent, name, modal, fl)
{
  _data = new reprintMulticopyDocumentPrivate(this);

  connect(_data->_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_data->_query, SIGNAL(clicked()), this, SLOT(sPopulate()));

  // this indirection allows scripts to replace core behavior - 14285
  connect(this, SIGNAL(timeToPrintOneDoc(XTreeWidgetItem*)),
          this, SLOT(sPrintOneDoc(XTreeWidgetItem*)));
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:15,代码来源:reprintMulticopyDocument.cpp

示例13: sPopulate

enum SetResponse allocateARCreditMemo::set(const ParameterList & pParams )
{
  XDialog::set(pParams);
  QVariant param;
  bool     valid;
  
   param = pParams.value("effective", &valid);
   if (valid)
   {
      _total->setEffective(param.toDate());
      _balance->setEffective(param.toDate());
   }

   param = pParams.value("curr_id", &valid);
   if (valid)
   {
      _total->setId(param.toInt());
      _balance->setId(param.toInt());
   }

   param = pParams.value("total", &valid);
   if (valid)
     _total->setLocalValue(param.toDouble());
    
   param = pParams.value("balance", &valid);
   if (valid)
     _balance->setLocalValue(param.toDouble());

   param = pParams.value("cust_id", &valid);
   if (valid)
    _custid = param.toInt();

   param = pParams.value("cohead_id", &valid);
   if (valid)
    _coheadid = param.toInt();

   param = pParams.value("invchead_id", &valid);
   if (valid)
    _invcheadid = param.toInt();

   param = pParams.value("doctype", &valid);
   if (valid)
    _doctype = param.toString();

   sPopulate();

  return NoError;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:48,代码来源:allocateARCreditMemo.cpp


注:本文中的sPopulate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。