本文整理汇总了C++中ParameterList::value方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterList::value方法的具体用法?C++ ParameterList::value怎么用?C++ ParameterList::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterList
的用法示例。
在下文中一共展示了ParameterList::value方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set
enum SetResponse workCenter::set(ParameterList &pParams)
{
QVariant param;
bool valid;
param = pParams.value("wrkcnt_id", &valid);
if (valid)
{
_wrkcntid = param.toInt();
populate();
}
param = pParams.value("mode", &valid);
if (valid)
{
if (param.toString() == "new")
{
_mode = cNew;
_code->setFocus();
}
else if (param.toString() == "edit")
{
_mode = cEdit;
_description->setFocus();
}
else if (param.toString() == "copy")
{
_mode = cNew;
_code->clear();
_code->setFocus();
}
else if (param.toString() == "view")
{
_mode = cView;
_code->setEnabled(FALSE);
_description->setEnabled(FALSE);
_department->setEnabled(FALSE);
_warehouse->setEnabled(FALSE);
_wipLocation->setEnabled(FALSE);
_numOfMachines->setEnabled(FALSE);
_numOfPeople->setEnabled(FALSE);
_setupSpecifyRate->setEnabled(FALSE);
_setupUseSelectedRate->setEnabled(FALSE);
_setupRate->setEnabled(FALSE);
_stdSetupRate->setEnabled(FALSE);
_setupType->setEnabled(FALSE);
_runSpecifyRate->setEnabled(FALSE);
_runUseSelectedRate->setEnabled(FALSE);
_runRate->setEnabled(FALSE);
_stdRunRate->setEnabled(FALSE);
_overheadPrcntOfLabor->setEnabled(FALSE);
_overheadPerLaborHour->setEnabled(FALSE);
_overheadPerMachHour->setEnabled(FALSE);
_overheadPerUnit->setEnabled(FALSE);
_avgQueueDays->setEnabled(FALSE);
_avgSetup->setEnabled(FALSE);
_dailyCapacity->setEnabled(FALSE);
_efficiencyFactor->setEnabled(FALSE);
_comments->setEnabled(FALSE);
_close->setText(tr("&Close"));
_save->hide();
_close->setFocus();
}
}
return NoError;
}
示例2: set
enum SetResponse hotkey::set(const ParameterList &pParams)
{
XDialog::set(pParams);
QVariant param;
bool valid;
param = pParams.value("mode", &valid);
if (valid)
{
if (param.toString() == "new")
_mode = cNew;
else if (param.toString() == "edit")
{
_mode = cEdit;
_hotkey->setEnabled(FALSE);
}
}
param = pParams.value("username", &valid);
if (valid)
{
_username = param.toString();
_currentUser = FALSE;
}
param = pParams.value("currentUser", &valid);
if (valid)
_currentUser = TRUE;
param = pParams.value("hotkey", &valid);
if (valid)
{
QString value;
if (_currentUser)
value = _preferences->value(param.toString());
else
{
q.prepare( "SELECT usrpref_value "
"FROM usrpref "
"WHERE ( (usrpref_username=:username)"
" AND (usrpref_name=:name) );" );
q.bindValue(":username", _username);
q.bindValue(":name", param.toString());
q.exec();
if (q.first())
value = q.value("usrpref_value").toString();
// ToDo
}
if (!value.isNull())
{
for (int i = 0; i < _action->topLevelItemCount(); i++)
{
XTreeWidgetItem *cursor = _action->topLevelItem(i);
if (param.toString().left(1) == "F")
_hotkey->setText(QString("F%1").arg(param.toString().right(1)));
else if (param.toString().left(1) == "C")
_hotkey->setText(QString("Ctrl+%1").arg(param.toString().right(1)));
if (cursor->text(0) == value)
{
_action->setCurrentItem(cursor);
_action->scrollToItem(cursor);
break;
}
}
}
}
return NoError;
}
示例3: set
enum SetResponse invoiceItem::set(const ParameterList &pParams)
{
XSqlQuery invoiceet;
XDialog::set(pParams);
QVariant param;
bool valid;
param = pParams.value("invchead_id", &valid);
if (valid)
{
_invcheadid = param.toInt();
invoiceet.prepare("SELECT * "
"FROM invchead "
"WHERE (invchead_id = :invchead_id);");
invoiceet.bindValue(":invchead_id", _invcheadid);
invoiceet.exec();
if (invoiceet.first())
{
_invoiceNumber->setText(invoiceet.value("invchead_invcnumber").toString());
_custid = invoiceet.value("invchead_cust_id").toInt();
_taxzoneid = invoiceet.value("invchead_taxzone_id").toInt();
_tax->setId(invoiceet.value("invchead_curr_id").toInt());
_price->setId(invoiceet.value("invchead_curr_id").toInt());
_price->setEffective(invoiceet.value("invchead_invcdate").toDate());
sPriceGroup();
}
else if (invoiceet.lastError().type() != QSqlError::NoError)
{
systemError(this, invoiceet.lastError().databaseText(), __FILE__, __LINE__);
return UndefinedError;
}
}
param = pParams.value("invcitem_id", &valid);
if (valid)
{
_invcitemid = param.toInt();
populate();
}
param = pParams.value("mode", &valid);
if (valid)
{
if (param.toString() == "new")
{
_mode = cNew;
invoiceet.exec("SELECT NEXTVAL('invcitem_invcitem_id_seq') AS invcitem_id;");
if (invoiceet.first())
_invcitemid = invoiceet.value("invcitem_id").toInt();
else if (invoiceet.lastError().type() != QSqlError::NoError)
{
systemError(this, invoiceet.lastError().databaseText(), __FILE__, __LINE__);
return UndefinedError;
}
invoiceet.prepare( "SELECT (COALESCE(MAX(invcitem_linenumber), 0) + 1) AS linenumber "
"FROM invcitem "
"WHERE (invcitem_invchead_id=:invchead_id);" );
invoiceet.bindValue(":invchead_id", _invcheadid);
invoiceet.exec();
if (invoiceet.first())
_lineNumber->setText(invoiceet.value("linenumber").toString());
else if (invoiceet.lastError().type() != QSqlError::NoError)
{
systemError(this, invoiceet.lastError().databaseText(), __FILE__, __LINE__);
return UndefinedError;
}
connect(_billed, SIGNAL(editingFinished()), this, SLOT(sDeterminePrice()));
connect(_billed, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice()));
connect(_price, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice()));
_item->setType(ItemLineEdit::cSold);
_salescat->setType(XComboBox::SalesCategoriesActive);
}
else if (param.toString() == "edit")
{
_mode = cEdit;
connect(_billed, SIGNAL(editingFinished()), this, SLOT(sDeterminePrice()));
connect(_billed, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice()));
connect(_price, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice()));
}
else if (param.toString() == "view")
{
_mode = cView;
_itemTypeGroup->setEnabled(FALSE);
_custPn->setEnabled(FALSE);
_ordered->setEnabled(FALSE);
_billed->setEnabled(FALSE);
_price->setEnabled(FALSE);
_notes->setReadOnly(TRUE);
_taxtype->setEnabled(false);
_altRevAccnt->setEnabled(false);
_qtyUOM->setEnabled(false);
_pricingUOM->setEnabled(false);
_save->hide();
//.........这里部分代码省略.........
示例4: setParams
bool projects::setParams(ParameterList ¶ms)
{
if (!display::setParams(params))
return false;
bool valid;
QVariant param;
param = params.value("prjstatus_id", &valid);
if (valid)
params.append("prjstatus", _statuses.at(param.toInt()));
if (_showComplete->isChecked())
params.append("showComplete",true);
if (_salesOrders->isChecked())
params.append("showSo", true);
if (_workOrders->isChecked())
params.append("showWo", true);
if (_purchaseOrders->isChecked())
params.append("showPo", true);
if (_incidents->isChecked())
params.append("showIn", true);
params.append("planning", tr("Concept"));
params.append("open", tr("In-Process"));
params.append("complete", tr("Complete"));
params.append("undefined", tr("Undefined"));
params.append("so", tr("Sales Order"));
params.append("wo", tr("Work Order"));
params.append("po", tr("Purchase Order"));
params.append("pr", tr("Purchase Request"));
params.append("sos", tr("Sales Orders"));
params.append("wos", tr("Work Orders"));
params.append("pos", tr("Purchase Orders"));
params.append("prs", tr("Purchase Requests"));
params.append("quote", tr("Quote"));
params.append("quotes", tr("Quotes"));
params.append("invoice", tr("Invoice"));
params.append("invoices", tr("Invoices"));
params.append("task", tr("Task"));
params.append("tasks", tr("Tasks"));
params.append("open", tr("Open"));
params.append("closed", tr("Closed"));
params.append("converted", tr("Converted"));
params.append("canceled", tr("Canceled"));
params.append("expired", tr("Expired"));
params.append("unposted", tr("Unposted"));
params.append("posted", tr("Posted"));
params.append("exploded", tr("Exploded"));
params.append("released", tr("Released"));
params.append("planning", tr("Concept"));
params.append("inprocess", tr("In Process"));
params.append("complete", tr("Complete"));
params.append("unreleased", tr("Unreleased"));
params.append("total", tr("Total"));
return true;
}
示例5: updateCCPay
int CreditCardProcessor::updateCCPay(int &pccpayid, ParameterList &pparams)
{
if (DEBUG)
qDebug("updateCCPay(%d, %d params)", pccpayid, pparams.size());
QString sql;
XSqlQuery ccq;
bool valid;
QVariant param;
QString r_error;
param = pparams.value("r_error", &valid);
if (valid)
r_error = param.toString();
if (pccpayid > 0)
{
sql = "UPDATE ccpay SET"
"<? if exists(\"fromcurr\") ?>"
" ccpay_amount=ROUND(currToCurr(<? value(\"fromcurr\") ?>,"
" <? value(\"tocurr\") ?>,"
" <? value(\"amount\") ?>,"
" CURRENT_DATE), 2),"
" ccpay_curr_id=<? value(\"currid\") ?>,"
"<? else ?>"
" ccpay_amount=ROUND(<? value(\"amount\") ?>, 2),"
" ccpay_curr_id=<? value(\"currid\") ?>,"
"<? endif ?>"
" ccpay_auth=<? value(\"auth\") ?>,"
" ccpay_r_approved=<? value(\"approved\") ?>,"
" ccpay_r_avs=<? value(\"avs\") ?>,"
" ccpay_r_code=<? value(\"code\") ?>,"
" ccpay_r_error=<? value(\"error\") ?>,"
" ccpay_r_message=<? value(\"message\") ?>,"
" ccpay_r_ordernum=<? value(\"ordernum\") ?>,"
" ccpay_r_ref=<? value(\"ref\") ?>,"
"<? if exists(\"shipping\") ?>"
" ccpay_r_shipping=<? value(\"shipping\") ?>,"
"<? endif ?>"
"<? if exists(\"score\") ?>"
" ccpay_yp_r_score=<? value(\"score\") ?>,"
"<? endif ?>"
"<? if exists(\"tax\") ?>"
" ccpay_r_tax=<? value(\"tax\") ?>,"
"<? endif ?>"
"<? if exists(\"tdate\") ?>"
" ccpay_yp_r_tdate=<? value(\"tdate\") ?>,"
"<? endif ?>"
"<? if exists(\"time\") ?>"
" ccpay_yp_r_time=<? value(\"time\")?>,"
"<? endif ?>"
" ccpay_status=<? value(\"status\") ?>"
" WHERE (ccpay_id=<? value(\"ccpay_id\") ?>);" ;
}
else
{
ccq.exec("SELECT NEXTVAL('ccpay_ccpay_id_seq') AS ccpay_id;");
if (ccq.first())
pccpayid = ccq.value("ccpay_id").toInt();
else if (ccq.lastError().type() != QSqlError::None && r_error.isEmpty())
{
_errorMsg = errorMsg(4).arg(ccq.lastError().databaseText());
return 1;
}
else if (ccq.lastError().type() == QSqlError::None && r_error.isEmpty())
{
_errorMsg = errorMsg(4).arg(errorMsg(2));
return 2;
}
else // no rows found and YP reported an error
{
_errorMsg = errorMsg(-12).arg(r_error);
return -12;
}
if (pparams.inList("ordernum") && pparams.value("ordernum").toInt() > 0)
{
QString maxs("SELECT MAX(COALESCE(ccpay_order_number_seq, -1)) + 1"
" AS next_seq "
" FROM ccpay "
" WHERE (ccpay_order_number=<? value(\"ordernum\") ?>);");
MetaSQLQuery maxm(maxs);
ccq = maxm.toQuery(pparams);
if (ccq.first())
pparams.append("next_seq", ccq.value("next_seq"));
else
pparams.append("next_seq", 0);
}
else
pparams.append("next_seq", 0);
sql = "INSERT INTO ccpay ("
" ccpay_id, ccpay_ccard_id, ccpay_cust_id,"
" ccpay_type,"
" ccpay_amount,"
" ccpay_curr_id,"
" ccpay_auth, ccpay_auth_charge,"
" ccpay_order_number,"
" ccpay_order_number_seq,"
" ccpay_r_approved, ccpay_r_avs,"
//.........这里部分代码省略.........
示例6: setParams
bool dspGLTransactions::setParams(ParameterList ¶ms)
{
if (!display::setParams(params))
return false;
bool valid;
QVariant param;
param = params.value("accnttype_id", &valid);
if (valid)
{
int typid = param.toInt();
QString type;
if (typid == 1)
type = "A";
else if (typid ==2)
type = "E";
else if (typid ==3)
type = "L";
else if (typid ==4)
type = "Q";
else if (typid ==5)
type = "R";
params.append("accntType", type);
}
param = params.value("source_id", &valid);
if (valid)
params.append("source", _sources.at(param.toInt()));
param = params.value("num_id", &valid);
if (valid)
{
XSqlQuery num;
num.prepare("SELECT accnt_number "
"FROM accnt "
"WHERE (accnt_id=:accnt_id);");
num.bindValue(":accnt_id", params.value("num_id").toInt());
num.exec();
if (num.first())
params.append("accnt_number", num.value("accnt_number").toString());
}
param = params.value("accnt_id", &valid);
if (valid)
{
if (_showRunningTotal->isChecked() &&
_showRunningTotal->isVisible())
{
double beginning = 0;
QDate periodStart = params.value("startDate").toDate();
XSqlQuery begq;
begq.prepare("SELECT "
" CASE WHEN accnt_type IN ('A','E') THEN "
" trialbal_beginning * -1 "
" ELSE trialbal_beginning END AS trialbal_beginning,"
" period_start "
"FROM trialbal "
" JOIN accnt ON (trialbal_accnt_id=accnt_id), "
" period "
"WHERE ((trialbal_period_id=period_id)"
" AND (trialbal_accnt_id=:accnt_id)"
" AND (:start BETWEEN period_start AND period_end));");
begq.bindValue(":accnt_id", params.value("accnt_id").toInt());
begq.bindValue(":start", params.value("startDate").toDate());
begq.exec();
if (begq.first())
{
beginning = begq.value("trialbal_beginning").toDouble();
periodStart = begq.value("period_start").toDate();
}
else if (begq.lastError().type() != QSqlError::NoError)
{
systemError(this, begq.lastError().databaseText(), __FILE__, __LINE__);
return false;
}
XSqlQuery glq;
glq.prepare("SELECT CASE WHEN accnt_type IN ('A','E') THEN "
" COALESCE(SUM(gltrans_amount),0) * -1"
" ELSE COALESCE(SUM(gltrans_amount),0) END AS glamount "
"FROM gltrans "
" JOIN accnt ON (gltrans_accnt_id=accnt_id) "
"WHERE ((gltrans_date BETWEEN :periodstart AND date :querystart - interval '1 day')"
" AND (gltrans_accnt_id=:accnt_id)) "
"GROUP BY accnt_type;");
glq.bindValue(":periodstart", periodStart);
glq.bindValue(":querystart", params.value("startDate").toDate());
glq.bindValue(":accnt_id", params.value("accnt_id").toInt());
glq.exec();
if (glq.first())
beginning += glq.value("glamount").toDouble();
else if (glq.lastError().type() != QSqlError::NoError)
{
systemError(this, glq.lastError().databaseText(), __FILE__, __LINE__);
return false;
}
params.append("beginningBalance", beginning);
//.........这里部分代码省略.........
示例7: sFillList
void dspGLTransactions::sFillList()
{
if (!_metrics->boolean("ManualForwardUpdate") &&
_selectedAccount->isChecked() &&
_showRunningTotal->isChecked())
{
if (!forwardUpdate())
return;
}
MetaSQLQuery mql("SELECT gltrans.*,"
" CASE WHEN(gltrans_docnumber='Misc.' AND"
" invhist_docnumber IS NOT NULL) THEN"
" (gltrans_docnumber || ' - ' || invhist_docnumber)"
" ELSE gltrans_docnumber"
" END AS docnumber,"
" firstLine(gltrans_notes) AS notes,"
" (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account,"
" CASE WHEN (gltrans_amount < 0) THEN ABS(gltrans_amount)"
" ELSE NULL"
" END AS debit,"
" CASE WHEN (gltrans_amount > 0) THEN gltrans_amount"
" ELSE NULL"
" END AS credit,"
" CASE WHEN accnt_type IN ('A','E') THEN "
" gltrans_amount * -1 "
" ELSE gltrans_amount END AS running,"
" 'curr' AS debit_xtnumericrole,"
" 'curr' AS credit_xtnumericrole,"
" 'curr' AS running_xtnumericrole,"
" 0 AS running_xtrunningrole,"
" <? value(\"beginningBalance\") ?> AS running_xtrunninginit "
"FROM gltrans JOIN accnt ON (gltrans_accnt_id=accnt_id) "
" LEFT OUTER JOIN invhist ON (gltrans_misc_id=invhist_id"
" AND gltrans_docnumber='Misc.') "
"WHERE ((gltrans_date BETWEEN <? value(\"startDate\") ?>"
" AND <? value(\"endDate\") ?>)"
"<? if exists(\"accnt_id\") ?>"
" AND (gltrans_accnt_id=<? value(\"accnt_id\") ?>)"
"<? endif ?>"
"<? if exists(\"source\") ?>"
" AND (gltrans_source=<? value(\"source\") ?>)"
"<? endif ?>"
") "
"ORDER BY gltrans_created"
"<? if not exists(\"beginningBalance\") ?> DESC <? endif ?>,"
" gltrans_sequence, gltrans_amount;");
ParameterList params;
if (! setParams(params))
return;
_beginningBalanceLit->setVisible(_selectedAccount->isChecked() && _showRunningTotal->isChecked());
_beginningBalance->setVisible(_selectedAccount->isChecked() && _showRunningTotal->isChecked());
if (_selectedAccount->isChecked() && _showRunningTotal->isChecked())
{
_gltrans->showColumn("running");
qDebug("begbal %f", params.value("beginningBalance").toDouble());
_beginningBalance->setDouble(params.value("beginningBalance").toDouble());
}
else
_gltrans->hideColumn("running");
q = mql.toQuery(params);
_gltrans->populate(q);
if (q.lastError().type() != QSqlError::NoError)
{
systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
return;
}
}
示例8: set
enum SetResponse lotSerialRegistration::set(const ParameterList &pParams)
{
XSqlQuery lotet;
XDialog::set(pParams);
QVariant param;
bool valid;
param = pParams.value("crmacct_id", &valid);
if (valid)
_crmacct->setId(param.toInt());
param = pParams.value("item_id", &valid);
if (valid)
_item->setId(param.toInt());
param = pParams.value("ls_id", &valid);
if (valid)
_lotSerial->setId(param.toInt());
param = pParams.value("lsreg_id", &valid);
if (valid)
_lsregid=param.toInt();
param = pParams.value("mode", &valid);
if (valid)
{
_mode = cNew;
if (param.toString() == "new")
{
_mode = cNew;
lotet.exec ("SELECT fetchlsregnumber() AS number;");
if (lotet.first())
_regNumber->setText(lotet.value("number").toString());
else if(lotet.lastError().type() != QSqlError::NoError)
{
systemError(this, lotet.lastError().databaseText(), __FILE__, __LINE__);
reject();
}
lotet.exec("SELECT NEXTVAL('lsreg_lsreg_id_seq') AS _lsreg_id;");
if (lotet.first())
_lsregid = lotet.value("_lsreg_id").toInt();
else if (lotet.lastError().type() != QSqlError::NoError)
{
systemError(this, lotet.lastError().databaseText(), __FILE__, __LINE__);
reject();
}
_qty->setText("1");
}
else if (param.toString() == "edit")
{
_mode = cEdit;
populate();
_itemGroup->setEnabled(false);
}
else if (param.toString() == "view")
{
_mode = cView;
_regDate->setEnabled(false);
_soldDate->setEnabled(false);
_expireDate->setEnabled(false);
_crmacct->setEnabled(false);
_cntct->setEnabled(false);
_type->setEnabled(false);
_item->setReadOnly(true);
_lotSerial->setEnabled(false);
_newChar->setEnabled(false);
_editChar->setEnabled(false);
_deleteChar->setEnabled(false);
_notes->setEnabled(false);
_buttonBox->clear();
_buttonBox->addButton(QDialogButtonBox::Close);
}
}
param = pParams.value("crmacct_id", &valid);
if (valid)
{
_crmacct->setId(param.toInt());
_crmacct->setEnabled(false);
}
return NoError;
}
示例9: populateDatabaseInfo
int login2::set(ParameterList &pParams, QSplashScreen *pSplash)
{
_splash = pSplash;
QVariant param;
bool valid;
param = pParams.value("username", &valid);
if (valid)
{
_username->setText(param.toString());
_password->setFocus();
_captive = TRUE;
}
else
{
_username->setFocus();
_captive = FALSE;
}
param = pParams.value("password", &valid);
if (valid)
{
_password->setText(param.toString());
_captive = TRUE;
}
param = pParams.value("copyright", &valid);
if (valid)
_copyrightLit->setText(param.toString());
param = pParams.value("version", &valid);
if (valid)
_versionLit->setText(tr("Version ") + param.toString());
param = pParams.value("build", &valid);
if (valid)
_build->setText(param.toString());
param = pParams.value("evaluation", &valid);
if (valid)
_demoOption->setChecked(TRUE);
param = pParams.value("cloud", &valid);
if (valid)
_cloudOption->setChecked(true);
param = pParams.value("company", &valid);
if (valid)
_company->setText(param.toString());
param = pParams.value("name", &valid);
if (valid)
_nameLit->setText(param.toString());
param = pParams.value("databaseURL", &valid);
if (valid)
_databaseURL = param.toString();
populateDatabaseInfo();
param = pParams.value("nonxTupleDB", &valid);
if (valid)
_nonxTupleDB = true;
param = pParams.value("multipleConnections", &valid);
if (valid)
_multipleConnections = true;
param = pParams.value("enhancedAuth", &valid);
if (valid)
_enhancedAuth = param.toBool();
param = pParams.value("requireSSL", &valid);
if (valid)
_requireSSL = param.toBool();
if(pParams.inList("login"))
sLogin();
return 0;
}
示例10: set
enum SetResponse itemPricingScheduleItem::set(const ParameterList &pParams)
{
XSqlQuery itemet;
XSqlQuery prodcatet;
XDialog::set(pParams);
QVariant param;
bool valid;
param = pParams.value("ipshead_id", &valid);
if (valid)
_ipsheadid = param.toInt();
param = pParams.value("curr_id", &valid);
if (valid)
{
_price->setId(param.toInt());
_priceFreight->setId(param.toInt());
}
param = pParams.value("updated", &valid);
if (valid)
{
_price->setEffective(param.toDate());
_priceFreight->setEffective(param.toDate());
}
param = pParams.value("ipsitem_id", &valid);
if (valid)
{
_ipsitemid = param.toInt();
populate();
}
param = pParams.value("ipsfreight_id", &valid);
if (valid)
{
_ipsfreightid = param.toInt();
_freightSelected->setChecked(true);
populate();
}
param = pParams.value("listpricesched", &valid);
if (valid)
{
_listpricesched = true;
_freightSelected->setChecked(false);
_freightSelected->hide();
_qtyBreak->setDouble(1.0);
_qtyBreak->setEnabled(false);
_qtyBreakCat->setDouble(1.0);
_qtyBreakCat->setEnabled(false);
_markupQtyBreakCat->setDouble(1.0);
_markupQtyBreakCat->setEnabled(false);
_dscbyprodcat->setChecked(false);
_dscbyprodcat->setEnabled(false);
_markupbyprodcat->setChecked(false);
_markupbyprodcat->setEnabled(false);
_listPriceLit->setText(tr("Item List Price"));
setWindowTitle(tr("List Pricing Schedule Item"));
}
param = pParams.value("mode", &valid);
if (valid)
{
if (param.toString() == "new")
{
_mode = cNew;
}
else if (param.toString() == "edit")
{
_mode = cEdit;
_item->setReadOnly(true);
_prodcat->setEnabled(false);
_markupProdcat->setEnabled(false);
_typeGroup->setEnabled(false);
_dscitem->setReadOnly(true);
_markupitem->setReadOnly(true);
_discountBy->setEnabled(false);
_markupBy->setEnabled(false);
}
else if (param.toString() == "view")
{
_mode = cView;
_item->setReadOnly(true);
_prodcat->setEnabled(false);
_qtyBreak->setEnabled(false);
_qtyBreakCat->setEnabled(false);
_qtyBreakFreight->setEnabled(false);
_price->setEnabled(false);
_discount->setEnabled(false);
_fixedAmtDiscount->setEnabled(false);
_markup->setEnabled(false);
_fixedAmtMarkup->setEnabled(false);
_priceFreight->setEnabled(false);
_typeGroup->setEnabled(false);
_typeFreightGroup->setEnabled(false);
_siteFreight->setEnabled(false);
_zoneFreightGroup->setEnabled(false);
//.........这里部分代码省略.........
示例11: set
enum SetResponse apOpenItem::set(const ParameterList &pParams)
{
XDialog::set(pParams);
QVariant param;
bool valid;
param = pParams.value("docType", &valid);
if (valid)
{
if (param.toString() == "creditMemo")
{
setWindowTitle(windowTitle() + tr(" - Enter Misc. Credit Memo"));
_docType->setCode("C");
_status->setEnabled(false);
}
else if (param.toString() == "debitMemo")
{
setWindowTitle(windowTitle() + tr(" - Enter Misc. Debit Memo"));
_docType->setCode("D");
}
else if (param.toString() == "voucher")
_docType->setCode("V");
else
return UndefinedError;
// ToDo - better error return types
_docType->setEnabled(false);
}
param = pParams.value("mode", &valid);
XSqlQuery setOpenItem;
if (valid)
{
if (param.toString() == "new")
{
_mode = cNew;
setOpenItem.exec("SELECT fetchAPMemoNumber() AS number;");
if (setOpenItem.first())
{
_docNumber->setText(setOpenItem.value("number").toString());
_seqiss = setOpenItem.value("number").toInt();
}
_paid->clear();
_buttonBox->button(QDialogButtonBox::Save)->setText(tr("Post"));
_printOnPost->setVisible(true);
populateStatus();
}
else if (param.toString() == "edit")
{
_mode = cEdit;
_vend->setReadOnly(true);
_docDate->setEnabled(false);
_dueDate->setEnabled(false);
_docType->setEnabled(false);
_docNumber->setEnabled(false);
_poNumber->setEnabled(false);
_journalNumber->setEnabled(false);
_amount->setEnabled(false);
_terms->setEnabled(false);
_notes->setReadOnly(false);
_usePrepaid->setEnabled(false);
_taxzone->setEnabled(false);
_accntId->setEnabled(false);
}
else if (param.toString() == "view")
{
_mode = cView;
_vend->setReadOnly(true);
_docDate->setEnabled(false);
_dueDate->setEnabled(false);
_docType->setEnabled(false);
_docNumber->setEnabled(false);
_poNumber->setEnabled(false);
_journalNumber->setEnabled(false);
_amount->setEnabled(false);
_terms->setEnabled(false);
_terms->setType(XComboBox::Terms);
_notes->setReadOnly(true);
_usePrepaid->setEnabled(false);
_accntId->setEnabled(false);
_status->setEnabled(false);
_taxzone->setEnabled(false);
_buttonBox->setStandardButtons(QDialogButtonBox::Close);
}
}
param = pParams.value("vend_id", &valid);
if (valid)
_vend->setId(param.toInt());
param = pParams.value("apopen_id", &valid);
if (valid)
{
_apopenid = param.toInt();
populate();
}
//.........这里部分代码省略.........
示例12: set
enum SetResponse taxCodeRate::set( const ParameterList & pParams )
{
XDialog::set(pParams);
QVariant param;
bool valid;
param = pParams.value("taxrate_id", &valid);
if (valid)
_taxrateid = param.toInt();
param = pParams.value("tax_id", &valid);
if (valid)
_taxId = param.toInt();
param = pParams.value("mode", &valid);
if (valid)
{
if (param.toString() == "new")
{
_mode = cNew;
q.prepare(" (SELECT taxrate_id "
" FROM taxrate "
" WHERE taxrate_tax_id = :taxrate_tax_id); ");
q.bindValue(":taxrate_tax_id", _taxId);
q.exec();
if(q.first())
{
XSqlQuery maxdate;
maxdate.prepare(" (SELECT (MAX(taxrate_expires) + 1) AS max_expires"
" FROM taxrate "
" WHERE taxrate_tax_id = :taxrate_tax_id) ");
maxdate.bindValue(":taxrate_tax_id", _taxId);
maxdate.exec();
if(maxdate.first())
{
_dates->setStartDate(maxdate.value("max_expires").toDate());
}
else if (maxdate.lastError().type() != QSqlError::NoError)
{
systemError(this, maxdate.lastError().databaseText(), __FILE__, __LINE__);
return UndefinedError;
}
}
_dates->setFocus();
q.exec("SELECT NEXTVAL('taxrate_taxrate_id_seq') AS taxrate_id");
if (q.first())
_taxrateid = q.value("taxrate_id").toInt();
else if (q.lastError().type() != QSqlError::NoError)
{
systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
return UndefinedError;
}
}
else if (param.toString() == "edit")
{
_mode = cEdit;
sPopulate();
_save->setFocus();
}
else if (param.toString() == "view")
{
_mode = cView;
sPopulate();
_dates->setEnabled(FALSE);
_percent->setEnabled(FALSE);
_flat->setEnabled(FALSE);
_close->setText(tr("&Close"));
_save->hide();
_close->setFocus();
}
}
return NoError;
}