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


C++ ParameterList::append方法代码示例

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


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

示例1: sFillList


//.........这里部分代码省略.........
		 "       itemlocdistQty(location_id, itemlocdist_id) AS qtytagged "
		 "FROM itemlocdist, location, itemsite "
		 "WHERE ( (itemlocdist_itemsite_id=itemsite_id)"
		 " AND (itemsite_loccntrl)"
		 " AND (itemsite_warehous_id=location_warehous_id)"
		 " AND (validLocation(location_id, itemsite_id))"
		 " AND (itemlocdist_id=<? value(\"itemlocdist_id\") ?>) ) "
		 "<? elseif exists(\"cIncludeLotSerial\") ?>"
		 "SELECT itemloc_id AS id, <? value(\"itemlocType\") ?> AS type,"
		 "       COALESCE(formatLocationName(location_id),"
		 "                <? value(\"undefined\") ?>) AS locationname,"
		 "       (location_id IS NOT NULL"
		 "        AND location_id=itemsite_location_id) AS defaultlocation,"
		 "       COALESCE(location_netable, false) AS location_netable,"
		 "       ls_number AS lotserial,"
		 "       CASE WHEN (itemsite_perishable) THEN formatDate(itemloc_expiration)"
		 "            ELSE <? value(\"na\") ?>"
		 "       END AS f_expiration,"
		 "       CASE WHEN (itemsite_perishable) THEN (itemloc_expiration < CURRENT_DATE)"
		 "            ELSE FALSE" 
		 "       END AS expired,"
		 "       qtyLocation(itemloc_location_id, itemloc_ls_id, itemsite_id, itemlocdist_order_type, itemlocdist_order_id) AS qty,"
		 "       ( SELECT COALESCE(SUM(target.itemlocdist_qty), 0)"
		 "         FROM itemlocdist AS target"
		 "         WHERE ( (target.itemlocdist_source_type='I')"
		 "          AND (target.itemlocdist_source_id=itemloc_id)"
		 "          AND (target.itemlocdist_itemlocdist_id=source.itemlocdist_id)) ) AS qtytagged "
		 "FROM itemlocdist AS source, itemsite, itemloc "
                 "  LEFT OUTER JOIN location ON (itemloc_location_id=location_id) "
                 "  LEFT OUTER JOIN ls ON (itemloc_ls_id=ls_id) "
		 "WHERE ( (source.itemlocdist_itemsite_id=itemsite_id)"
		 " AND (itemloc_itemsite_id=itemsite_id)"
		 " AND (source.itemlocdist_id=<? value(\"itemlocdist_id\") ?>) ) "
		 " UNION "
		 "SELECT location_id AS id, <? value(\"locationType\") ?> AS type,"
		 "       formatLocationName(location_id) AS locationname,"
		 "       (location_id=itemsite_location_id) AS defaultlocation,"
		 "       location_netable,"
		 "       TEXT('') AS lotserial,"
		 "       TEXT(<? value(\"na\") ?>) AS f_expiration, FALSE AS expired,"
		 "       qtyLocation(location_id, NULL, itemsite_id, itemlocdist_order_type, itemlocdist_order_id) AS qty,"
		 "       itemlocdistQty(location_id, itemlocdist_id) AS qtytagged "
		 "FROM itemlocdist, location, itemsite "
		 "WHERE ( (itemlocdist_itemsite_id=itemsite_id)"
		 " AND (itemsite_loccntrl)"
		 " AND (itemsite_warehous_id=location_warehous_id)"
		 " AND (validLocation(location_id, itemsite_id))"
                 " AND (itemsite_id=<? value(\"itemsite_id\") ?> ) "
		 " AND (location_id NOT IN (SELECT DISTINCT itemloc_location_id FROM itemloc WHERE (itemloc_itemsite_id=itemsite_id)))"
		 " AND (itemlocdist_id=<? value(\"itemlocdist_id\") ?>) ) "
		 "<? endif ?>"
		 ") AS data "
                 "WHERE ((TRUE) "
		 "<? if exists(\"showOnlyTagged\") ?>"
		 "AND (qtytagged != 0) "
		 "<? endif ?>"
                 "<? if exists(\"showQtyOnly\") ?>"
                 "AND (qty > 0) "
                 "<? endif ?>"
		 ") ORDER BY locationname;");

    ParameterList params;

    if (_mode == cNoIncludeLotSerial)
      params.append("cNoIncludeLotSerial");
    else if (_mode == cIncludeLotSerial)
      params.append("cIncludeLotSerial");

    if (_taggedOnly->isChecked())
      params.append("showOnlyTagged");
      
    if ( (_qtyOnly->isChecked())  ||
        (q.value("qtytodistribute").toDouble() < 0) )
      params.append("showQtyOnly");

    params.append("locationType",   cLocation);
    params.append("itemlocType",    cItemloc);
    params.append("yes",            tr("Yes"));
    params.append("no",             tr("No"));
    params.append("na",             tr("N/A"));
    params.append("undefined",      tr("Undefined"));
    params.append("itemlocdist_id", _itemlocdistid);
    params.append("itemsite_id",    q.value("itemsite_id").toInt());

    MetaSQLQuery mql(sql);
    q = mql.toQuery(params);

    _itemloc->populate(q, true);
    if (q.lastError().type() != QSqlError::None)
    {
      systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
      return;
    }
  }
  else if (q.lastError().type() != QSqlError::None)
  {
    systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }
}
开发者ID:,项目名称:,代码行数:101,代码来源:

