void
RegistrationForm::on_submitRegPushButton_clicked()
{
    if (!ValidateForm())
    {
        QMessageBox msgBox;
        QFont msgBoxFont;
        msgBoxFont.setPointSize(14);
        msgBoxFont.setBold(true);
        msgBox.setWindowTitle("Notice");
        msgBox.setFont(msgBoxFont);
        msgBox.setText("Please enter all required fields");
        msgBox.exec();
        return;
    }
    // All fields have been validated.
    // Create line to be appended file
    QString curLine; // Note: performance here is terrible:
    curLine += ui.firstNameLineEdit->text()
        + "," + ui.lastNameLineEdit->text()
        + "," + ui.gradeComboBox->currentText()
        + "," + ui.schoolLineEdit->text()
        + "," + ui.teenEmailLineEdit->text()
        + "," + ui.parentEmailLineEdit->text()
        + "," + ui.homePhoneLineEdit->text()
        + "," + ui.teenCellLineEdit->text()
        + "," + ui.birthdayLineEdit->text()
        + "," + ui.doyouhaveFacebookComboBox->currentText();
    // Append line to file
    if (!AppendLineToFile(&curLine))
    {
        QMessageBox msgBox;
        QFont msgBoxFont;
        msgBoxFont.setPointSize(14);
        msgBoxFont.setBold(true);
        msgBox.setWindowTitle("Error!");
        msgBox.setFont(msgBoxFont);
        msgBox.setText("Unable to write file: Please get nearest core member!");
        msgBox.exec();
        return;
    }
    // Clear form
    ClearForm();
    // Display "You're done!" box.
    QMessageBox msgBox;
    QFont msgBoxFont;
    msgBoxFont.setPointSize(14);
    msgBoxFont.setBold(true);
    msgBox.setWindowTitle("Contragulations!");
    msgBox.setFont(msgBoxFont);
    msgBox.setText("You have successfully registered!");
    msgBox.exec();
    return;
}
예제 #2
0
bool FileMisc::LogText(LPCTSTR szLine, bool bWantDateTime)
{
	CString sLogFile = GetAppFileName();
	ReplaceExtension(sLogFile, _T(".log"));

	CString sLogLine(szLine);

	if (bWantDateTime)
	{
		sLogLine += _T(" (");
		sLogLine += COleDateTime::GetCurrentTime().Format();
		sLogLine += _T(")");
	}

	return AppendLineToFile(sLogFile, sLogLine);
}
예제 #3
0
파일: Log.cpp 프로젝트: Venom483/Angel-3.1
void FileLog::Log( const String& val)
{
	AppendLineToFile( _fileName, __GetTimeString() + ": " + val );
}
예제 #4
0
void FileLog::Log( const String& val)
{
	AppendLineToFile( _fileName, val );
}