private void saveContact() throws SQLException {
        // TODO: When adding new and editing given contacts, check for doubles in the database. Give them visible IDs to make the difference when contacts really have the same names.
        
        if (checkFieldsForSaving()) {

            clsContactsDetails mContactDetails = new clsContactsDetails();

            //Differentiate between the two saving modes new and modify.
            clsContacts.enmSavingMode mSavingMode = null;
            if (this.pStatus == enmStatus.New) {
                mSavingMode = clsContacts.enmSavingMode.New;
            } else if (this.pStatus == enmStatus.Modify) {
                mSavingMode = clsContacts.enmSavingMode.Modify;

                int mID = ((clsContactsTableModel) tblContacts.getModel()).getID(tblContacts.getSelectedRow());
                int mIDModifications = ((clsContactsTableModel) tblContacts.getModel()).getIDModifications(tblContacts.getSelectedRow());
                mContactDetails.setID(mID);
                mContactDetails.setIDModification(mIDModifications);
            }

            //Create the contact details.
            mContactDetails.setFirstName(txtFirstName.getText());
            mContactDetails.setMiddleName(txtMiddleName.getText());
            mContactDetails.setLastName(txtLastName.getText());
            mContactDetails.setBirthday(dtpBirthday.getDate());
            mContactDetails.setGender(getGender());
            mContactDetails.setStreet(txtStreet.getText());
            mContactDetails.setPostcode(txtPostcode.getText());
            mContactDetails.setCity(txtCity.getText());
            mContactDetails.setCountry(txtCountry.getText());
            mContactDetails.setAvailability(txtAvailability.getText());
            mContactDetails.setComment(txtComment.getText());
            
            int mIDContacts = this.pModel.saveContact(mSavingMode, mContactDetails);
            if (mIDContacts > 0) {
                this.pStatus = enmStatus.View;
                setComponents();
                
                //Select the created or modified row.
                if (mSavingMode == clsContacts.enmSavingMode.New) {
                    this.pSelectedRow = getRowOfID(mIDContacts);
                }
                selectContact();
            }
        }
    }