Logo Search packages:      
Sourcecode: facturalux version File versions  Download package

void FLSqlCursor::insertRecord (  )  [slot]

Abre el formulario de edicion de registro definido en los metadatos (FLTableMetaData) listo para insertar un nuevo registro en el cursor.

Definition at line 675 of file FLSqlCursor.cpp.

References commitBuffer(), cursorRelation, EDIT, FLTableMetaData::field(), FLRelationMetaData::field(), FLRelationMetaData::foreignField(), FLManager::formatValue(), INSERT, metadata(), metadata_, modeAccess(), openFormInMode(), relation, seek(), select(), setModeAccess(), and valueBuffer().

Referenced by FLDataTable::eventFilter(), and FLTableDB::insertRecord().

{
  if (cursorRelation && relation && metadata_)
      {
        if (cursorRelation->modeAccess () == INSERT)
            {
              QString fG = cursorRelation->valueBuffer (relation->foreignField ()).toString ();
              if (!cursorRelation->commitBuffer ())
                  return;
              cursorRelation->setModeAccess (EDIT);
              cursorRelation->select ("upper(" + relation->field () + ")=" +
                                                  FLManager::formatValue (cursorRelation->metadata ()->field (relation->foreignField ()), QVariant (fG.upper ())));
              cursorRelation->seek (0);
              cursorRelation->QSqlCursor::select ("");
              cursorRelation->QSqlCursor::next ();
            }
      }
  openFormInMode (INSERT);
}


Generated by  Doxygen 1.6.0   Back to index