void MainProgramWindow::on_pushButton_RequestBrochure_clicked()
{
	SignUpWindow* sWindow;

	Customer customer;
	bool properFields = false;

	sWindow = new SignUpWindow;
	sWindow->setModal(true);

	int submitSuccess = sWindow->exec();

	if (submitSuccess)
	{
		sWindow->on_buttonBox_accepted(customer, properFields);

		if (properFields)
		{
			// check if the customer is not taken
			if (!customerList.isExist(customer)
			&& !customerList.isExistSameName(customer.getUserName()))
			{
				customerList.Enqueue(customer);
				updateCustomerList(&customerList);
				QMessageBox::information(this, tr("Registration Successful"),tr("\"%1\", you will be notified shortly whether you have been accepted or rejected.").arg(customer.getUserName()));

			// SIGNALS & SLOTS
//			 emit customerListChanged(&customerList);

			}
			else if (customerList.isExistSameName(customer.getUserName()))
			{
				QMessageBox::information(this, tr("Registration Unsuccessful"),tr("Please enter in another name,""\"%1\" is already taken").arg(customer.getUserName()));
			}
			else
			{

				QMessageBox::information(this, tr("Registration Unsuccessful"),
					tr("\"%1\" is already in your "
					"customer list.").arg(customer.getUserName()));

			}
		}

		delete sWindow;
	}
}
Beispiel #2
0
void Manager::dispAccount(int uID){
    Customer foundCust = findCust(uID);
    cout<<"\nUsername: "******"\nID Number: " << foundCust.getID();
    if (foundCust.hasChequing()){
        cout<<"\nChequing Account Balance: $"<<foundCust.getBalance(0);
    }
    if (foundCust.hasSavings()){
        cout<<"\nSavings Account Balance: $"<<foundCust.getBalance(1);
    }
    cout<<endl;
}
bool Customer::operator <(const Customer& otherCustomer) const
{
    return this->getUserName() < otherCustomer.getUserName();
}