void address::sEdit() { internalSave(); switch (_uses->altId()) { case 1: sEditContact(); break; case 2: sEditShipto(); break; case 3: sEditVendor(); break; case 4: sEditVendorAddress(); break; case 5: sEditWarehouse(); break; default: break; } // force AddressCluster to reload its data int tmpAddrId = _addr->id(); _addr->setId(-1); _addr->setId(tmpAddrId); sPopulate(); }
void address::sDeleteCharacteristic() { internalSave(); q.prepare( "DELETE FROM charass " "WHERE (charass_id=:charass_id);" ); q.bindValue(":charass_id", _charass->id()); q.exec(); sGetCharacteristics(); }
bool GenericMapHeader::save( const char* filename, bool updateCreationTime ) { int un_res = unlink( filename ); if ( un_res == 0 ) { mc2dbg << "[GMH]: Removed " << MC2CITE( filename ) << endl; } else { if ( errno == ENOENT ) { // Ok. No file exists } else { mc2log << error << "[GMH]::save could not remove " << filename << endl; return false; } } MC2String dirname = STLStringUtility::dirname( filename ); char tempFilename[64]; sprintf( tempFilename, "GMHsave0x%x_", m_mapID ); TempFile tempFile( tempFilename, dirname, filename ); if ( ! tempFile.ok() ) { mc2log << error << "In GenericMapHeader::save(). " << endl; return false; } mc2dbg << "[GMH]: Writing to temp file " << MC2CITE( tempFile.getTempFilename() ) << endl; m_updateCreationTime = updateCreationTime; bool retVal = internalSave( tempFile.getFD() ); // Unfortunately internalSave does not return false // if the disk is full.... if ( retVal ) { // Chmod the file if ( fchmod( tempFile.getFD(), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ) == -1 ) { mc2dbg << "[GMH]: Failed to chmod file. Error: " << strerror( errno ) << endl; } } else { mc2log << error << "[GMH]::save error when saving - removing " << tempFile.getTempFilename() << endl; tempFile.setFailed( true ); } return retVal; }
void address::sEditCharacteristic() { internalSave(); ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sGetCharacteristics(); }
void address::sSave() { internalSave(); done(_addr->id()); }