本文整理汇总了C++中Customer::getCompanyName方法的典型用法代码示例。如果您正苦于以下问题:C++ Customer::getCompanyName方法的具体用法?C++ Customer::getCompanyName怎么用?C++ Customer::getCompanyName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customer
的用法示例。
在下文中一共展示了Customer::getCompanyName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteCustomer
bool MainWindow::deleteCustomer(Customer customer) {
QString messageResult = _dbManager->deleteCustomer(customer);
if( messageResult != NULL)
{
QMessageBox::critical(this, tr("Delete attempt failed"), "Could not delete \"" + customer.getCompanyName() + "\" from the database: \n" + messageResult);
ui->statusBar->showMessage("Database remove unsuccessful: " + customer.getCompanyName());
return false;
} else {
ui->statusBar->showMessage("Successfully deleted \"" + customer.getCompanyName() + "\" from the databse");
ui->tableTabWidget->removeTab(ui->tableTabWidget->currentIndex());
}
return true;
}
示例2: addCustomerToList
// PUBLIC FUNCTIONS
bool MainWindow::addCustomerToList(Customer customer) {
QString messageResult = _dbManager->addCustomer(customer);
if( messageResult != NULL)
{
QMessageBox::critical(this, tr("Save attempt failed"), "Could not save \"" + customer.getCompanyName() + "\" into the database: \n" + messageResult);
ui->statusBar->showMessage("Add to database unsuccessful: " + customer.getCompanyName());
return false;
} else {
ui->statusBar->showMessage("Successfully added \"" + customer.getCompanyName() + "\" to the databse");
// Close the current tab
ui->tableTabWidget->removeTab(ui->tableTabWidget->currentIndex());
// Open the company invoice tab
QWidget *customerInvoiceTab = new AllCompanyInvoices(0, this, &customer);
ui->tableTabWidget->setCurrentIndex(ui->tableTabWidget->addTab(customerInvoiceTab, customer.getCompanyName() + " Invoices"));
}
return true;
}
示例3: on_listView_doubleClicked
void MainWindow::on_listView_doubleClicked(const QModelIndex &index)
{
// Open the company invoice tab
QAbstractItemModel *model = ui->listView->model();
QString cNameFromList = model->data(index, Qt::DisplayRole).toString();
Customer *customer = _dbManager->getCustomerByName(cNameFromList);
QWidget *customerInvoiceTab = new AllCompanyInvoices(0, this, customer);
ui->tableTabWidget->setCurrentIndex(ui->tableTabWidget->addTab(customerInvoiceTab, customer->getCompanyName() + " Invoices"));
}