这篇教程C++ systemError函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中systemError函数的典型用法代码示例。如果您正苦于以下问题:C++ systemError函数的具体用法?C++ systemError怎么用?C++ systemError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了systemError函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: COUNTvoid postCreditMemos::sPost(){ q.exec( "SELECT cmhead_printed, COUNT(*) AS number " "FROM ( SELECT cmhead_id, cmhead_printed " " FROM cmhead " " WHERE (NOT cmhead_posted) ) AS data " "WHERE (checkCreditMemoSitePrivs(cmhead_id)) " "GROUP BY cmhead_printed;" ); if (q.first()) { int printed = 0; int unprinted = 0; do { if (q.value("cmhead_printed").toBool()) printed = q.value("number").toInt(); else unprinted = q.value("number").toInt(); } while (q.next()); if ( ( (unprinted) && (!printed) ) && (!_postUnprinted->isChecked()) ) { QMessageBox::warning( this, tr("No Credit Memos to Post"), tr( "Although there are unposted Credit Memos, there are no unposted Credit Memos that have been printed./n" "You must manually print these Credit Memos or select 'Post Unprinted Credit Memos' before these Credit Memos/n" "may be posted." ) ); _postUnprinted->setFocus(); return; } } else { QMessageBox::warning( this, tr("No Credit Memos to Post"), tr("There are no Credit Memos, printed or not, to post./n" ) ); _close->setFocus(); return; } q.exec("SELECT fetchJournalNumber('AR-CM') AS result"); if (!q.first()) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } int journalNumber = q.value("result").toInt(); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); q.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations q.prepare("SELECT postCreditMemos(:postUnprinted, :journalNumber) AS result;"); q.bindValue(":postUnprinted", QVariant(_postUnprinted->isChecked())); q.bindValue(":journalNumber", journalNumber); q.exec(); if (q.first()) { int result = q.value("result").toInt(); if (result == -5) { rollback.exec(); QMessageBox::critical( this, tr("Cannot Post one or more Credit Memos"), tr( "The G/L Account Assignments for one or more of the Credit Memos that you are trying to post are not/n" "configured correctly. Because of this, G/L Transactions cannot be posted for these Credit Memos./n" "You must contact your Systems Administrator to have this corrected before you may/n" "post these Credit Memos." ) ); return; } else if (result < 0) { rollback.exec(); systemError( this, tr("A System Error occurred at postCreditMemos::%1, Error #%2.") .arg(__LINE__) .arg(q.value("result").toInt()) ); return; } else if (distributeInventory::SeriesAdjust(q.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Post Credit Memos"), tr("Transaction Canceled") ); return; } q.exec("COMMIT;"); if (_printJournal->isChecked()) { ParameterList params; params.append("journalNumber", journalNumber); orReport report("CreditMemoJournal", params); if (report.isValid()) report.print(); else report.reportError(this);//.........这里部分代码省略.........
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:101,
示例2: COALESCEvoid voucherItem::sFillList(){ q.prepare( "SELECT vodist_id," " COALESCE(costelem_type, :none) AS costelem_type," " vodist_amount, 'currval' AS vodist_amount_xtnumericrole " "FROM vodist " " LEFT OUTER JOIN costelem ON (vodist_costelem_id=costelem_id) " "WHERE ( (vodist_poitem_id=:poitem_id)" " AND (vodist_vohead_id=:vohead_id) );" ); q.bindValue(":none", tr("None")); q.bindValue(":poitem_id", _poitemid); q.bindValue(":vohead_id", _voheadid); q.exec(); _vodist->populate(q); if (q.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(q.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } // Display the total distributed amount q.prepare( "SELECT SUM(vodist_amount) AS totalamount " "FROM vodist " "WHERE ( (vodist_vohead_id=:vohead_id)" " AND (vodist_poitem_id=:poitem_id) );" ); q.bindValue(":vohead_id", _voheadid); q.bindValue(":poitem_id", _poitemid); q.exec(); if (q.first()) _totalDistributed->setLocalValue(q.value("totalamount").toDouble() + _tax->localValue() + _freightToVoucher->localValue()); else if (q.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(q.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } // Fill univoiced receipts list q.prepare( "SELECT porecv_id AS item_id, 1 AS item_type, :receiving AS action," " porecv_date AS item_date," " porecv_qty AS qty, 'qty' AS qty_xtnumericrole," " formatBoolYN(porecv_vohead_id=:vohead_id) AS f_tagged," " 0 AS qty_xttotalrole " "FROM porecv " "WHERE ( (NOT porecv_invoiced)" " AND ((porecv_vohead_id IS NULL) OR (porecv_vohead_id=:vohead_id))" " AND (porecv_poitem_id=:poitem_id) ) " "UNION " "SELECT poreject_id AS item_id, 2 AS item_type, :reject AS action," " poreject_date AS item_date," " poreject_qty * -1 AS qty, 'qty', " " formatBoolYN(poreject_vohead_id=:vohead_id) AS f_tagged," " 0 AS qty_xttotalrole " "FROM poreject " "WHERE ( (poreject_posted)" " AND (NOT poreject_invoiced)" " AND ((poreject_vohead_id IS NULL) OR (poreject_vohead_id=:vohead_id))" " AND (poreject_poitem_id=:poitem_id) );" ); q.bindValue(":receiving", tr("Receiving")); q.bindValue(":reject", tr("Reject")); q.bindValue(":vohead_id", _voheadid); q.bindValue(":poitem_id", _poitemid); q.exec(); _uninvoiced->populate(q, true); if (q.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(q.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } }
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:77,
示例3: trvoid voucherItem::sSave(){ if (_qtyToVoucher->toDouble() <= 0.0) { QMessageBox::critical( this, tr("Cannot Save Voucher Item"), tr("You must enter a postive Quantity to Voucher before saving this Voucher Item") ); _qtyToVoucher->setFocus(); return; } // Check to make sure there is at least distribution for this Voucher Item q.prepare( "SELECT vodist_id " "FROM vodist " "WHERE ( (vodist_vohead_id=:vohead_id)" " AND (vodist_poitem_id=:poitem_id) ) " "LIMIT 1;" ); q.bindValue(":vohead_id", _voheadid); q.bindValue(":poitem_id", _poitemid); q.exec(); if (!q.first()) { QMessageBox::critical( this, tr("Cannot Save Voucher Item"), tr("You must make at least one distribution for this Voucher Item before you may save it.") ); return; } if (q.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(q.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } // Check for vendor matching requirement q.prepare( "SELECT vend_id " " FROM vendinfo,pohead,poitem " " WHERE ( (vend_id=pohead_vend_id) " " AND (pohead_id=poitem_pohead_id) " " AND (poitem_id=:poitem_id) " " AND (vend_match) ); " ); q.bindValue(":poitem_id", _poitemid); q.exec(); if (q.first()) { q.prepare( "SELECT formatMoney(poitem_unitprice * :voitem_qty) AS f_povalue FROM poitem " " WHERE ((poitem_unitprice * :voitem_qty) <> " " (SELECT SUM(vodist_amount) " " FROM vodist " " WHERE ( (vodist_vohead_id=:vohead_id) " " AND (vodist_poitem_id=:poitem_id) ) )" " AND (poitem_id=:poitem_id) ); " ); q.bindValue(":vohead_id", _voheadid); q.bindValue(":poitem_id", _poitemid); q.bindValue(":voitem_qty", _qtyToVoucher->toDouble()); q.exec(); if (q.first()) { QString msg; msg = "The P/O value of "; msg.append( q.value("f_povalue").toString() ); msg.append( " does not match the total distributed value./nInvoice matching is required for this vendor./nStop and correct?" ); if ( QMessageBox::warning( this, tr("Invoice Value Mismatch"), msg, tr("Yes"), tr("No"), QString::null ) != 1 ) return; } } else if (q.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(q.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } // Update the qty vouchered q.prepare( "UPDATE voitem " "SET voitem_close=:voitem_close," " voitem_freight=:voitem_freight, " " voitem_taxtype_id=:voitem_taxtype_id " "WHERE (voitem_id=:voitem_id);" "UPDATE vodist " "SET vodist_qty=:qty " "WHERE ((vodist_vohead_id=:vohead_id)" " AND (vodist_poitem_id=:poitem_id) );" ); q.bindValue(":qty", _qtyToVoucher->toDouble()); q.bindValue(":poitem_id", _poitemid); q.bindValue(":voitem_id", _voitemid); q.bindValue(":vohead_id", _voheadid); q.bindValue(":voitem_close", QVariant(_closePoitem->isChecked())); q.bindValue(":voitem_freight", _freightToVoucher->localValue()); if (_taxtype->id() != -1) q.bindValue(":voitem_taxtype_id", _taxtype->id()); q.exec(); if (q.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(q.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } q.exec("COMMIT;");//.........这里部分代码省略.........
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:101,
示例4: ifvoid customerFormAssignment::sSave(){ int custtypeid = -1; QString custtype = ""; if (_selectedCustomerType->isChecked()) custtypeid = _customerTypes->id(); else if (_customerTypePattern->isChecked()) custtype = _customerType->text().trimmed(); q.prepare("SELECT custform_id" " FROM custform" " WHERE((custform_id != :custform_id)" " AND (custform_custtype = :custform_custtype)" " AND (custform_custtype_id=:custform_custtype_id))"); q.bindValue(":custform_id", _custformid); q.bindValue(":custform_custtype", custtype); q.bindValue(":custform_custtype_id", custtypeid); q.exec(); if(q.first()) { QMessageBox::critical(this, tr("Duplicate Entry"), tr("The Customer Type specified is already in the database.") ); return; } if (_mode == cNew) { q.exec("SELECT NEXTVAL('custform_custform_id_seq') AS _custformid"); if (q.first()) _custformid = q.value("_custformid").toInt(); else if (q.lastError().type() != QSqlError::NoError) { systemError(this, q.lastError().databaseText(), __FILE__, __LINE__); return; } q.prepare( "INSERT INTO custform " "( custform_id, custform_custtype, custform_custtype_id," " custform_invoice_report_name, custform_creditmemo_report_name," " custform_statement_report_name, custform_quote_report_name," " custform_packinglist_report_name, custform_sopicklist_report_name ) " "VALUES " "( :custform_id, :custform_custtype, :custform_custtype_id," " :custform_invoice_report_name, :custform_creditmemo_report_name," " :custform_statement_report_name, :custform_quote_report_name," " :custform_packinglist_report_name, :custform_sopicklist_report_name );" ); } else if (_mode == cEdit) q.prepare( "UPDATE custform " "SET custform_custtype=:custform_custtype, custform_custtype_id=:custform_custtype_id," " custform_invoice_report_name=:custform_invoice_report_name," " custform_creditmemo_report_name=:custform_creditmemo_report_name," " custform_statement_report_name=:custform_statement_report_name," " custform_quote_report_name=:custform_quote_report_name," " custform_packinglist_report_name=:custform_packinglist_report_name," " custform_sopicklist_report_name=:custform_sopicklist_report_name " "WHERE (custform_id=:custform_id);" ); q.bindValue(":custform_id", _custformid); q.bindValue(":custform_custtype", custtype); q.bindValue(":custform_custtype_id", custtypeid); q.bindValue(":custform_invoice_report_name", _invoiceForm->code()); q.bindValue(":custform_creditmemo_report_name", _creditMemoForm->code()); q.bindValue(":custform_statement_report_name", _statementForm->code()); q.bindValue(":custform_quote_report_name", _quoteForm->code()); q.bindValue(":custform_packinglist_report_name", _packingListForm->code()); q.bindValue(":custform_sopicklist_report_name", _soPickListForm->code()); q.exec(); if (q.lastError().type() != QSqlError::NoError) { systemError(this, q.lastError().databaseText(), __FILE__, __LINE__); return; } done(_custformid);}
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:77,
示例5: NEXTVALvoid voucherItem::sToggleReceiving(QTreeWidgetItem *pItem){ double n; QString s; XTreeWidgetItem* item = (XTreeWidgetItem*)pItem; if(item->id() == -1) return; if (item->text(3) == "Yes") { item->setText(3, "No"); if (item->text(0) == "Receiving") { n = _qtyToVoucher->toDouble(); _qtyToVoucher->setText(item->text(2)); n = n - _qtyToVoucher->toDouble(); _qtyToVoucher->setText(s.setNum(n)); n = _uninvoicedReceived->toDouble(); _uninvoicedReceived->setText(item->text(2)); n = n + _uninvoicedReceived->toDouble(); _uninvoicedReceived->setText(s.setNum(n)); } else { n = _qtyToVoucher->toDouble(); _qtyToVoucher->setText(item->text(2)); n = n - _qtyToVoucher->toDouble(); _qtyToVoucher->setText(s.setNum(n)); n = _uninvoicedRejected->toDouble(); _uninvoicedRejected->setText(item->text(2)); n = n + _rejected->toDouble(); _uninvoicedRejected->setText(s.setNum(n)); } } else { item->setText(3, "Yes"); if (item->text(0) == "Receiving") { n = _qtyToVoucher->toDouble(); _qtyToVoucher->setText(item->text(2)); n = n + _qtyToVoucher->toDouble(); _qtyToVoucher->setText(s.setNum(n)); n = _uninvoicedReceived->toDouble(); _uninvoicedReceived->setText(item->text(2)); n = n - _uninvoicedReceived->toDouble(); _uninvoicedReceived->setText(s.setNum(n)); } else { n = _qtyToVoucher->toDouble(); _qtyToVoucher->setText(item->text(2)); n = n + _qtyToVoucher->toDouble(); _qtyToVoucher->setText(s.setNum(n)); n = _uninvoicedRejected->toDouble(); _uninvoicedRejected->setText(item->text(2)); n = n + _uninvoicedRejected->toDouble(); _uninvoicedRejected->setText(s.setNum(n)); } } // Check PO Close flag if ( ((_ordered->toDouble() <= (_received->toDouble() - _rejected->toDouble()))) && (_uninvoicedReceived->toDouble() == 0) && (_uninvoicedRejected->toDouble() == 0) ) _closePoitem->setChecked(true); else _closePoitem->setChecked(false); // Save the voitem information if (_voitemid != -1) { q.prepare( "UPDATE voitem " "SET voitem_qty=:voitem_qty " "WHERE (voitem_id=:voitem_id);" ); q.bindValue(":voitem_id", _voitemid); } else { // Get next voitem id q.prepare("SELECT NEXTVAL('voitem_voitem_id_seq') AS voitemid"); q.exec(); if (q.first()) _voitemid = (q.value("voitemid").toInt()); else if (q.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(q.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } q.prepare( "INSERT INTO voitem " "(voitem_id, voitem_vohead_id, voitem_poitem_id, voitem_close, voitem_qty, voitem_freight) " "VALUES " "(:voitem_id, :vohead_id, :poitem_id, :voitem_close, :voitem_qty, :voitem_freight);" ); }//.........这里部分代码省略.........
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:101,
示例6: GuiErrorCheckvoid selectPayment::sSave(){ XSqlQuery selectSave; QList<GuiErrorCheck> errors; errors << GuiErrorCheck(_selected->isZero(), _selected, tr("<p>You must specify an amount greater than zero. " "If you want to clear this approval you may do so " "from the screen you selected this payment from.") ) << GuiErrorCheck((_selected->localValue() + _discountAmount->localValue()) > (_amount->localValue() + 0.0000001), _selected, tr("You must specify an amount smaller than or equal to the Balance.") ) << GuiErrorCheck(_bankaccnt->id() == -1, _bankaccnt, tr("<p>You must select a Bank Account from which this Payment is to be paid.") ) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Approve for Payment"), errors)) return; selectSave.prepare("SELECT bankaccnt_curr_id, currConcat(bankaccnt_curr_id) AS currAbbr " "FROM bankaccnt " "WHERE bankaccnt_id = :accntid;"); selectSave.bindValue(":accntid", _bankaccnt->id()); selectSave.exec(); if (selectSave.first()) { if (selectSave.value("bankaccnt_curr_id").toInt() != _selected->id()) { int response = QMessageBox::question(this, tr("Currencies Do Not Match"), tr("<p>The currency selected for this payment " "(%1) is not the same as the currency for the " "Bank Account (%2). Would you like to use " "this Bank Account anyway?") .arg(_selected->currAbbr()) .arg(selectSave.value("currAbbr").toString()), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (response == QMessageBox::No) { _bankaccnt->setFocus(); return; } } } else { systemError(this, selectSave.lastError().databaseText(), __FILE__, __LINE__); return; } selectSave.prepare("SELECT selectPayment(:apopen_id, :bankaccnt_id," " :docdate, :curr_id," " :amount, :discount ) AS result;"); selectSave.bindValue(":apopen_id", _apopenid); selectSave.bindValue(":amount", _selected->localValue()); selectSave.bindValue(":bankaccnt_id", _bankaccnt->id()); selectSave.bindValue(":curr_id", _selected->id()); selectSave.bindValue(":docdate", _docDate->date()); selectSave.bindValue(":discount", _discountAmount->localValue()); selectSave.exec(); if (selectSave.first()) { int result = selectSave.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("selectPayment", result), __FILE__, __LINE__); return; } } else { ErrorReporter::error(QtCriticalMsg, this, tr("Select Payment"), selectSave, __FILE__, __LINE__); return; } omfgThis->sPaymentsUpdated(_bankaccnt->id(), _apselectid, true); done (_apselectid);}
开发者ID:chengzhou,项目名称:qt-client,代码行数:80,
示例7: ifenum SetResponse voucherItem::set(const ParameterList &pParams){ XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("curr_id", &valid); if (valid) { _freightToVoucher->setId(param.toInt()); _tax->setId(param.toInt()); } param = pParams.value("effective", &valid); if (valid) { _freightToVoucher->setEffective(param.toDate()); _tax->setEffective(param.toDate()); } param = pParams.value("vohead_id", &valid); if (valid) { _voheadid = param.toInt(); q.prepare("SELECT vohead_taxzone_id " "FROM vohead " "WHERE (vohead_id = :vohead_id);"); q.bindValue(":vohead_id", _voheadid); q.exec(); if (q.first()) _taxzoneid = q.value("vohead_taxzone_id").toInt(); else if (q.lastError().type() != QSqlError::NoError) { systemError(this, q.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } else _taxzoneid = -1; } else _voheadid = -1; param = pParams.value("poitem_id", &valid); if (valid) { _poitemid = param.toInt(); q.prepare( "SELECT pohead_number, poitem_linenumber, poitem_taxtype_id, " " COALESCE(itemsite_id, -1) AS itemsiteid," " poitem_vend_item_number, poitem_vend_uom, poitem_vend_item_descrip," " poitem_duedate," " poitem_qty_ordered," " poitem_qty_received," " poitem_qty_returned," " ( SELECT COALESCE(SUM(porecv_qty), 0)" " FROM porecv" " WHERE ( (porecv_posted)" " AND (NOT porecv_invoiced)" " AND (porecv_vohead_id IS NULL)" " AND (porecv_poitem_id=poitem_id) ) ) AS f_received," " ( SELECT COALESCE(SUM(poreject_qty), 0)" " FROM poreject" " WHERE ( (poreject_posted)" " AND (NOT poreject_invoiced)" " ANd (poreject_vohead_id IS NULL)" " AND (poreject_poitem_id=poitem_id) ) ) AS f_rejected," " poitem_unitprice," " poitem_unitprice * poitem_qty_ordered AS f_extprice," " poitem_freight " "FROM pohead, " " poitem LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id) " "WHERE ( (poitem_pohead_id=pohead_id)" " AND (poitem_id=:poitem_id) );" ); q.bindValue(":poitem_id", _poitemid); q.exec(); if (q.first()) { _poNumber->setText(q.value("pohead_number").toString()); _lineNumber->setText(q.value("poitem_linenumber").toString()); _vendItemNumber->setText(q.value("poitem_vend_item_number").toString()); _vendUOM->setText(q.value("poitem_vend_uom").toString()); _vendDescription->setText(q.value("poitem_vend_item_descrip").toString()); _dueDate->setDate(q.value("poitem_duedate").toDate()); _ordered->setText(q.value("poitem_qty_ordered").toDouble()); _received->setText(q.value("poitem_qty_received").toDouble()); _rejected->setText(q.value("poitem_qty_returned").toDouble()); _uninvoicedReceived->setText(q.value("f_received").toDouble()); _uninvoicedRejected->setText(q.value("f_rejected").toDouble()); _unitPrice->setText(q.value("poitem_unitprice").toDouble()); _extPrice->setText(q.value("f_extprice").toDouble()); _lineFreight->setText(q.value("poitem_freight").toDouble()); _taxtype->setId(q.value("poitem_taxtype_id").toInt()); if (q.value("itemsiteid") != -1) _item->setItemsiteid(q.value("itemsiteid").toInt()); } else if (q.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(q.lastError().databaseText()), __FILE__, __LINE__); reject();//.........这里部分代码省略.........
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:101,
注:本文中的systemError函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ systemInit函数代码示例 C++ system函数代码示例 |