本文整理汇总了C++中Customer::setId方法的典型用法代码示例。如果您正苦于以下问题:C++ Customer::setId方法的具体用法?C++ Customer::setId怎么用?C++ Customer::setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customer
的用法示例。
在下文中一共展示了Customer::setId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testId
void TCustomer::testId () {
Customer c;
c.setId (tId);
QVERIFY (c.getId () == tId);
}
示例2: on_SaveCustomer_clicked
void MainWindow::on_SaveCustomer_clicked()
{
if("" == ui->FindName->text() || "" == ui->FindSurname->text() || "" == ui->FindGroupID->text())
{
QMessageBox::about(0,Title,NotAllCustomerData);
ui->FindName->setFocus();
}
else
{
Customer customer;
customer.setId( ui->FindID->text() );
customer.setName( ui->FindName->text());
customer.setSurname( ui->FindSurname->text());
customer.setGroupId( ui->FindGroupID->text().toInt());
CM.editCustomer(customer);
ui->FindID->setText("");
ui->FindGroupID->setText("");
ui->FindName->setText("");
ui->FindSurname->setText("");
ui->FindID->setFocus();
CustomerTableView();
}
}
示例3: on_DeleteCustomer_clicked
void MainWindow::on_DeleteCustomer_clicked()
{
if("" == ui->CustomerIDDelete->text())
{
QMessageBox::about(0,Title,NoCustomerID);
ui->CustomerIDDelete->setFocus();
}
else
{
Customer customer;
customer.setId(ui->CustomerIDDelete->text());
CM.deleteCustomer(customer);
ui->CustomerIDDelete->setText("");
ui->CustomerIDDelete->setFocus();
CustomerTableView();
}
}
示例4: on_NewReservation_clicked
void MainWindow::on_NewReservation_clicked()
{
if("" == ui->CustomerIdReservation->text() || "" == ui->RoomNumberReservation->text())
{
QMessageBox::about(0,Title,EmptyRes);
ui->CustomerIdReservation->setFocus();
}
else
{
if(ui->CheckInDate->date() < QDate::currentDate())
{
QMessageBox::about(0,Title,DateBeforeCurrentDate);
ui->CheckInDate->setDate(QDate(QDate::currentDate()));
}
else if(ui->CheckOutDate->date() < ui->CheckInDate->date())
{
QMessageBox::about(0,Title,CheckOutBeforeCheckIn);
ui->CheckOutDate->setDate(ui->CheckInDate->date());
}
else
{
Room room;
Customer customer;
customer.setId(ui->CustomerIdReservation->text());
room.setRoomNumber(ui->RoomNumberReservation->text().toInt());
ResM.roomReservation(ui->CheckInDate->date(),ui->CheckOutDate->date(),room,customer);
ui->CheckInDate->setDate(QDate(QDate::currentDate()));
ui->CheckOutDate->setDate(QDate(QDate::currentDate()));
ui->CustomerIdReservation->setText("");
ui->RoomNumberReservation->setText("");
ui->CustomerIdReservation->setFocus();
showRoomGrid();
}
}
}