Ananas Library 0.9.5
|
#include <adocument.h>
Public Slots | |
virtual ERR_Code | New () |
virtual ERR_Code | Delete () |
virtual ERR_Code | Update () |
virtual ERR_Code | Select (QDateTime from, QDateTime to) |
virtual bool | Select () |
virtual ERR_Code | Select (const QString &num) |
virtual int | SelectDocument (QVariant uid) |
virtual ERR_Code | Copy () |
virtual bool | Next () |
virtual bool | Prev () |
virtual bool | First () |
virtual bool | Last () |
virtual ERR_Code | TableNewLine (const QString &tablename) |
virtual ERR_Code | TableDelete (const QString &tablename) |
virtual ERR_Code | TableSelect (const QString &name) |
virtual QVariant | TableValue (const QString &tablename, const QString &name) |
virtual ERR_Code | TableSetValue (const QString &tablename, const QString &name, const QVariant &value) |
virtual ERR_Code | TableUpdate (const QString &tablename="") |
virtual bool | TableNext (const QString &name) |
virtual bool | TablePrev (const QString &name) |
virtual bool | TableFirst (const QString &name) |
virtual bool | TableLast (const QString &name) |
virtual bool | IsMarkDeleted () |
virtual bool | IsMarked () |
virtual ERR_Code | SetMarkDeleted (bool Deleted) |
virtual ERR_Code | SetMarked (bool Marked) |
void | SetPrefix (const QString &pr) |
QString | Prefix () |
virtual QVariant | Value (const QString &name, const QString &tableName="") |
virtual ERR_Code | SetFilter (const QString &valname, const QVariant &value) |
virtual ERR_Code | ClearFilter () |
ERR_Code | Conduct () |
Deprecated. | |
ERR_Code | UnConduct () |
Deprecated. | |
bool | IsConducted () |
Deprecated. | |
ERR_Code | SignIn () |
ERR_Code | SignOut () |
bool | IsSignedIn () |
void | Seek (int pos, const QString &tname) |
QVariant | GetDocumentValue (QVariant ide, const QString &fname) |
Public Slots inherited from aObject | |
virtual QString | Uid () |
virtual bool | IsSelected () |
Checks if object selected. | |
virtual bool | IsMarkDeleted (const QString &tname="") |
Checks "Deleted" marker. | |
virtual bool | IsMarked () |
Checks "Marked" marker. | |
virtual int | SetMarkDeleted (bool Deleted, const QString &tablename="") |
Устанавливает признак логического удаления объекта (записи SQL таблицы) | |
virtual int | SetMarked (bool Marked) |
Выставляет отметку на объекте. | |
virtual int | New () |
Add new object record in database. | |
virtual int | Copy () |
virtual int | Delete () |
virtual int | Update () |
Update curent selected object record to database. | |
virtual int | Conduct () |
virtual int | UnConduct () |
virtual bool | IsConducted () |
virtual QString | Kind (const QString &name=QString::null) |
virtual QVariant | Value (const QString &name, const QString &tableName="") |
Return field value of the primary object database table. | |
virtual int | SetValue (const QString &name, const QVariant &value, const QString &tableName="") |
Set field value of the primary object database table. | |
virtual int | SetFilter (const QString &valname, const QVariant &value) |
Задает фильтр записей/объектов | |
virtual int | ClearFilter () |
Чистит фильтр записей/объектов. | |
virtual int | TableSetFilter (const QString &tname, const QString &valname, const QVariant &value) |
Устанавливает вильтр записей табличной части объекта. | |
virtual int | TableClearFilter (const QString &tname) |
Чистит фильтр записей указанной табличной части объекта. | |
virtual bool | IsFiltred () |
Показывает наличие активного фильтра |
Public Member Functions | |
aDocument (aCfgItem context, aDatabase *adb=0) | |
aDocument (const QString &name, aDatabase *adb=0) | |
virtual | ~aDocument () |
virtual ERR_Code | select (Q_ULLONG uid) |
virtual ERR_Code | initObject () |
virtual QString | trSysName (const QString &sname) |
virtual QVariant | sysValue (const QString &sname, const QString &="") |
virtual ERR_Code | setSysValue (const QString &sname, QVariant value, const QString &="") |
aSQLTable * | getTable (const QString &tablename) |
Public Member Functions inherited from aObject | |
aObject (QObject *parent=0, const char *name=0) | |
aObject (const QString &oname, aDatabase *adb, QObject *parent=0, const char *name=0) | |
aObject (aCfgItem context, aDatabase *adb, QObject *parent=0, const char *name=0) | |
virtual | ~aObject () |
Virtual destructor. . | |
virtual bool | checkStructure () |
Not implemented. | |
ERR_Code | init () |
Tune on metadata object and it's database tables. | |
ERR_Code | decodeDocNum (QString nm, QString &pref, int &num) |
Осуществляет выделение символьного префикса из строки. | |
Q_ULLONG | getUid () |
Возвращает уникальный идентификатор объекта из базы данных. | |
bool | selected (const QString &tablename="") |
Показывает задан ли текущий объект или запись в его табличной части. | |
ERR_Code | select (const QString &query, const QString &tableName="") |
Осуществляет SQL запрос. | |
aDataTable * | table (const QString &name="") |
Return the table of object by it's name. | |
virtual Q_ULLONG | docId () |
Returns document database id. | |
virtual bool | Next (const QString &tableName="") |
Перемещает указатель на следующую запись SQL таблицы. | |
virtual bool | Prev (const QString &tableName="") |
Перемещает указатель на предыдующую запись SQL таблицы. | |
virtual bool | First (const QString &tableName="") |
Перемещает указатель на первую запись SQL таблицы. | |
virtual bool | Last (const QString &tableName="") |
Перемещает указатель на последнюю запись SQL таблицы. | |
virtual int | TableUpdate (const QString &tablename) |
virtual QString | displayString () |
Возвращает строку, предназначенную для отображения пользователю объекта сложного типа. | |
virtual int | LastErrorCode () |
virtual QString | LastErrorMessage () |
Additional Inherited Members | |
Public Attributes inherited from aObject | |
aCfg * | md |
aCfgItem | obj |
aDatabase * | db |
Protected Member Functions inherited from aObject | |
virtual aCfgItem | displayStringContext () |
Возвращает контекст (узел дерева) метаданных для вычисления строкового представления сложного типа. | |
virtual ERR_Code | setObject (aCfgItem newobject) |
Sets new object type after create. | |
bool | isInited () |
void | setInited (bool flag) |
ERR_Code | tableInsert (const QString &dbname, aCfgItem obj, const QString &name="") |
Insert table name and its link into internal buffer. | |
ERR_Code | tableInsert (const QString &dbname, const QString &name="") |
Insert table name and its link into internal buffer. | |
ERR_Code | tableRemove (const QString &name="") |
Remove table from buffer. | |
virtual QVariant | tValue (const QString &tablename, const QString &name) |
Return field value of the secondary object database table. | |
virtual ERR_Code | setTValue (const QString &tablename, const QString &name, const QVariant &value) |
Set field value of the secondary object database table. | |
void | setSelected (bool sel, const QString &tablename="") |
Явно задает состояние выбранности объекта или записи его табличной части. | |
virtual ERR_Code | setTFilter (const QString &tname, const QString &valname, const QVariant &value) |
Устанавливает вильтр записей табличной части объекта. | |
virtual ERR_Code | clearTFilter (const QString &tname) |
Чистит фильтр записей указанной табличной части объекта. | |
void | setLastError (int, QString) |
Задает значения свойствам lastErrorCode и lastErrorMessage класса | |
Protected Attributes inherited from aObject | |
bool | concrete |
Not visual object used for working with documents in database. Used as interface between database and script or wObjects
aDocument::aDocument | ( | aCfgItem | context, |
aDatabase * | adb = 0 ) |
Create object aDocument by ananas configuration object. New object initing by md ojbect Use for creating object if you have md object, for example in default document form
context | - md object used for initing aDocument. |
adb | - ananas database for working. |
References aObject::aObject(), and initObject().
Referenced by Copy().
aDocument::aDocument | ( | const QString & | name, |
aDatabase * | adb = 0 ) |
Create object aDocument by document metadata name. new object initing by md ojbect with some name Use for creating object if you know it's name
name | - md name of document. |
adb | - ananas database for working. |
References aObject::aObject(), and initObject().
|
virtual |
Destroy object aDocument. Use for delete system journal and free memory.
|
virtualslot |
|
virtualslot |
\if english Copy current document. Create document with header and table pats like current document. New document have current date and next unical number. \endif
References aDocument(), aObject::Copy(), aObject::getUid(), select(), aObject::table(), TableNewLine(), TableNext(), TableSelect(), TableSetValue(), TableUpdate(), TableValue(), and aObject::Uid().
|
virtualslot |
Delete current document. Delete document header, all tables and system journal record, If document conducted (turn on) it unconduct (make turn off).
References aObject::Delete(), aObject::getUid(), IsConducted(), aLog::print(), aObject::selected(), and UnConduct().
Referenced by aDocJournal::Delete().
|
virtualslot |
Make current first selected header. Use for navigation by selected documents.
References aObject::First(), and aObject::getUid().
|
slot |
Get value of document field.
docId | - document id |
fname | - md field name |
References aObject::docId(), select(), aObject::setLastError(), and Value().
aSQLTable * aDocument::getTable | ( | const QString & | tname | ) |
Get table by it's metadataname name. This function added for get access to document table by it name for othe objects.
tname | - metadata table name. |
References aObject::table().
|
virtual |
Init object aDocument. Used for insert table for document header and tables for all table part of document. After that we can work wthith document' tables by it name, name of heared table = ""
Reimplemented from aObject.
References aObject::initObject(), aDatabase::tableDbName(), and aObject::tableInsert().
Referenced by aDocument(), and aDocument().
|
virtualslot |
Check document on mark deleted
|
virtualslot |
Check document on marked
|
slot |
Check document conducting.
References aObject::getUid().
Referenced by IsConducted().
|
virtualslot |
Make current last selected header. Use for navigation by selected documents.
References aObject::getUid(), and aObject::Last().
|
virtualslot |
Create new document. Create new document header record by selected type in database, if object not seted, return error. New document also registred in system journal and make current
References aObject::getUid(), aObject::LastErrorCode(), aObject::New(), Prefix(), aLog::print(), aObject::setLastError(), SetPrefix(), aObject::table(), and aObject::Uid().
|
virtualslot |
Make current next selected header. Use for navigation by selected documents.
References aObject::getUid(), and aObject::Next().
|
slot |
|
virtualslot |
Make current prev selected header. Use for navigation by selected documents.
References aObject::getUid(), and aObject::Prev().
|
slot |
Sets position in document table tname at pos.
pos | - line number |
tname | - table name |
References aObject::setSelected(), and aObject::table().
|
virtualslot |
Select document by number. Document number string which conteyn document prefix and some number If adocument inited by some document type from metadata selected only this documents from jpurnal, otherwise - select all documents from system journal with such date
num | - document number |
References aObject::getUid(), aObject::IsFiltred(), aObject::setSelected(), and aObject::table().
|
virtualslot |
Select document by dates. If set only one date (othe isNull) select records before or after date. If adocument inited by some document type from metadata selected only this documents from jpurnal, otherwise - select all documents from system journal with such date
from | - begin date of selection if isNull - selected from first date of system journal, |
to | - end date of selection if isNull - selected to last date of system journal. |
References aObject::getUid(), aObject::IsFiltred(), aObject::setSelected(), and aObject::table().
|
virtual |
Select document with id = uid.
Reimplemented from aObject.
References aObject::select().
Referenced by Copy(), aDocJournal::CurrentDocument(), aIRegister::GetDocument(), GetDocumentValue(), and SelectDocument().
|
virtualslot |
References select().
|
virtualslot |
Set filter for some field. If filter seted, on select selected only records where that field equal value. If seted filters for diferent fields it's group by and. If filter reseted it override previous value
valname | - metadata name of field. |
value | - filter value. |
References aObject::SetFilter().
|
virtualslot |
Set document deleted flag
Deleted | - deleted flag |
|
virtualslot |
Set document marked flag
Marked | - marked flag |
|
slot |
Set document prefix. Document prefix used for generate document number.
pr | - new document prefix. |
Referenced by New().
|
virtual |
Set value for some system field of document. Used for write some system field of document: DocDate - Date and time of document, DocNumber - Number of document.
sname | - name of system field |
value | - new value of field |
Reimplemented from aObject.
|
slot |
Make document conducted. Work only for unconducted documents otherwise return error err_docconducted
References IsConducted().
Referenced by Conduct().
|
slot |
Make document unconducted. Work only for conducted documents otherwise return error err_docunconducted
References aARegister::deleteDocument(), aIRegister::deleteDocument(), IsConducted(), and aLog::print().
Referenced by UnConduct().
|
virtual |
Get value for some system field of document. Used for read some system field of document: DocDate - Date and time of document, DocNumber - Number of document.
sname | - name of system field. |
Reimplemented from aObject.
|
virtualslot |
Delete current table line. When deleted table line also deleted all records in all reegisters which contain link on this line Don't work if document conducted.
tablename | - metadata name of table |
References aIRegister::deleteTable(), IsConducted(), aObject::LastErrorCode(), aLog::print(), aObject::setLastError(), and aObject::table().
|
virtualslot |
Make current first selected line in table. Use for navigation in table
name | - metadata table name. |
References aObject::table().
|
virtualslot |
Make current last selected line in table. Use for navigation in table
name | - metadata table name. |
References aObject::table().
|
virtualslot |
Create new table line. Create new table line for table of now document if document not selected, or no table with some name return error. New line begin current in table
tablename | - metadata name of table. |
References aObject::getUid(), IsConducted(), aObject::LastErrorCode(), aLog::print(), aObject::setLastError(), aObject::table(), and TableUpdate().
Referenced by Copy().
|
virtualslot |
Make current next selected line in table. Use for navigation in table.
name | - metadata table name. |
References aObject::table().
Referenced by Copy().
|
virtualslot |
Make current prev selected line in table. Use for navigation in table
name | - metadata table name. |
References aObject::table().
|
virtualslot |
Select table by name. Make table with such name current
name | - table metadata name |
Referenced by Copy().
|
virtualslot |
Set some field value of current table line. Set value for field by metadata name
tablename | - metadata name of table, |
name | - metadata name of field, |
value | - new field value. |
References aObject::setTValue().
Referenced by Copy().
|
virtualslot |
Update table. Use for insert information from bufer into database. Information is inserting in table with md name=teblename, if used TableUpdate() - updating all tables of document. If document already conducted return error.
tablename | - metadata name of table |
References IsConducted(), aLog::print(), and aObject::TableUpdate().
Referenced by Copy(), and TableNewLine().
|
virtualslot |
Get some field value of current table line. Get value for field by metadata name or sustem value ln if use name "TableLine".
tablename | - metadata name of table |
name | - name of field |
References aDataTable::sysValue(), aObject::table(), trSysName(), and aObject::tValue().
Referenced by Copy().
|
virtual |
Translate name of system field. Used for translate same system names from different languages ot english, result used from working with system fields
sname | - field name on same language. |
Reimplemented from aObject.
Referenced by TableValue().
|
virtualslot |
Updete current record in database. Also update record for document system journal and all table parts. Don't work for conducted (Turn on) documents
References IsConducted(), aObject::LastErrorCode(), aObject::setLastError(), and aObject::Update().
|
virtualslot |
Return field value with name = name of the primary object database table.
name | - field name |
References aObject::Value().
Referenced by aARegister::deleteDocument(), and GetDocumentValue().