本文整理汇总了C++中Customer::getForename方法的典型用法代码示例。如果您正苦于以下问题:C++ Customer::getForename方法的具体用法?C++ Customer::getForename怎么用?C++ Customer::getForename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customer
的用法示例。
在下文中一共展示了Customer::getForename方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateReceipt
void JobShow::generateReceipt()
{
Date jobDate(job.getDate());
QString saveFolder
= SettingForm::getPdfDirectoryWithoutSlash() + "/receipts/"
+ QDate::longMonthName(Date(job.getDate()).month) + '_' + toString(jobDate.year).c_str();
if (!QDir(saveFolder).exists()) QDir().mkpath(saveFolder);
Customer customer = CustomerController::getCustomer(job.getCustomerId());
customerEmailAddress = customer.getEmailAddress();
receiptFileName.clear();
receiptFileName.reserve(256);
receiptFileName += "receipt_";
receiptFileName += customer.getForename();
receiptFileName += customer.getSurname();
receiptFileName += "_";
receiptFileName += toString(job.getId());
receiptFileName += "_";
receiptFileName += (string)Date(job.getDate());
receiptFileName += ".pdf";
replaceChars(receiptFileName, ' ', '_');
replaceChars(receiptFileName, '/', '-');
replaceChars(receiptFileName, ':', '-');
receiptFileName = saveFolder.toStdString() + '/' + receiptFileName;
PdfGenerator::generateReceipt(receiptFileName.c_str(), job);
}
示例2: updateView
void JobShow::updateView()
{
TaskController::sortTasksByDate(tasks);
setWindowTitle(QString("Job for ") + Date(job.getDate()).toQStringWithoutTime());
ui->label_dateE->setText(Date(job.getDate()));
Customer customer = CustomerController::getCustomer(job.getCustomerId());
ui->label_customerNameE->setText(createFullName(customer.getForename(), customer.getSurname()));
ui->plainTextEdit_descriptionE->setPlainText(job.getDescription());
ui->listWidget_partsE->clear();
char partString[64];
for (unsigned i = 0; i < parts.size(); ++i)
{
strcpy(partString, toString(parts[i].getQuantity()).c_str());
strcat(partString, "x ");
strcat(partString, parts[i].getName());
ui->listWidget_partsE->addItem(partString);
}
ui->listWidget_tasksE->clear();
for (unsigned i = 0; i < tasks.size(); ++i)
ui->listWidget_tasksE->addItem(limitLength(tasks[i].getDescription(), 40));
updateCharges();
QString str;
switch (job.getCompletionState())
{
case Job::NOT_DONE: str = "Not done"; break;
case Job::DONE_UNPAID: str = "Done - not paid"; break;
case Job::DONE_PAID: str = "Done - paid"; break;
}
ui->label_completionStateE->setText(str);
ui->gridWidget_sendInvoiceMarkAsPaid->setHidden(job.getCompletionState() != Job::DONE_UNPAID);
ui->pushButton_markAsDone->setHidden(job.getCompletionState() != Job::NOT_DONE);
ui->gridWidget_paidBy->setHidden(job.getCompletionState() != Job::DONE_PAID);
switch (job.getPaymentMethod())
{
case Job::NA: str = "N/A"; break;
case Job::CASH: str = "Cash"; break;
case Job::CHEQUE: str = "Cheque"; break;
case Job::CREDIT: str = "Credit"; break;
case Job::DEBIT: str = "Debit"; break;
case Job::BANK_TRANSFER: str = "Bank transfer"; break;
}
ui->label_paymentTypeE->setText(str);
ui->label_paymentDateE->setText(Date(job.getPaymentDate()));
}
示例3: updateListWidgets
void MainWindow::updateListWidgets()
{
const Date date(ui->calendar->selectedDate());
ui->label_selectedDate1->setText(date.toQStringWithoutTime());
ui->label_selectedDate2->setText(date.toQStringWithoutTime());
ui->listWidget_jobs->clear();
ui->listWidget_tasks->clear();
Customer customer;
for (unsigned i = 0; i < jobs->size(); ++i)
{
customer = CustomerController::getCustomer(jobs->at(i).getCustomerId());
ui->listWidget_jobs->addItem(createFullName(customer.getForename(), customer.getSurname()));
}
for (unsigned i = 0; i < tasks->size(); ++i)
ui->listWidget_tasks->addItem(limitLength(tasks->at(i).getDescription(), 30));
}