示例2: SeriesAdjust

int distributeInventory::SeriesAdjust(int pItemlocSeries, QWidget *pParent, const QString & pPresetLotnum, const QDate & pPresetLotexp, const QDate & pPresetLotwarr)
{
  if (pItemlocSeries != 0)
  {
    XSqlQuery itemloc;
    itemloc.prepare( "SELECT itemlocdist_id, itemlocdist_reqlotserial," 
                     "       itemlocdist_distlotserial, itemlocdist_qty,"
                     "       itemsite_loccntrl, itemsite_controlmethod,"
                     "       itemsite_perishable, itemsite_warrpurc "
                     "FROM itemlocdist, itemsite "
                     "WHERE ( (itemlocdist_itemsite_id=itemsite_id)"
                     " AND (itemlocdist_series=:itemlocdist_series) ) "
                     "ORDER BY itemlocdist_id;" );
    itemloc.bindValue(":itemlocdist_series", pItemlocSeries);
    itemloc.exec();
    while (itemloc.next())
    {
      if (itemloc.value("itemlocdist_reqlotserial").toBool())
      {
        int itemlocSeries = -1;
        XSqlQuery query;
        // Check to see if this is a lot controlled item and if we have
        // a predefined lot#/expdate to use. If so assign that information
        // with itemlocdist_qty and move on. otherwise do the normal dialog
        // to ask the user for that information.
        if(itemloc.value("itemsite_controlmethod").toString() == "L" && !pPresetLotnum.isEmpty())
        {
          query.exec("SELECT nextval('itemloc_series_seq') AS _itemloc_series;");
          if(query.first())
          {
            itemlocSeries = query.value("_itemloc_series").toInt();
            query.prepare( "SELECT createlotserial(itemlocdist_itemsite_id,:lotserial,:itemlocdist_series,'I',itemlocdist_id,:qty,:expiration,:warranty)"
                           "FROM itemlocdist "
                           "WHERE (itemlocdist_id=:itemlocdist_id);"
                           
                           "UPDATE itemlocdist "
                           "SET itemlocdist_source_type='O' "
                           "WHERE (itemlocdist_series=:itemlocdist_series);"
              
                           "DELETE FROM itemlocdist "
                           "WHERE (itemlocdist_id=:itemlocdist_id);" );
            query.bindValue(":lotserial", pPresetLotnum);
            query.bindValue(":qty", itemloc.value("itemlocdist_qty"));
            query.bindValue(":itemlocdist_series", itemlocSeries);
            query.bindValue(":itemlocdist_id", itemloc.value("itemlocdist_id"));
            if(itemloc.value("itemsite_perishable").toBool())
              query.bindValue(":expiration", pPresetLotexp);
            else
              query.bindValue(":expiration", omfgThis->startOfTime());
            if(itemloc.value("itemsite_warrpurc").toBool())
              query.bindValue(":warranty", pPresetLotwarr);
            query.exec();
          }
        }

        if(itemlocSeries == -1)
        {
          ParameterList params;
          params.append("itemlocdist_id", itemloc.value("itemlocdist_id").toInt());

          assignLotSerial newdlg(pParent, "", TRUE);
          newdlg.set(params);
          itemlocSeries = newdlg.exec();
          if (itemlocSeries == -1)
            return XDialog::Rejected;
        }
        
        if (itemloc.value("itemsite_loccntrl").toBool())
        {
          query.prepare( "SELECT itemlocdist_id " 
                         "FROM itemlocdist "
                         "WHERE (itemlocdist_series=:itemlocdist_series) "
                         "ORDER BY itemlocdist_id;" );
          query.bindValue(":itemlocdist_series", itemlocSeries);
          query.exec();
          while (query.next())
          {
            ParameterList params;
            params.append("itemlocdist_id", query.value("itemlocdist_id").toInt());
            distributeInventory newdlg(pParent, "", TRUE);
            newdlg.set(params);
            if (newdlg.exec() == XDialog::Rejected)
              return XDialog::Rejected;
          }
        }
        else
        {
          query.prepare( "UPDATE itemlocdist "
                         "SET itemlocdist_source_type='L', itemlocdist_source_id=-1 "
                         "WHERE (itemlocdist_series=:itemlocdist_series); ");
          query.bindValue(":itemlocdist_series", itemlocSeries);
          query.exec();

          query.prepare( "SELECT distributeItemlocSeries(:itemlocdist_series) AS result;");
          query.bindValue(":itemlocdist_series", itemlocSeries);
          query.exec();
        }
      }
      else
      {
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例3: setParams

void dspShipmentsByDate::setParams(ParameterList & params)
{
  if (_metrics->boolean("MultiWhs"))
    params.append("MultiWhs");
  _dates->appendValue(params);
}
开发者ID:,项目名称:,代码行数:6,代码来源:

示例4: sPost

void postCreditMemos::sPost()
{
  q.exec( "SELECT cmhead_printed, COUNT(*) AS number "
          "FROM cmhead "
          "WHERE ( (NOT cmhead_posted) "
          "  AND   (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:,项目名称:,代码行数:101,代码来源:

示例5: sListPrices

void creditMemoItem::sListPrices()
{
  q.prepare( "SELECT currToCurr(ipshead_curr_id, :curr_id, ipsprice_price, :effective) AS price"
             "       FROM ipsass, ipshead, ipsprice "
             "       WHERE ( (ipsass_ipshead_id=ipshead_id)"
             "        AND (ipsprice_ipshead_id=ipshead_id)"
             "        AND (ipsprice_item_id=:item_id)"
             "        AND (ipsass_cust_id=:cust_id)"
             "        AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) = 0)"
             "        AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1) ) )"

             "       UNION SELECT ipsprice_price AS price"
             "       FROM ipsass, ipshead, ipsprice "
             "       WHERE ( (ipsass_ipshead_id=ipshead_id)"
             "        AND (ipsprice_ipshead_id=ipshead_id)"
             "        AND (ipsprice_item_id=:item_id)"
             "        AND (ipsass_shipto_id=:shipto_id)"
             "        AND (ipsass_shipto_id != -1)"
             "        AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )"
             
             "       UNION SELECT ipsprice_price AS price"
             "       FROM ipsass, ipshead, ipsprice, cust "
             "       WHERE ( (ipsass_ipshead_id=ipshead_id)"
             "        AND (ipsprice_ipshead_id=ipshead_id)"
             "        AND (ipsprice_item_id=:item_id)"
             "        AND (ipsass_custtype_id=cust_custtype_id)"
             "        AND (cust_id=:cust_id)"
             "        AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )"
             
             "       UNION SELECT ipsprice_price AS price"
             "       FROM ipsass, ipshead, ipsprice, custtype, cust "
             "       WHERE ( (ipsass_ipshead_id=ipshead_id)"
             "        AND (ipsprice_ipshead_id=ipshead_id)"
             "        AND (ipsprice_item_id=:item_id)"
             "        AND (coalesce(length(ipsass_custtype_pattern), 0) > 0)"
             "        AND (custtype_code ~ ipsass_custtype_pattern)"
             "        AND (cust_custtype_id=custtype_id)"
             "        AND (cust_id=:cust_id)"
             "        AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)))"
             
             "       UNION SELECT ipsprice_price AS price"
             "       FROM ipsass, ipshead, ipsprice, shipto "
             "       WHERE ( (ipsass_ipshead_id=ipshead_id)"
             "        AND (ipsprice_ipshead_id=ipshead_id)"
             "        AND (ipsprice_item_id=:item_id)"
             "        AND (shipto_id=:shipto_id)"
             "        AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) > 0)"
             "        AND (shipto_num ~ ipsass_shipto_pattern)"
             "        AND (ipsass_cust_id=:cust_id)"
             "        AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )"

             "       UNION SELECT ipsprice_price AS price"
             "       FROM sale, ipshead, ipsprice "
             "       WHERE ((sale_ipshead_id=ipshead_id)"
             "        AND (ipsprice_ipshead_id=ipshead_id)"
             "        AND (ipsprice_item_id=:item_id)"
             "        AND (CURRENT_DATE BETWEEN sale_startdate AND (sale_enddate - 1)) ) "

             "       UNION SELECT (item_listprice - (item_listprice * cust_discntprcnt)) AS price "
             "       FROM item, cust "
             "       WHERE ( (item_sold)"
             "        AND (NOT item_exclusive)"
             "        AND (item_id=:item_id)"
             "        AND (cust_id=:cust_id) );");
  q.bindValue(":item_id", _item->id());
  q.bindValue(":cust_id", _custid);
  q.bindValue(":shipto_id", _shiptoid);
  q.bindValue(":curr_id", _netUnitPrice->id());
  q.bindValue(":effective", _netUnitPrice->effective());
  q.exec();
  if (q.size() == 1)
  {
	q.first();
	_netUnitPrice->setLocalValue(q.value("price").toDouble() * (_priceinvuomratio / _priceRatio));
  }
  else
  {
    ParameterList params;
    params.append("cust_id", _custid);
    params.append("shipto_id", _shiptoid);
    params.append("item_id", _item->id());
    // don't params.append("qty", ...) as we don't know how many were purchased
    params.append("curr_id", _netUnitPrice->id());
    params.append("effective", _netUnitPrice->effective());

    priceList newdlg(this);
    newdlg.set(params);
    if (newdlg.exec() == XDialog::Accepted)
    {
      _netUnitPrice->setLocalValue(newdlg._selectedPrice * (_priceinvuomratio / _priceRatio));
      sCalculateDiscountPrcnt();
    }
  }
}
开发者ID:,项目名称:,代码行数:94,代码来源:

示例6: setParams

bool dspARApplications::setParams(ParameterList & params)
{
  if ( (_selectedCustomer->isChecked()) && (!_cust->isValid()) )
  {
    QMessageBox::warning( this, tr("Select Customer"),
                          tr("You must select a Customer whose A/R Applications you wish to view.") );
    _cust->setFocus();
    return false;
  }

  if (!_dates->startDate().isValid())
  {
    QMessageBox::critical( this, tr("Enter Start Date"),
                           tr("You must enter a valid Start Date.") );
    _dates->setFocus();
    return false;
  }

  if (!_dates->endDate().isValid())
  {
    QMessageBox::critical( this, tr("Enter End Date"),
                           tr("You must enter a valid End Date.") );
    _dates->setFocus();
    return false;
  }

  if ( (!_cashReceipts->isChecked()) && (!_creditMemos->isChecked()) )
  {
    QMessageBox::critical( this, tr("Select Document Type"),
                           tr("You must indicate which Document Type(s) you wish to view.") );
    _cashReceipts->setFocus();
    return false;
  }
  
  if (_cashReceipts->isChecked())
    params.append("includeCashReceipts");

  if (_creditMemos->isChecked())
    params.append("includeCreditMemos");

  _dates->appendValue(params);
  params.append("creditMemo", tr("C/M"));
  params.append("debitMemo", tr("D/M"));
  params.append("cashdeposit", tr("Cash Deposit"));
  params.append("invoice", tr("Invoice"));
  params.append("cash", tr("C/R"));
  params.append("check", tr("Check"));
  params.append("certifiedCheck", tr("Cert. Check"));
  params.append("masterCard", tr("M/C"));
  params.append("visa", tr("Visa"));
  params.append("americanExpress", tr("AmEx"));
  params.append("discoverCard", tr("Discover"));
  params.append("otherCreditCard", tr("Other C/C"));
  params.append("cash", tr("Cash"));
  params.append("wireTransfer", tr("Wire Trans."));
  params.append("other", tr("Other"));
  params.append("apcheck", tr("A/P Check"));

  if (_selectedCustomer->isChecked())
    params.append("cust_id", _cust->id());
  else if (_selectedCustomerType->isChecked())
    params.append("custtype_id", _customerTypes->id());
  else if (_customerTypePattern->isChecked())
    params.append("custtype_pattern", _customerType->text());

  return true; 
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:67,代码来源:dspARApplications.cpp

示例7: sVendor

void employee::sVendor()
{
  XSqlQuery srq;
  if (_empid < 0 && _code->text().isEmpty())
  {
    QMessageBox::warning(this, tr("Specify an Employee Code"),
                         tr("<p>You must either be editing an existing "
                            "Employee or have at least given an Employee Code "
                            "before trying to associate this Employee with a "
                            "Vendor."));
    return;
  }
  else
  {
    srq.prepare("SELECT vend_id "
                "FROM vendinfo "
                "WHERE (upper(vend_number)=upper(:number));");
    srq.bindValue(":number", _number->text());
  }

  srq.exec();
  if (srq.first() &&
      (_privileges->check("MaintainVendors") ||
       _privileges->check("ViewVendors"))
      )
  {
    _vendor->setEnabled(true);
	sSave(false);
    ParameterList params;
    if (_mode == cView || ! _privileges->check("MaintainVendors"))
      params.append("mode", "view");
    else
	params.append("vend_id", srq.value("vend_id"));
    params.append("crmacct_number", _number->text());
    params.append("crmacct_name", _code->text().toLower());
    params.append("mode", "edit");
    vendor *newdlg = new vendor(this);
    newdlg->set(params);
    omfgThis->handleNewWindow(newdlg);
  }
  else if (srq.lastError().type() != QSqlError::NoError)
  {
    systemError(this, srq.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }
  else if (_privileges->check("MaintainVendors") &&
           (_mode == cEdit || _mode == cNew))
  {
    if (QMessageBox::question(this, tr("Create Vendor?"),
                              tr("<p>There does not appear to be a Vendor "
                                 "associated with this Employee. "
								 "Would you like to create a new Vendor?"),
				  QMessageBox::Yes | QMessageBox::Default,
				  QMessageBox::No) == QMessageBox::Yes)
    {
      sSave(false);
      ParameterList params;
      params.append("crmacct_number", _number->text());
      params.append("crmacct_name", _code->text().toLower());
	  params.append("mode",     "new");
      vendor *newdlg = new vendor(this);
      newdlg->set(params);
      omfgThis->handleNewWindow(newdlg);
    }
  }
}
开发者ID:,项目名称:,代码行数:66,代码来源:

示例8: sSalesrep

void employee::sSalesrep()
{
  XSqlQuery srq;
  if (_empid < 0 && _code->text().isEmpty())
  {
    QMessageBox::warning(this, tr("Specify an Employee Code"),
                         tr("<p>You must either be editing an existing "
                            "Employee or have at least given an Employee Code "
                            "before trying to associate this Employee with a "
                            "Sales Rep."));
    return;
  }
  else if (_empid >= 0)
  {
    srq.prepare("SELECT salesrep_id "
                "FROM salesrep "
                "WHERE (salesrep_emp_id=:id);");
    srq.bindValue(":id", _empid);
  }
  else
  {
    srq.prepare("SELECT salesrep_id "
                "FROM salesrep "
                "WHERE (salesrep_number=:number);");
    srq.bindValue(":number", _number->text());
  }

  srq.exec();
  if (srq.first() &&
      (_privileges->check("MaintainSalesReps") ||
       _privileges->check("ViewSalesReps"))
      )
  {
    sSave(false);
    ParameterList params;
    if (_mode == cView || ! _privileges->check("MaintainSalesReps"))
      params.append("mode", "view");
    else
      params.append("mode", "edit");
    params.append("salesrep_id", srq.value("salesrep_id"));
    params.append("emp_id",      _empid);
    salesRep newdlg(this, "", TRUE);
    newdlg.set(params);
    _salesrep->setEnabled(newdlg.exec() == QDialog::Rejected);
  }
  else if (srq.lastError().type() != QSqlError::NoError)
  {
    systemError(this, srq.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }
  else if (_privileges->check("MaintainSalesReps") &&
           (_mode == cEdit || _mode == cNew))
  {
    if (QMessageBox::question(this, tr("Create Sales Rep?"),
                              tr("<p>There does not appear to be a Sales "
                                 "Rep associated with this Employee. "
                                 "Would you like to create a new Sales "
                                 "Rep?"),
				  QMessageBox::Yes | QMessageBox::Default,
				  QMessageBox::No) == QMessageBox::Yes)
    {
      sSave(false);
      ParameterList params;
      params.append("mode",     "new");
      params.append("emp_id",   _empid);
      salesRep newdlg(this, "", TRUE);
      newdlg.set(params);
      _salesrep->setEnabled(newdlg.exec() == QDialog::Rejected);
    }
  }
}
开发者ID:,项目名称:,代码行数:71,代码来源:

示例9: sSave

void employee::sSave(const bool pClose)
{
  if (_code->text().length() == 0)
  {
      QMessageBox::warning( this, tr("Cannot Save Employee"),
                            tr("You must enter a valid Employee Code.") );
      return;
  }
  
  if (_code->text() == _mgr->number())
  {
      QMessageBox::warning( this, tr("Cannot Save Employee"),
                            tr("An Employee cannot be his or her own Manager.") );
      return;
  }
  
  if (_mode == cNew)
  {
    q.prepare("SELECT emp_id"
              "  FROM emp"
              " WHERE(emp_code=:code)");
    q.bindValue(":code", _code->text());
    q.exec();
    if(q.first())
    {
      QMessageBox::critical(this, tr("Duplicate Employee"),
        tr("An Employee already exists for the Code specified.") );
      _code->setFocus();
      return;
    }
    q.prepare("SELECT emp_id"
              "  FROM emp"
              " WHERE(emp_number=:number)");
    q.bindValue(":number", _number->text());
    q.exec();
    if(q.first())
    {
      QMessageBox::critical(this, tr("Duplicate Employee"),
        tr("An Employee already exists for the Number specified.") );
      _number->setFocus();
      return;
    }
  }

  if (_user->isChecked() && pClose)
  {
    q.prepare("SELECT usr_id FROM usr WHERE usr_username=:username;");
    q.bindValue(":username", _code->text().toLower());
    q.exec();
    if (q.first())
    {
      // OK
    }
    else if (q.lastError().type() != QSqlError::NoError)
    {
      systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
      return;
    }
    else if (_createUsers) // not found
    {
      if (QMessageBox::question(this, tr("No Corresponding User"),
                            tr("There is no User named %1. Would you like to "
                               "create one now?<p>If you answer 'No' then you "
                               "should either Cancel creating this Employee, "
                               "uncheck the User check box, or use a different "
                               "Employee Code.")
                            .arg(_code->text()),
                            QMessageBox::Yes | QMessageBox::Default,
                            QMessageBox::No) == QMessageBox::Yes)
      {
        // don't use sUser() because it asks too many questions
		ParameterList params;
        params.append("mode",     "new");
        params.append("username", _code->text().toLower());
        user newdlg(this);
        newdlg.set(params);
        newdlg.exec();
        _user->setChecked(true);
      }
      return;
    }
    else // not found
    {
      systemError(this, tr("There is no User named %1. Either Cancel creating "
                           "this Employee or use a different Employee Code.")
                         .arg(_code->text()));
      return;
    }
  }
  
  if (_salesrep->isChecked() && pClose)
  {
    q.prepare("SELECT salesrep_id FROM salesrep WHERE salesrep_number=:username;");
    q.bindValue(":username", _code->text());
    q.exec();
    if (q.first())
    {
      // OK
    }
    else if (q.lastError().type() != QSqlError::NoError)
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例10: setParams

bool dspSummarizedSales::setParams(ParameterList & params)
{
  if (!_cust->isChecked() &&
      !_custtype->isChecked() &&
      !_salesrep->isChecked() &&
      !_shipzone->isChecked() &&
      !_item->isChecked() &&
      !_site->isChecked())
  {
    QMessageBox::warning( this, tr("Select a Group By"),
                          tr("Please select at least one Group By option.") );
    return false;
  }

  parameterWidget()->appendValue(params);
  params.append("filter", parameterWidget()->filter());

  QList<QVariant> groupLitList;
  QList<QVariant> groupList;
  QList<QVariant> groupDescripList;
  if (_cust->isChecked())
  {
    groupLitList.append(tr("'Customer:'"));
    groupList.append("cust_number");
    groupDescripList.append("cust_name");
    params.append("byCustomer");
  }
  if (_custtype->isChecked())
  {
    groupLitList.append(tr("'Cust. Type:'"));
    groupList.append("custtype_code");
    groupDescripList.append("custtype_descrip");
    params.append("byCustomerType");
  }
  if (_salesrep->isChecked())
  {
    groupLitList.append(tr("'Sales Rep.:'"));
    groupList.append("salesrep_number");
    groupDescripList.append("salesrep_name");
    params.append("bySalesRep");
  }
  if (_shipzone->isChecked())
  {
    groupLitList.append(tr("'Ship Zone:'"));
    groupList.append("COALESCE(shipzone_name,'')");
    groupDescripList.append("COALESCE(shipzone_descrip,'')");
    params.append("byShippingZone");
  }
  if (_item->isChecked())
  {
    groupLitList.append(tr("'Item:'"));
    groupList.append("item_number");
    groupDescripList.append("itemdescription");
    params.append("byItem");
  }
  if (_site->isChecked())
  {
    groupLitList.append(tr("'Site:'"));
    groupList.append("warehous_code");
    groupDescripList.append("warehous_descrip");
    params.append("bySite");
  }
  if (_units->currentIndex())
  {
    params.append("byCurrency");
  }

  params.append("groupLitList", groupLitList);
  params.append("groupList", groupList);
  params.append("groupDescripList", groupDescripList);

  return true;
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:73,代码来源:dspSummarizedSales.cpp

示例11: main


//.........这里部分代码省略.........
        _enhancedAuth = true;
        if(argument.contains("=no", Qt::CaseInsensitive) || argument.contains("=false", Qt::CaseInsensitive))
          _enhancedAuth = false;
      }
      else if (argument.contains("-requireSSL", Qt::CaseInsensitive))
      {
        haveRequireSSL = true;
        _requireSSL = true;
        if(argument.contains("=no", Qt::CaseInsensitive) || argument.contains("=false", Qt::CaseInsensitive))
          _requireSSL = false;
      }
      else if (argument.contains("-cloud", Qt::CaseInsensitive))
      {
        haveCloud = true;
        cloudOption = true;
        if(argument.contains("=no", Qt::CaseInsensitive) || argument.contains("=false", Qt::CaseInsensitive))
          cloudOption = false;
      }
      else if (argument.contains("-company=", Qt::CaseInsensitive))
      {
        company = argument.right(argument.length() - 9);
      }
    }
  }

  _splash = new QSplashScreen();
  _splash->setPixmap(QPixmap(":/images/splashEmpty.png"));

  _evaluation = FALSE;

  if (!loggedIn)
  {
    ParameterList params;
    params.append("copyright", _Copyright);
    params.append("version", _Version);
    params.append("build", QString("%1 %2").arg(__DATE__).arg(__TIME__));

    if (haveUsername)
      params.append("username", username);

    if (havePasswd)
      params.append("password", passwd);

    if (haveDatabaseURL)
      params.append("databaseURL", databaseURL);

    if (haveEnhancedAuth)
      params.append("enhancedAuth", _enhancedAuth);
    
    if (haveRequireSSL)
      params.append("requireSSL", _requireSSL);

    if (_evaluation)
      params.append("evaluation");

    if ( (haveDatabaseURL) && (haveUsername) && (havePasswd) )
      params.append("login");

    if (haveCloud)
      params.append("cloud", cloudOption);

    if (!company.isEmpty())
      params.append("company", company);

    login2 newdlg(0, "", TRUE);
    newdlg.set(params, _splash);
开发者ID:,项目名称:,代码行数:67,代码来源:

示例12: sSubmit

void postCostsByItem::sSubmit()
{
  ParameterList params;

  params.append("action_name", "PostActualCost");
  params.append("item_id", _item->id());

  if (_material->isChecked())
    params.append("Material");

  if (_lowerMaterial->isChecked())
    params.append("LowerMaterial");

  if (_directLabor->isChecked())
    params.append("DirectLabor");

  if (_lowerDirectLabor->isChecked())
    params.append("LowerDirectLabor");

  if (_overhead->isChecked())
    params.append("Overhead");

  if (_lowerOverhead->isChecked())
    params.append("LowerOverhead");

  if (_machOverhead->isChecked())
    params.append("MachineOverhead");

  if (_lowerMachOverhead->isChecked())
    params.append("LowerMachineOverhead");

  if (_user->isChecked())
    params.append("User");

  if (_lowerUser->isChecked())
    params.append("LowerUser");

  if (_rollUp->isChecked())
    params.append("RollUp");

  submitAction newdlg(this, "", TRUE);
  newdlg.set(params);

  if (newdlg.exec() == XDialog::Accepted)
    accept();
}
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:46,代码来源:postCostsByItem.cpp

示例13: populateStateComboBox

void AddressCluster::populateStateComboBox()
{
  if(_x_metrics == 0)
    return;

  QString tmpstate = _state->currentText();
  if (DEBUG)
    qDebug("%s::populateStateComboBox() entered country %d/%s (matching id = %d) with state %s",
           (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName())),
           _country->id(), qPrintable(_country->currentText()),
           _country->id() == _country->id(_country->findText(_country->currentText(),
                                                             Qt::MatchExactly)),
           qPrintable(tmpstate));
  _state->clear();

  XSqlQuery stateq;
  if (_country->id() >= 0 &&
      _country->id() == _country->id(_country->findText(_country->currentText(),
                                                        Qt::MatchExactly)))
  {
    MetaSQLQuery state("SELECT DISTINCT state_id,"
                       "       CASE WHEN state_abbr IS NULL THEN state_name"
                       "            WHEN TRIM(state_abbr) = '' THEN state_name"
                       "            ELSE state_abbr END,"
                       "       CASE WHEN state_abbr IS NULL THEN state_name"
                       "            WHEN TRIM(state_abbr) = '' THEN state_name"
                       "            ELSE state_abbr END"
                       "  FROM state"
                       " WHERE (state_country_id=<? value(\"country_id\") ?>) "
                       "ORDER BY 2;");
    ParameterList params;
    params.append("country_id", _country->id());

    stateq = state.toQuery(params);
    _state->populate(stateq);

    _state->setEditable(_state->count() <= 1 ||
                        (! tmpstate.isEmpty() &&
                         ! _state->findText(tmpstate, Qt::MatchExactly) >= 0));
    if (_state->count() <= 1)
    {
      if (DEBUG)
        qDebug("%s::populateStateComboBox() find states for stateless country",
           (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName())));
      stateq.prepare("SELECT MIN(addr_id), addr_state, addr_state"
                     "  FROM addr"
                     " WHERE (addr_country=:country)"
                     " GROUP BY addr_state"
                     " ORDER BY addr_state;");
      stateq.bindValue(":country", _country->currentText());
      stateq.exec();
      _state->populate(stateq);
    }
  }
  else
  {
    stateq.exec("SELECT MIN(addr_id), addr_state, addr_state"
                "  FROM addr"
                " GROUP BY addr_state"
                " ORDER BY addr_state;");
    _state->populate(stateq);
    _state->setEditable(true);
  }

  if (_state->isEditable())
    _state->setEditText(tmpstate);
  else
    _state->setText(tmpstate);

  if (DEBUG)
    qDebug("%s::populateStateComboBox() returning id %d, text %s, tmpstate %s",
           (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName())),
         _state->id(), qPrintable(_state->currentText()), qPrintable(tmpstate));
}
开发者ID:,项目名称:,代码行数:74,代码来源:

示例14: doCredit

int AuthorizeDotNetProcessor::doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams)
{
  Q_UNUSED(pcvv);
  if (DEBUG)
    qDebug("AN:doCredit(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)",
	   pccardid, pamount, ptax, ptaxexempt,  pfreight,  pduty, pcurrid,
	   pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid);

  int     returnValue = 0;
  double  amount  = pamount;
  int     currid  = pcurrid;
  bool    tryVoid = false;
  QString approvalCode;
  QString request;

  returnValue = buildFollowup(pccpayid, preforder, amount, currid, request, "CREDIT");
  if (returnValue != 0)
    return returnValue;

  XSqlQuery anq;
  anq.prepare("SELECT ccpay_card_pan_trunc,"
              "  (ccpay_transaction_datetime > CURRENT_DATE"
              "  AND ccpay_amount = :amount) AS tryVoid,"
              "  ccpay_r_code,"
              "  formatbytea(decrypt(setbytea(ccard_number),"
              "              setbytea(:key),'bf')) AS ccard_number"
              "  FROM ccpay LEFT OUTER JOIN ccard ON (ccpay_ccard_id=ccard_id)"
              " WHERE (ccpay_id=:ccpayid);");
  anq.bindValue(":ccpayid", pccpayid);
  anq.bindValue(":key",     omfgThis->_key);
  anq.bindValue(":now",     QDateTime::currentDateTime());
  anq.bindValue(":amount",  amount);
  anq.exec();
  if (anq.first())
  {
    QString cardnum = anq.value("ccpay_card_pan_trunc").toString();
    if (cardnum.isEmpty())
      cardnum = anq.value("ccard_number").toString();
    APPENDFIELD(request, "x_card_num", cardnum.right(4));
    tryVoid = anq.value("tryVoid").toBool();
    approvalCode = anq.value("ccpay_r_code").toString();
  }
  else if (anq.lastError().type() != QSqlError::NoError)
  {
    _errorMsg = anq.lastError().databaseText();
    return -1;
  }

  QString response;
  returnValue = sendViaHTTP(request, response);
  if (returnValue < 0)
    return returnValue;

  returnValue = handleResponse(response, pccardid, "R", amount, currid,
			       pneworder, preforder, pccpayid, pparams);

  // TODO: make more precise - look for return code 54
  if (returnValue < 0 && tryVoid) {
    int voidResult = 0;
    QString tmpErrorMsg = _errorMsg;
    ParameterList voidParams;
    _errorMsg.clear();
    voidResult = doVoidPrevious(pccardid,   pcvv,      amount,       currid,
                                pneworder,  preforder, approvalCode, pccpayid,
                                voidParams);
    if (voidResult >= 0) {
      returnValue = voidResult;
      pparams.clear();
      while (! voidParams.isEmpty())
        pparams.append(voidParams.takeFirst());
    }
    else
      _errorMsg = tmpErrorMsg;
  }

  return returnValue;
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:77,代码来源:authorizedotnetprocessor.cpp

示例15: sOpenDoc

void Documents::sOpenDoc(QString mode)
{
  QString ui;
  QString docType = _doc->currentItem()->rawValue("target_type").toString();
  int targetid = _doc->currentItem()->id("target_number");
  ParameterList params;
  if (docType == "Q" && mode == "view")
    params.append("mode", "viewQuote");
  else if (docType == "Q" && mode == "edit")
    params.append("mode", "editQuote");
  else
    params.append("mode", mode);

  // TODO: image -- change to use docass instead of imageass
  if (docType == "IMG")
  {
    XSqlQuery img;
    img.prepare("SELECT imageass_image_id "
                "FROM imageass "
                "WHERE (imageass_id=:imageass_id); ");
    img.bindValue(":imageass_id", _doc->id());
    img.exec();
    img.first();
    if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Image Info"),
                             img, __FILE__, __LINE__))
      return;

    params.append("image_id", img.value("imageass_image_id").toInt());
    imageview newdlg(this, "", TRUE);
    newdlg.set(params);

    if (newdlg.exec() != QDialog::Rejected)
      refresh();
    return;
  }
  // TODO: url -- change to use docass instead of url
  // TODO: separate URL from FILE handling and replace use of url view
  else if (docType == "URL" || docType == "FILE")
  {
    if (mode == "edit")
    {
      ParameterList params;
      params.append("url_id", targetid);

      docAttach newdlg(this, "", TRUE);
      newdlg.set(params);
      newdlg.exec();

      refresh();
      return;
    }

    XSqlQuery qfile;
    qfile.prepare("SELECT url_id, url_source_id, url_source, url_title, url_url, url_stream"
                  " FROM url"
                  " WHERE (url_id=:url_id);");

    qfile.bindValue(":url_id", _doc->id());
    qfile.exec();

    // If file is in the database, copy to a temp. directory in the file system and open it.
    if (qfile.first() && (docType == "FILE"))
    {
      QFileInfo fi( qfile.value("url_url").toString() );
      QDir tdir;
      // TODO: QDesktopServices::openUrl(urldb) on windows does not open files
      // containing spaces. why not?
#ifdef Q_WS_WIN
      QString fileName = fi.fileName().remove(" ");
#else
      QString fileName = fi.fileName();
#endif
      QString filePath = tdir.tempPath() + "/xtTempDoc/" +
	                 qfile.value("url_id").toString() + "/";
      QFile tfile(filePath + fileName);

      // Remove any previous watches
      if (_guiClientInterface)
        _guiClientInterface->removeDocumentWatch(tfile.fileName());

      if (! tdir.exists(filePath))
        tdir.mkpath(filePath);

      if (!tfile.open(QIODevice::WriteOnly))
      {
        QMessageBox::warning( this, tr("File Open Error"),
                             tr("Could Not Create File %1.").arg(tfile.fileName()) );
        return;
      }
      tfile.write(qfile.value("url_stream").toByteArray());
      QUrl urldb;
      urldb.setUrl(tfile.fileName());
#ifndef Q_WS_WIN
      urldb.setScheme("file");
#endif
      tfile.close();
      if (! QDesktopServices::openUrl(urldb))
      {
        QMessageBox::warning(this, tr("File Open Error"),
			     tr("Could not open %1.").arg(urldb.toString()));
//.........这里部分代码省略.........
开发者ID:NemoDevel,项目名称:qt-client,代码行数:101,代码来源:documents.cpp


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