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


C++ ADB::getrow方法代码示例

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


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

示例1: setLoginID

void LogCall::setLoginID(const char * newLoginID)
{
    QApplication::setOverrideCursor(waitCursor);
    if (strlen(newLoginID) < 32) {
        strcpy(myLoginID, newLoginID);
        loginID->setText(myLoginID);
        
        if (strlen(myLoginID)) {
            // Now, get the customer ID for this login ID
            char        *query = new char[32768];
            ADB         DB;
        
            DB.query("select CustomerID from Logins where LoginID = '%s'", myLoginID);
            if (DB.rowCount == 1) {
                DB.getrow();
                myCustID = atol(DB.curRow["CustomerID"]);
                // Load the customer's name so we can verify who we're talking
                // to.
                CustomersDB CDB;
                CDB.get(myCustID);
                strcpy(custName, (const char *) CDB.getStr("FullName"));
                sprintf(query, "Customer ID %ld selected (%s)", myCustID, custName);
                statusLabel->setText(query);
            } else {
                myCustID = 0;
                statusLabel->setText("No customer selected");
            }
        } else {
            myCustID = 0;
            statusLabel->setText("No customer selected");
        }
    }
    QApplication::restoreOverrideCursor();
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:34,代码来源:LogCall.cpp

示例2: fillDepositList

void MakeDeposits::fillDepositList()
{
    QApplication::setOverrideCursor(waitCursor);
    ADB     DB;
    char    tmpStr[1024];
    float   totalFunds = 0.00;
    
    strcpy(tmpStr, cfgVal("UndepositedFundsAccount"));
    
    emit(setStatus("Creating undeposited funds list..."));
    DB.query("select GL.InternalID, GL.TransDate, GL.Amount, AcctsRecv.RefNo, AcctsRecv.CustomerID, Customers.FullName from GL, AcctsRecv, Customers where GL.IntAccountNo = %d and GL.TransType = 2 and AcctsRecv.InternalID = GL.TransTypeLink and AcctsRecv.RefNo > 0 and Customers.CustomerID = AcctsRecv.CustomerID and GL.Cleared = 0", atoi(cfgVal("UndepositedFundsAcct")));
    //DB.query("select * from GL where AccountNo = %d and LinkedTrans = 0", atoi(tmpStr));
    
    if (DB.rowCount) while (DB.getrow()) {
        (void) new Q3ListViewItem(paymentList, 
          DB.curRow["TransDate"],
          DB.curRow["CustomerID"], 
          DB.curRow["FullName"],
          DB.curRow["RefNo"],
          DB.curRow["Amount"],
          DB.curRow["InternalID"]
        );
        totalFunds += atof(DB.curRow["Amount"]);
    }

    sprintf(tmpStr, "$%.2f", totalFunds);
    undepositedAmount->setText(tmpStr);
    
    emit(setStatus(""));
    QApplication::restoreOverrideCursor();
    
    
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:33,代码来源:MakeDeposits.cpp

示例3: refreshReport

void UnreleasedDomainsReport::refreshReport()
{
    repBody->clear();
    ADB     DB;
    DB.query("select Domains.CustomerID, Domains.LoginID, DomainTypes.DomainType, Domains.DomainName from Domains, DomainTypes where Domains.Active <> 0 and Domains.Released = '' and DomainTypes.InternalID = Domains.DomainType");
    if (DB.rowCount) while (DB.getrow()) {
        (void) new Q3ListViewItem(repBody, DB.curRow["CustomerID"], DB.curRow["LoginID"], DB.curRow["DomainType"], DB.curRow["DomainName"]);
    }
    
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:10,代码来源:UnreleasedDomainsReport.cpp

示例4: refreshList

void UserPrivs::refreshList()
{
    ADB             DB;
    char            levelStr[1024];
    AccessLevels    level;
    Q3ListViewItem   *curItem;
    bool            foundSel = false;

    userList->clear();
    DB.query("select * from Staff");
    if (DB.rowCount) {
        while(DB.getrow()) {
            level = (AccessLevels) atoi(DB.curRow["AccessLevel"]);
            switch(level) {
                case Admin:
                    strcpy(levelStr, "Administrator");
                    break;

                case Manager:
                    strcpy(levelStr, "Manager");
                    break;

                case Staff:
                    strcpy(levelStr, "Support Staff");
                    break;

                default:
                    strcpy(levelStr, "Unknown");
                    break;
            }

            curItem = new Q3ListViewItem(userList, DB.curRow["LoginID"], levelStr, DB.curRow["InternalID"]);

            // Is this the user we previously had hilighted?  If so,
            // hilight it now.
            if (myCurrentID == atol(DB.curRow["InternalID"])) {
                foundSel = true;
                userList->setCurrentItem(curItem);
                userList->setSelected(curItem, true);
                userList->ensureItemVisible(curItem);
            }
        }
    }

    // If we didn't find our previously hilighted entry, hilight the
    // first entry in the list.
    if (!foundSel) {
        // None selected, hilight the first one in the list.
        if (userList->firstChild()) {
            userList->setCurrentItem(userList->firstChild());
            userList->setSelected(userList->firstChild(), true);
            userList->ensureItemVisible(userList->firstChild());
        }
    }
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:55,代码来源:UserPrivs.cpp

示例5: setGLAccount

/**
 * setGLAccount()
 *
 * Overrides the GL Account that we post to - not the AcctsRecv side
 * but the billable side of the transaction.
 *
 * Returns 1 if successful, 0 if not.
 */
int AcctsRecv::setGLAccount(const char *acctNo)
{
    int     retVal = 0;
    ADB     DB;
    DB.query("select IntAccountNo from Accounts where AccountNo = '%s'", acctNo);
    if (DB.rowCount) { 
        DB.getrow();
        myIntAcctNo = atoi(DB.curRow["IntAccountNo"]);
        retVal = 1;
    }
    return retVal;
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:20,代码来源:AcctsRecv.cpp

示例6: fillTable

/**
 * CustomLoginFlagEditor::fillTable()
 *
 * Fills the table with the flags and values for the user.
 */
void CustomLoginFlagEditor::fillTable()
{
    ADB     db;
    long    loginType;
    Q3Dict<QString> flagDict;

    // Get the login type.
    db.query("select LoginType from Logins where LoginID = '%s'", myLoginID);
    if (!db.rowCount) return;
    db.getrow();
    loginType = atoi(db.curRow["LoginType"]);

    // Get the available login flags for this login type
    db.query("select Tag, Value from LoginTypeFlags where LoginTypeID = %ld", loginType);
    if (!db.rowCount) return;

    // Load the dictionary
    while(db.getrow()) {
        flagDict.insert(db.curRow["Tag"], new QString(db.curRow["Value"]));
    }

    // Get whatever data is in the LoginFlagValues that is custom for this user.
    db.query("select * from LoginFlagValues where LoginID = '%s'", myLoginID);
    if (db.rowCount) while (db.getrow()) {
        flagDict.replace(db.curRow["LoginFlag"], new QString(db.curRow["FlagValue"]));
    }

    // Now put the stuff from our flagDict into the grid
    Q3DictIterator<QString> it(flagDict);
    for( ; it.current(); ++it ) {
        flagTable->insertRows(flagTable->numRows(), 1);
        flagTable->setText(flagTable->numRows()-1, 0, it.currentKey());
        flagTable->setText(flagTable->numRows()-1, 1, it.current()->ascii());
    }

    // Set column 0(1) to be read only
    flagTable->setColumnReadOnly(0, true);
    flagTable->adjustColumn(1);

}
开发者ID:gottafixthat,项目名称:tacc,代码行数:45,代码来源:Tab_Logins.cpp

示例7: loadCities

void TE_Cities::loadCities()
{
    QApplication::setOverrideCursor(Qt::waitCursor);
    
    ADB     DB;
    
    DB.query("select distinct City, State from Addresses where RefFrom = %d", REF_CUSTOMER);
    if (DB.rowCount) while (DB.getrow()) {
        (void) new Q3ListViewItem(cityList, DB.curRow["City"], DB.curRow["State"]);
    }
    
    QApplication::restoreOverrideCursor();
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:13,代码来源:TE_Cities.cpp

示例8: refreshList

void BillingCycles::refreshList(int)
{
    ADB             DB;
    Q3ListViewItem   *curItem = NULL;
    
    // Save the state of the list.
    list->clear();

    DB.query("select CycleID, CycleType, Description from BillingCycles order by CycleID");
    if (DB.rowCount) while(DB.getrow()) {
        curItem = new Q3ListViewItem(list, DB.curRow["CycleID"], DB.curRow["CycleType"], DB.curRow["Description"]);
    }
    list->repaint();
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:14,代码来源:BillingCycles.cpp

示例9: refreshReport

void LoginTypeReport::refreshReport()
{
    emit(setStatus("Generating report..."));
    QApplication::setOverrideCursor(waitCursor);

    ADB         DB;
    char        modDate[128];
    char        isActive[128];
    char        isPrimary[128];
    QDateTime   tmpQDT;
    bool        showIt = false;

    repBody->clear();

    DB.query("select Logins.LoginID, Customers.FullName, Logins.LastModified, Logins.Active, Logins.CustomerID, Customers.PrimaryLogin from Logins, Customers where Logins.LoginType = %d and Customers.CustomerID = Logins.CustomerID", loginType);

    if (DB.rowCount) while (DB.getrow()) {
        if (!strcmp(DB.curRow["LoginID"], DB.curRow["PrimaryLogin"])) strcpy(isPrimary, "Yes");
        else strcpy(isPrimary, "No");
        if (atoi(DB.curRow["Active"])) strcpy(isActive, "Yes");
        else strcpy(isActive, "No");

        tmpQDT = DB.curRow.col("LastModified")->toQDateTime();
        sprintf(modDate, "%04d-%02d-%02d", tmpQDT.date().year(), tmpQDT.date().month(), tmpQDT.date().day());

        showIt = false;
        if ((atoi(DB.curRow["Active"])) && showActive) showIt = true;
        if ((!atoi(DB.curRow["Active"])) && showInactive) showIt = true;

        if (showIt) {
            (void) new Q3ListViewItem(repBody,
                                     DB.curRow["LoginID"],
                                     DB.curRow["FullName"],
                                     modDate,
                                     isActive,
                                     isPrimary,
                                     DB.curRow["CustomerID"]
                                    );
        };
    }

    emit(setStatus(""));
    QApplication::restoreOverrideCursor();
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:44,代码来源:LoginTypeReport.cpp

示例10: refreshReport

void RatePlanReport::refreshReport()
{
    QApplication::setOverrideCursor(waitCursor);

    repBody->clear();
    
    char    tmpActiveStr[1024];
    char    tmpInactiveStr[1024];
    
    char    *query = new char[65536];
    ADB     DB;
    ADB     DB2;
    

    // Get a list of the rate plans.  Then we'll count the customers that
    // are assigned that rate plan.
    DB.query("select InternalID, PlanTag, Description from RatePlans");
    if (DB.rowCount) {
        while (DB.getrow()) {
            // Now, get the number of active customers associated with this
            // rate plan.
            DB2.query("select CustomerID from Customers where RatePlan = %s and Active <> 0", DB.curRow["InternalID"]);
            sprintf(tmpActiveStr, "%6ld", DB2.rowCount);
            
            // Now, get the number of INactive customers associated with this
            // rate plan.
            DB2.query("select CustomerID from Customers where RatePlan = %s and Active = 0", DB.curRow["InternalID"]);
            sprintf(tmpInactiveStr, "%6ld", DB2.rowCount);

            // Now, add the entry into the list, including the last column,
            // which is not shown, containing the internal ID so we can
            // zoom in on it.
            (void) new Q3ListViewItem(repBody, DB.curRow["PlanTag"], DB.curRow["Description"], tmpActiveStr, tmpInactiveStr, DB.curRow["InternalID"]);
        } 
    } else {
        (void) new Q3ListViewItem(repBody, "No rate plans found!!!");
    }
    
    
    delete query;
    
    QApplication::restoreOverrideCursor();
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:43,代码来源:RatePlanReport.cpp

示例11: saveBillingCycleChange

void ChangeBillingCycle::saveBillingCycleChange()
{
    CustomersDB CDB;
    ADB         DB;
    
    QApplication::setOverrideCursor(waitCursor);
    CDB.get(myCustID);

    DB.query("select InternalID from BillingCycles where CycleID = '%s'", (const char *) cycleList->text(cycleList->currentItem()));
    DB.getrow();

    CDB.setValue("BillingCycleDate", effectiveDate->date().toString("yyyy-MM-dd").ascii());
    CDB.setValue("BillingCycle", atol(DB.curRow["InternalID"]));
    CDB.upd();
    QApplication::restoreOverrideCursor();
    emit(customerUpdated(myCustID));
    
    QMessageBox::information(this, "Rerate warning", "Note that billing cycle changes are not\nrerated automatically.  You will need to\nmake any necessary adjustments to the\ncustomers register manually.");
    
    close();
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:21,代码来源:ChangeBillingCycle.cpp

示例12: refreshReport

void DNS_UnmanagedReport::refreshReport()
{
    repBody->clear();
    ADB     DB;
    ADB     DB2;
    ADB     dnsDB(cfgVal("DNSSQLDB"), cfgVal("DNSSQLUser"), cfgVal("DNSSQLPass"), cfgVal("DNSSQLHost"));
    char    domainName[1024];
    char    origin[1024];
    char    domainType[1024];
    char    isActive[1024];
    long    counter = 0;

    DB.query("select * from Domains where Active <> 0");
    if (DB.rowCount) while (DB.getrow()) {
        emit(setProgress(++counter, DB.rowCount));
        strcpy(domainType, "Unknown");
        strcpy(isActive, "");
        // Copy the domain name into a temp string and create the origin
        // for our remote query.
        strcpy(domainName, DB.curRow["DomainName"]);
        strcpy(origin, domainName);
        strcat(origin, ".");
        dnsDB.query("select soa.id, ZoneInfo.CustomerID from soa, ZoneInfo where soa.id = ZoneInfo.zoneid and soa.origin = '%s' and ZoneInfo.CustomerID = %ld", origin, atol(DB.curRow["CustomerID"]));
        if (!dnsDB.rowCount) {
            // Get the type of domain it is
            DB2.query("select DomainTypes.DomainType, Domains.InternalID from DomainTypes, Domains where Domains.DomainName = '%s' and DomainTypes.InternalID = Domains.DomainType", domainName);
            if (DB2.rowCount) {
                DB2.getrow();
                strcpy(domainType, DB2.curRow["DomainType"]);
            }
            // Check to see if it is active
            if (atoi(DB.curRow["Active"])) strcpy(isActive, "Yes");
            else strcpy(isActive, "No");

            (void) new Q3ListViewItem(repBody, domainName, DB.curRow["LoginID"], domainType, DB.curRow["CustomerID"], isActive);
        }
    }
    
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:39,代码来源:DNS_UnmanagedReport.cpp

示例13: QLabel

ChangeBillingCycle::ChangeBillingCycle(QWidget* parent, const char* name, long CustID) :
	TAAWidget(parent)
{
	setCaption( "Edit Customer Billing Cycle" );

	if (!CustID) return;
	myCustID    = CustID;

    // Create the widgets
    QLabel *customerLabel = new QLabel("Customer:", this, "customerLabel");
    customerLabel->setAlignment(AlignRight|AlignVCenter);

    customer = new QLabel(this, "customer");
    customer->setAlignment(AlignLeft|AlignVCenter);

    QLabel *cycleListLabel = new QLabel("New Billing Cycle:", this, "cycleListLabel");
    cycleListLabel->setAlignment(AlignRight|AlignVCenter);

    cycleList = new QComboBox(false, this, "cycleList");

    QLabel *effectiveDateLabel = new QLabel("Effective Date:", this, "effectiveDateLabel");
    effectiveDateLabel->setAlignment(AlignRight|AlignVCenter);

    effectiveDate = new Q3DateEdit(QDate::currentDate(), this, "effectiveDate");

    QPushButton *saveButton = new QPushButton("&Save", this, "saveButton");
    connect(saveButton, SIGNAL(clicked()), this, SLOT(saveBillingCycleChange()));

    QPushButton *cancelButton = new QPushButton("&Save", this, "cancelButton");
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelBillingCycleChange()));

    // Our layout.
    Q3BoxLayout  *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3);

    Q3GridLayout *gl = new Q3GridLayout(2, 3);
    int curRow = 0;
    gl->addWidget(customerLabel,        curRow, 0);
    gl->addWidget(customer,             curRow, 1);
    gl->setRowStretch(curRow, 0);

    curRow++;
    gl->addWidget(cycleListLabel,       curRow, 0);
    gl->addWidget(cycleList,            curRow, 1);
    gl->setRowStretch(curRow, 0);

    curRow++;
    gl->addWidget(effectiveDateLabel,   curRow, 0);
    gl->addWidget(effectiveDate,        curRow, 1);
    gl->setRowStretch(curRow, 0);

    gl->setColStretch(0, 0);
    gl->setColStretch(1, 1);

    ml->addLayout(gl, 0);
    ml->addStretch(1);

    Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
    bl->addStretch(1);
    bl->addWidget(saveButton, 0);
    bl->addWidget(cancelButton, 0);

    ml->addLayout(bl, 0);

	
	// Load the list of rate plans.
	ADB         DB;
	CustomersDB CDB;
	char        tmpStr[1024];
	
	CDB.get(CustID);
	
	sprintf(tmpStr, "%s (%ld)", (const char *) CDB.getStr("FullName"), myCustID);
	customer->setText(tmpStr);
	
	DB.query("select CycleID,InternalID from BillingCycles order by CycleID");
	while (DB.getrow()) {
	    cycleList->insertItem(DB.curRow["CycleID"]);
	    if (atol(DB.curRow["InternalID"]) == CDB.getLong("BillingCycle")) {
	        cycleList->setCurrentItem(cycleList->count()-1);
	    }
	}
	

}
开发者ID:gottafixthat,项目名称:tacc,代码行数:84,代码来源:ChangeBillingCycle.cpp

示例14: tmplist

void    parseFile(const char *SrcFile, const char *DstFile, long CustomerID, const char *LoginID, const char *DomainName)
{
    FParser  parser;
	FILE     *dfp;
	char 	 tmpstr[1024];
    QString  tmpDst;
	Q3StrList tmplist(TRUE);
	QString	 qst;
	QString	 tmpqstr2;
	char     contactName[256];
	char     phoneNumber[32];
	
	char     theDate[64];
	QDate    theQDate;
	
	theQDate    = QDate::currentDate();
	strcpy(theDate, theQDate.toString());
	
	
	ADB             DB;
	CustomersDB     CDB;
	LoginsDB        LDB;
	AddressesDB     addrDB;
	ADBTable        LTDB;
	
	CDB.get(CustomerID);
	LDB.get(CustomerID, LoginID);
	LTDB.setTableName("LoginTypes");
	LTDB.get(LDB.getLong("LoginType"));
	strcpy(tmpstr, CDB.getStr("BillingAddress"));
	addrDB.get(REF_CUSTOMER, CustomerID, tmpstr);
	
	// Since there is no default phone number, grab the first one from
	// the database.
	strcpy(phoneNumber, "");
	DB.query("select PhoneNumber from CustomerContacts where Active <> 0 and CustomerID = %ld", CustomerID);
	if (DB.rowCount) {
	    DB.getrow();
	    strcpy(phoneNumber, DB.curRow["PhoneNumber"]);
	}
	
	// fprintf(stderr, "parseFile: Reading File '%s'\n", SrcFile);
	
	// If strlen(DstFile) == 0, then generate a temp file name for it.
	if (!strlen(DstFile)) {
	    tmpDst = makeTmpFileName("/tmp/parsefileXXXXXX");
	} else { 
        tmpDst = DstFile;
    }

	
	// Check to see if we have a contact name.
	if (strlen((const char *)CDB.getStr("ContactName"))) {
	    strcpy(contactName, CDB.getStr("ContactName"));
	} else {
	    strcpy(contactName, CDB.getStr("FullName"));
	}
	
    parser.set("DomainName",     DomainName);
    parser.set("CompanyName",    CDB.getStr("FullName"));
    parser.set("ContactName",    contactName);
    parser.set("LoginID",        LoginID);
    parser.set("NICName",        contactName);
    parser.set("Addr1",          addrDB.Address1);
    parser.set("Addr2",          addrDB.Address2);
    parser.set("City",           addrDB.City);
    parser.set("State",          addrDB.State);
    parser.set("ZIP",            addrDB.ZIP);
    parser.set("DayPhone",       phoneNumber);
    parser.set("EvePhone",       phoneNumber);
    parser.set("CurrentDate",    theDate);
    parser.set("LoginType",      LTDB.getStr("LoginType"));
    parser.set("LoginTypeD",     LTDB.getStr("Description"));

    // Read in the entire source file.
	dfp = fopen(tmpDst.toAscii().constData(), "w");
    parser.parseFile(SrcFile, dfp);
    fclose(dfp);
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:79,代码来源:ParseFile.cpp

示例15: refreshReport

void salesByServiceReport::refreshReport()
{
    ADB     DB;
    ADB     DB2;
    QDate   sDate = this->startDateCal->date();
    QDate   eDate = this->endDateCal->date();
    char    tmpStr[1024];
    float   grandTotal = 0.0;

    QApplication::setOverrideCursor(waitCursor);
    repBody->clear();

    // Two queries, one for standalone billables, one for packages.
    DB.query("select AcctsRecv.ItemID, Billables.ItemID, sum(AcctsRecv.Amount) from AcctsRecv, Billables where Billables.ItemNumber = AcctsRecv.ItemID and AcctsRecv.TransType = 0 and AcctsRecv.ItemID > 0 and AcctsRecv.TransDate  >= '%04d-%02d-%02d' and AcctsRecv.TransDate <= '%04d-%02d-%02d' group by AcctsRecv.ItemID order by Billables.ItemID", sDate.year(), sDate.month(), sDate.day(), eDate.year(), eDate.month(), eDate.day());
    if (DB.rowCount) while (DB.getrow()) {
        //DB2.query("select * from Domains where DomainType = %d and Active > 0", atol(DB.curRow["InternalID"]));
        //sprintf(tmpStr, "%5d", DB2.rowCount);
        if (atof(DB.curRow[2]) > 0.0) {
            new Q3ListViewItem(repBody, 
                    DB.curRow[1], 
                    DB.curRow[2],
                    DB.curRow[0],    // The Item ID
                    "0"              // isPackage
                    );
            grandTotal += atof(DB.curRow[2]);
        }
    }
    
    // The seocnd query for packages.
    DB.query("select AcctsRecv.PackageItem, Packages.PackageTag, sum(AcctsRecv.Amount) from AcctsRecv, Packages where Packages.InternalID = AcctsRecv.PackageItem and AcctsRecv.TransType = 0 and AcctsRecv.ItemID = 0 and AcctsRecv.TransDate  >= '%04d-%02d-%02d' and AcctsRecv.TransDate <= '%04d-%02d-%02d' group by Packages.InternalID order by Packages.PackageTag", sDate.year(), sDate.month(), sDate.day(), eDate.year(), eDate.month(), eDate.day());
    if (DB.rowCount) while (DB.getrow()) {
        //DB2.query("select * from Domains where DomainType = %d and Active > 0", atol(DB.curRow["InternalID"]));
        //sprintf(tmpStr, "%5d", DB2.rowCount);
        sprintf(tmpStr, "%s - Package", DB.curRow[1]);
        if (atof(DB.curRow[2]) > 0.0) {
            new Q3ListViewItem(repBody, 
                    tmpStr,
                    DB.curRow[2],
                    DB.curRow["PackageItem"],   // The Package ID
                    "1"                         // isPackage
                    );
            grandTotal += atof(DB.curRow[2]);
        }
    }
    // One last query to get the stuff in the database prior to 5/1/06
    DB.query("select sum(AcctsRecv.Amount) from AcctsRecv where AcctsRecv.TransType = 0 and AcctsRecv.ItemID = 0 and AcctsRecv.PackageItem = 0 and AcctsRecv.TransDate  >= '%04d-%02d-%02d' and AcctsRecv.TransDate <= '%04d-%02d-%02d'", sDate.year(), sDate.month(), sDate.day(), eDate.year(), eDate.month(), eDate.day());
    if (DB.rowCount) while (DB.getrow()) {
        //DB2.query("select * from Domains where DomainType = %d and Active > 0", atol(DB.curRow["InternalID"]));
        //sprintf(tmpStr, "%5d", DB2.rowCount);
        //sprintf(tmpStr, "%s - Package", DB.curRow[1]);
        if (atof(DB.curRow[0]) > 0.0) {
            Q3ListViewItem *curItem = new Q3ListViewItem(repBody, 
                    "[Unknown Items]",
                    DB.curRow[0]
                    );
            grandTotal += atof(DB.curRow[0]);
        }
    }

    sprintf(tmpStr, "%.2f", grandTotal);
    new Q3ListViewItem(repBody, "Total", tmpStr);

    sprintf(tmpStr, "Sales by Service\n%02d-%02d-%04d through %02d-%02d-%04d, $%.2f", sDate.year(), sDate.month(), sDate.day(), eDate.year(), eDate.month(), eDate.day(), grandTotal);
	setTitle(tmpStr);

    QApplication::restoreOverrideCursor();
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:67,代码来源:SalesReports.cpp


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