// -------------------------------------------------------------------------------- // Name: SaveData // Abstract: Get the data off the form and save it to the database // -------------------------------------------------------------------------------- private boolean SaveData() { boolean blnResult = false; try { // Make a suitcase for moving data udtTeamType udtNewTeam = new CUserDataTypes().new udtTeamType(); // Load suitcase with data from the form udtNewTeam.intTeamID = 0; // Don't know it yet so set to 0 udtNewTeam.strTeam = m_txtTeam.getText(); udtNewTeam.strMascot = m_txtMascot.getText(); // We are busy CUtilities.SetBusyCursor(this, true); // Try to save the data blnResult = CDatabaseUtilities.AddTeamToDatabase(udtNewTeam); // Did it work? if (blnResult == true) { // Yes, save the new team ID m_intNewTeamID = udtNewTeam.intTeamID; } } catch (Exception excError) { // log and display errors CUtilities.WriteLog(excError); } finally { // We are no longer busy CUtilities.SetBusyCursor(this, false); } return blnResult; }