本文整理汇总了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);
}
示例2: mqlLoad
void dspBillingSelections::sFillList()
{
MetaSQLQuery mql = mqlLoad("billingSelections", "detail");
ParameterList params;
q = mql.toQuery(params);
_cobill->populate(q);
}
示例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;
}
}
示例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;
}
}
示例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);
}
示例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;
}
}
}
示例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();
}
示例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);
}
示例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;
}
}
}
示例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();
}
示例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);
}
示例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);
}
示例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();
}
示例14: mqlLoad
void dspBillingSelections::sFillList()
{
XSqlQuery dspFillList;
MetaSQLQuery mql = mqlLoad("billingSelections", "detail");
ParameterList params;
dspFillList = mql.toQuery(params);
_cobill->populate(dspFillList);
}
示例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__);
}