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


C++ MetaSQLQuery类代码示例

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


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

示例1: GuiErrorCheck

void saleType::sSave()
{
  XSqlQuery saleTypeSave;

  QList<GuiErrorCheck> errors;
  errors << GuiErrorCheck(_code->text().length() == 0, _code,
                          tr("You must enter a valid Sale Type Code "
                             "before continuing"))
     ;

  if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Sale Type"), errors))
    return;

  MetaSQLQuery mql = mqlLoad("saletype", "table");
  ParameterList params;
  if (_mode == cNew)
    params.append("NewMode");
  else
  {
    params.append("EditMode");
    params.append("saletype_id", _saletypeid);
  }
  params.append("saletype_code", _code->text());
  params.append("saletype_descr", _description->text());
  params.append("saletype_active", QVariant(_active->isChecked()));
  saleTypeSave = mql.toQuery(params);
  if (saleTypeSave.first() && _mode == cNew)
    _saletypeid = saleTypeSave.value("saletype_id").toInt();

  done(_saletypeid);
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:31,代码来源:saleType.cpp

示例2: mqlLoad

void dspBillingSelections::sFillList()
{
  MetaSQLQuery mql = mqlLoad("billingSelections", "detail");
  ParameterList params;
  q = mql.toQuery(params);
  _cobill->populate(q);
}
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:7,代码来源:dspBillingSelections.cpp

示例3: tr

void maintainShipping::sFillList()
{
  XSqlQuery maintainFillList;
  ParameterList params;

  _parameterWidget->appendValue(params);

  if (_metrics->boolean("MultiWhs"))
    params.append("MultiWhs");

  if (_metrics->boolean("EnableSOReservationsByLocation"))
    params.append("includeDistributions");
  
  params.append("notPrinted",	tr("No"));
  params.append("dirty",	tr("Dirty"));
  params.append("printed",	tr("Yes"));

  MetaSQLQuery mql = mqlLoad("maintainShipping", "detail");
  maintainFillList = mql.toQuery(params);
  maintainFillList.exec();
  _ship->populate(maintainFillList, true);
  _ship->expandAll();
  if (maintainFillList.lastError().type() != QSqlError::NoError)
  {
    systemError(this, maintainFillList.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:28,代码来源:maintainShipping.cpp

示例4: COALESCE

void applyARCreditMemo::populate()
{
  XSqlQuery applypopulate;
  applypopulate.prepare( "SELECT aropen_cust_id, aropen_docnumber, aropen_docdate,"
             "       (aropen_amount - aropen_paid - COALESCE(prepared,0.0) - COALESCE(cashapplied,0.0)) AS available,"
             "       COALESCE(SUM(currToCurr(arcreditapply_curr_id, "
             "				     aropen_curr_id, "
             "				     arcreditapply_amount, "
             "				     current_date)), 0) AS f_applied, "
             "	     aropen_curr_id "
             "FROM aropen LEFT OUTER JOIN arcreditapply ON (arcreditapply_source_aropen_id=aropen_id) "
             "       LEFT OUTER JOIN (SELECT aropen_id AS prepared_aropen_id,"
             "                               COALESCE(SUM(checkitem_amount + checkitem_discount),0) AS prepared"
             "                          FROM checkhead JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)"
             "                                     JOIN aropen ON (checkitem_aropen_id=aropen_id)"
             "                         WHERE ((NOT checkhead_posted)"
             "                           AND  (NOT checkhead_void))"
             "                         GROUP BY aropen_id) AS sub1"
             "         ON (prepared_aropen_id=aropen_id)"
             "       LEFT OUTER JOIN (SELECT aropen_id AS cash_aropen_id,"
             "                               SUM(cashrcptitem_amount + cashrcptitem_discount) * -1.0 AS cashapplied"
             "                          FROM cashrcpt JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)"
             "                                     JOIN aropen ON (cashrcptitem_aropen_id=aropen_id)"
             "                         WHERE ((NOT cashrcpt_posted)"
             "                           AND  (NOT cashrcpt_void))"
             "                         GROUP BY aropen_id ) AS sub2"
             "         ON (cash_aropen_id=aropen_id)"
             "WHERE (aropen_id=:aropen_id) "
             "GROUP BY aropen_cust_id, aropen_docnumber, aropen_docdate,"
             "         aropen_amount, aropen_paid, aropen_curr_id, prepared, cashapplied;" );
  applypopulate.bindValue(":aropen_id", _aropenid);
  applypopulate.exec();
  if (applypopulate.first())
  {
    _available->set(applypopulate.value("available").toDouble(),
		    applypopulate.value("aropen_curr_id").toInt(),
		    applypopulate.value("aropen_docdate").toDate(), false);
    _cust->setId(applypopulate.value("aropen_cust_id").toInt());
    _applied->setLocalValue(applypopulate.value("f_applied").toDouble());
    _balance->setLocalValue(_available->localValue() - _applied->localValue());
    _docNumber->setText(applypopulate.value("aropen_docnumber").toString());
    _docDate->setDate(applypopulate.value("aropen_docdate").toDate(), true);
  }
  else
      systemError(this, applypopulate.lastError().databaseText(), __FILE__, __LINE__);

  MetaSQLQuery mql = mqlLoad("arOpenApplications", "detail");
  ParameterList params;
  params.append("cust_id",          _cust->id());
  params.append("debitMemo",        tr("Debit Memo"));
  params.append("invoice",          tr("Invoice"));
  params.append("source_aropen_id", _aropenid);
  applypopulate = mql.toQuery(params);
  _aropen->populate(applypopulate);
  if (applypopulate.lastError().type() != QSqlError::NoError)
  {
    systemError(this, applypopulate.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:60,代码来源:applyARCreditMemo.cpp

示例5: mqlLoad

void selectPayments::sClearAll()
{
  XSqlQuery selectClearAll;
  MetaSQLQuery mql = mqlLoad("selectPayments", "clearall");
  ParameterList params;
  if (! setParams(params))
    return;
  selectClearAll = mql.toQuery(params);
  if (selectClearAll.first())
  {
    int result = selectClearAll.value("result").toInt();
    if (result < 0)
    {
      systemError(this, storedProcErrorLookup("clearPayment", result),
                  __FILE__, __LINE__);
      return;
    }
  }
  else if (selectClearAll.lastError().type() != QSqlError::NoError)
  {
    systemError(this, selectClearAll.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }

  omfgThis->sPaymentsUpdated(-1, -1, true);
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:26,代码来源:selectPayments.cpp

示例6: mqlLoad

void vendorPriceList::sFillList()
{
  XSqlQuery priceq;
  MetaSQLQuery mql = mqlLoad("itemSources", "prices");
  ParameterList params;
  params.append("itemsrc_id", _itemsrcid);
  params.append("nominal",tr("Nominal"));
  params.append("discount",tr("Discount"));
  params.append("price", tr("Price"));
  params.append("fixed", tr("Fixed"));
  params.append("percent", tr("Percent"));
  params.append("mixed", tr("Mixed"));
  params.append("all", tr("All"));
  params.append("stock", tr("Into Stock"));
  params.append("dropship", tr("Drop Ship"));

  priceq = mql.toQuery(params);
  _price->populate(priceq, true);

  priceq = mql.toQuery(params);
  if (priceq.first())
  _unitPrice->setId(priceq.value("itemsrcp_curr_id").toInt());
  _extendedPrice->setId(priceq.value("itemsrcp_curr_id").toInt());

  _price->clearSelection();
  for (int i = 0; i < _price->topLevelItemCount(); i++)
  {
    if ( _qty->toDouble() >= _price->topLevelItem(i)->text(0).toDouble() )
    {
    _price->setCurrentItem(_price->topLevelItem(i));
    _price->scrollToItem(_price->topLevelItem(i));
      break;
    }
  }
}
开发者ID:xtuple,项目名称:qt-client,代码行数:35,代码来源:vendorPriceList.cpp

示例7: reprintMulticopyDocument

reprintInvoices::reprintInvoices(QWidget    *parent,
                                 const char *name,
                                 bool        modal,
                                 Qt::WFlags  fl)
    : reprintMulticopyDocument("InvoiceCopies",     "InvoiceWatermark",
                               "InvoiceShowPrices",
                               parent, name, modal, fl)
{
  setupUi(optionsWidget());
  setWindowTitle(optionsWidget()->windowTitle());

  list()->addColumn(tr("Invoice #"),      _orderColumn, Qt::AlignRight, true, "docnumber");
  list()->addColumn(tr("Doc. Date"),       _dateColumn, Qt::AlignCenter,true, "invchead_invcdate");
  list()->addColumn(tr("Cust. #"),                  -1, Qt::AlignLeft,  true, "cust_number");
  list()->addColumn(tr("Customer"),                 -1, Qt::AlignLeft,  true, "cust_name");
  list()->addColumn(tr("Total Amount"),_bigMoneyColumn, Qt::AlignRight, true, "extprice" );
  list()->addColumn(tr("Balance"),     _bigMoneyColumn, Qt::AlignRight, true, "balance" );
  list()->addColumn(tr("Report"),                   -1, Qt::AlignLeft,  false,"reportname");

  QString      errmsg;
  bool         ok  = false;
  MetaSQLQuery mql = MQLUtil::mqlLoad("invoices", "detail", errmsg, &ok);
  if (! ok)
    ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Invoices"),
                         errmsg, __FILE__, __LINE__);

  setDoctype("IN");
  setReportKey("invchead_id");
  _docListQueryString = mql.getSource();
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:30,代码来源:reprintInvoices.cpp

示例8: mqlLoad

void selectPayments::sClearAll()
{
  XSqlQuery selectClearAll;
  MetaSQLQuery mql = mqlLoad("selectPayments", "clearall");
  ParameterList params;
  if (! setParams(params))
    return;
  selectClearAll = mql.toQuery(params);
  if (selectClearAll.first())
  {
    int result = selectClearAll.value("result").toInt();
    if (result < 0)
    {
      ErrorReporter::error(QtCriticalMsg, this, tr("Error Clearing Payment Information"),
                             storedProcErrorLookup("clearPayment", result),
                             __FILE__, __LINE__);
      return;
    }
  }
  else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Clearing Payment Information"),
                                selectClearAll, __FILE__, __LINE__))
  {
    return;
  }

  omfgThis->sPaymentsUpdated(-1, -1, true);
}
开发者ID:dwatson78,项目名称:qt-client,代码行数:27,代码来源:selectPayments.cpp

示例9: tr

void returnAuthorizationWorkbench::sFillListReview()
{ 
  _ra->clear();

  //Fill Review List
  if (_closed->isChecked() && !_dates->allValid())
  {
    QMessageBox::information( this, tr("Invalid Dates"),
			      tr("<p>Invalid dates specified. Please specify a "
				 "valid date range.") );
    _dates->setFocus();
    return;
  }
  else if ((_receipts->isChecked()) || (_shipments->isChecked()) || 
	        (_payment->isChecked()) || (_closed->isChecked()) ||
			(_unauthorized->isChecked()))
  {
    MetaSQLQuery mql = mqlLoad("returnauthorizationworkbench", "review");
    ParameterList params;
    setParams(params);

    XSqlQuery rareview = mql.toQuery(params);
    _ra->populate(rareview);
    if (rareview.lastError().type() != QSqlError::NoError)
    {
      systemError(this, rareview.lastError().databaseText(), __FILE__, __LINE__);
      return;
    }
  }
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:30,代码来源:returnAuthorizationWorkbench.cpp

示例10: fillListBefore

void display::sFillList(ParameterList pParams, bool forceSetParams)
{
  emit fillListBefore();
  if (forceSetParams || !pParams.count())
  {
    if (!setParams(pParams))
      return;
  }
  int itemid = _data->_list->id();
  bool ok = true;
  QString errorString;
  MetaSQLQuery mql = MQLUtil::mqlLoad(_data->metasqlGroup, _data->metasqlName, errorString, &ok);
  if(!ok)
  {
    systemError(this, errorString, __FILE__, __LINE__);
    return;
  }
  XSqlQuery xq = mql.toQuery(pParams);
  _data->_list->populate(xq, itemid, _data->_useAltId);
  if (xq.lastError().type() != QSqlError::NoError)
  {
    systemError(this, xq.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }
  emit fillListAfter();
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:26,代码来源:display.cpp

示例11: mqlLoad

void itemPricingSchedule::sFillList(int pIpsitemid)
{
    XSqlQuery itemFillList;
    MetaSQLQuery mql = mqlLoad("itemPricingSchedule", "detail");
    ParameterList params;
    params.append("ipshead_id", _ipsheadid);
    params.append("warehous_id", _warehouse->id());
    params.append("item",tr("Item"));
    params.append("prodcat", tr("Prod. Cat."));
    params.append("flatrate", tr("Flat Rate"));
    params.append("peruom", tr("Price Per UOM"));
    params.append("nominal",tr("Nominal"));
    params.append("discount",tr("Discount"));
    params.append("markup",tr("Markup"));
    params.append("freight", tr("Freight"));
    params.append("price", tr("Price"));
    params.append("fixed", tr("Fixed"));
    params.append("percent", tr("Percent"));
    params.append("mixed", tr("Mixed"));
    params.append("allsites", tr("All Sites"));
    params.append("allzones", tr("All Shipping Zones"));

    itemFillList = mql.toQuery(params);

    if (pIpsitemid == -1)
        _ipsitem->populate(itemFillList, true);
    else
        _ipsitem->populate(itemFillList, pIpsitemid, true);

    _currency->setEnabled(_ipsitem->topLevelItemCount() <= 0);
}
开发者ID:hescoinc,项目名称:qt-client,代码行数:31,代码来源:itemPricingSchedule.cpp

示例12: mqlLoad

void itemSourceSearch::sFillList()
{
  XSqlQuery itemFillList;
  _itemsrc->clear();
  MetaSQLQuery mql = mqlLoad("itemSources", "search");
  ParameterList params;
  params.append("vend_id", _vendid);
  params.append("item_id", _itemid);
  params.append("non", tr("Non-Inventory"));
  if(_searchNumber->isChecked())
    params.append("searchNumber", _search->text());
  if(_searchVendNumber->isChecked())
    params.append("searchVendNumber", _search->text());
  if(_searchDescrip1->isChecked())
    params.append("searchDescrip1", _search->text());
  if(_searchDescrip2->isChecked())
    params.append("searchDescrip2", _search->text());
  if(_searchVendDescrip->isChecked())
    params.append("searchVendDescrip", _search->text());
  if(_searchManufName->isChecked())
    params.append("searchManufName", _search->text());
  if(_searchManufNumber->isChecked())
    params.append("searchManufNumber", _search->text());

  itemFillList = mql.toQuery(params);
  _itemsrc->populate(itemFillList, TRUE);
}
开发者ID:hescoinc,项目名称:qt-client,代码行数:27,代码来源:itemSourceSearch.cpp

示例13: sPost

void postCountTags::sPost()
{
  ParameterList postp;
  if (! setParams(postp))
    return;

  bool    valid = false;
  QString errmsg;
  MetaSQLQuery postm = MQLUtil::mqlLoad("postCountTags", "post",
                                        errmsg, &valid);
  if (! valid)
  {
    QMessageBox::critical(this, tr("Query Error"), errmsg);
    return;
  }

  XSqlQuery postq = postm.toQuery(postp);
  if (postq.first())
  {
    int result = postq.value("result").toInt();
    if (result < 0)
    {
      QMessageBox::critical(this, tr("One or More Posts Failed"),
                            storedProcErrorLookup("postCountTag", result));
      return;
    }
  }
  else if (postq.lastError().type() != QSqlError::NoError)
  {
    QMessageBox::critical(this, tr("Database Error"), postq.lastError().text());
    return;
  }

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

示例14: mqlLoad

void dspBillingSelections::sFillList()
{
  XSqlQuery dspFillList;
  MetaSQLQuery mql = mqlLoad("billingSelections", "detail");
  ParameterList params;
  dspFillList = mql.toQuery(params);
  _cobill->populate(dspFillList);
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:8,代码来源:dspBillingSelections.cpp

示例15: mqlLoad

void updatePrices::closeEvent(QCloseEvent * /*pEvent*/)
{
  XSqlQuery updatecloseEvent;
  MetaSQLQuery mql = mqlLoad("updateprices", "dropselsched");
  ParameterList params;
  updatecloseEvent = mql.toQuery(params);
  if (updatecloseEvent.lastError().type() != QSqlError::NoError)
    systemError(this, updatecloseEvent.lastError().databaseText(), __FILE__, __LINE__);
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:9,代码来源:updatePrices.cpp


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