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) |
![]() | |
virtual QString | Uid () |
virtual bool | IsSelected () |
Checks if object selected. More... | |
virtual bool | IsMarkDeleted (const QString &tname="") |
Checks "Deleted" marker. More... | |
virtual bool | IsMarked () |
Checks "Marked" marker. More... | |
virtual int | SetMarkDeleted (bool Deleted, const QString &tablename="") |
Устанавливает признак логического удаления объекта (записи SQL таблицы) More... | |
virtual int | SetMarked (bool Marked) |
Выставляет отметку на объекте. More... | |
virtual int | New () |
Add new object record in database. More... | |
virtual int | Copy () |
virtual int | Delete () |
virtual int | Update () |
Update curent selected object record to database. More... | |
virtual int | Conduct () |
Conducts document. More... | |
virtual int | UnConduct () |
Unconducts document. More... | |
virtual bool | IsConducted () |
Checks if document has been conducted. More... | |
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. More... | |
virtual int | SetValue (const QString &name, const QVariant &value, const QString &tableName="") |
Set field value of the primary object database table. More... | |
virtual int | SetFilter (const QString &valname, const QVariant &value) |
Задает фильтр записей/объектов | |
virtual int | ClearFilter () |
Чистит фильтр записей/объектов. More... | |
virtual int | TableSetFilter (const QString &tname, const QString &valname, const QVariant &value) |
Устанавливает вильтр записей табличной части объекта. More... | |
virtual int | TableClearFilter (const QString &tname) |
Чистит фильтр записей указанной табличной части объекта. More... | |
virtual bool | IsFiltred () |
Показывает наличие активного фильтра | |
virtual int | TableUpdate (const QString &tablename) |
virtual QString | displayString () |
Возвращает строку, предназначенную для отображения пользователю объекта сложного типа. More... | |
virtual int | LastErrorCode () |
virtual QString | LastErrorMessage () |
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) |
![]() | |
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) | |
Creates aObject, inited by md object. More... | |
virtual | ~aObject () |
Virtual destructor. | |
virtual bool | checkStructure () |
Not implemented. More... | |
ERR_Code | init () |
Tune on metadata object and it's database tables. More... | |
ERR_Code | decodeDocNum (QString nm, QString &pref, int &num) |
Осуществляет выделение символьного префикса из строки. More... | |
Q_ULLONG | getUid () |
Возвращает уникальный идентификатор объекта из базы данных. More... | |
bool | selected (const QString &tablename="") |
Показывает задан ли текущий объект или запись в его табличной части. More... | |
ERR_Code | select (const QString &query, const QString &tableName="") |
Осуществляет SQL запрос. More... | |
aDataTable * | table (const QString &name="") |
Return the table of object by it's name. More... | |
virtual Q_ULLONG | docId () |
Returns document database id. More... | |
virtual bool | Next (const QString &tableName="") |
Перемещает указатель на следующую запись SQL таблицы. More... | |
virtual bool | Prev (const QString &tableName="") |
Перемещает указатель на предыдующую запись SQL таблицы. More... | |
virtual bool | First (const QString &tableName="") |
Перемещает указатель на первую запись SQL таблицы. More... | |
virtual bool | Last (const QString &tableName="") |
Перемещает указатель на последнюю запись SQL таблицы. More... | |
Additional Inherited Members | |
![]() | |
aCfg * | md |
aCfgItem | obj |
aDatabase * | db |
![]() | |
virtual aCfgItem | displayStringContext () |
Возвращает контекст (узел дерева) метаданных для вычисления строкового представления сложного типа. | |
virtual ERR_Code | setObject (aCfgItem newobject) |
Sets new object type after create. More... | |
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. More... | |
ERR_Code | tableInsert (const QString &dbname, const QString &name="") |
Insert table name and its link into internal buffer. More... | |
ERR_Code | tableRemove (const QString &name="") |
Remove table from buffer. More... | |
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 класса More... | |
![]() | |
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 initObject().
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 initObject().
|
virtual |
Destroy object aDocument. Use for delete system journal and free memory.
|
virtualslot |
|
virtualslot |
Copy current document. Create document with header and table pats like current document. New document have current date and next unical number.
References aCfg::attr(), aObject::Copy(), aCfg::count(), aCfg::find(), aDocJournal::getPrefix(), aObject::getUid(), aCfg::id(), aDatabase::markDeleted(), aDocJournal::New(), select(), aObject::table(), TableNewLine(), TableNext(), TableSelect(), TableSetValue(), TableUpdate(), and TableValue().
|
virtualslot |
Delete current document. Delete document header, all tables and system journal record, If document conducted (turn on) it unconduct (make turn off).
References aCfg::attr(), aCfg::count(), aObject::Delete(), aDocJournal::deleteDocument(), aCfg::find(), aObject::getUid(), IsConducted(), aDatabase::markDeleted(), aLog::print(), aObject::selected(), and UnConduct().
Referenced by aDocJournal::Delete().
|
virtualslot |
Make current first selected header. Use for navigation by selected documents.
References aDocJournal::findDocument(), aObject::First(), and aObject::getUid().
|
slot |
Get value of document field.
docId | - document id |
fname | - md field name |
References 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().
Referenced by aARegister::New(), and aIRegister::New().
|
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 aCfg::attr(), aCfg::count(), aCfg::find(), aObject::initObject(), aDatabase::tableDbName(), and aObject::tableInsert().
Referenced by aDocument().
|
virtualslot |
Check document on mark deleted
References aObject::IsMarkDeleted().
|
virtualslot |
Check document on marked
References aObject::IsMarked().
|
slot |
Check document conducting.
References aDatabase::db(), and aObject::getUid().
Referenced by IsConducted().
|
virtualslot |
Make current last selected header. Use for navigation by selected documents.
References aDocJournal::findDocument(), 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 aCfg::attr(), aObject::getUid(), aCfg::id(), aObject::LastErrorCode(), aDatabase::markDeleted(), aDocJournal::New(), aObject::New(), Prefix(), aLog::print(), aObject::setLastError(), SetPrefix(), and aObject::table().
|
virtualslot |
Make current next selected header. Use for navigation by selected documents.
References aDocJournal::findDocument(), aObject::getUid(), and aObject::Next().
|
slot |
|
virtualslot |
Make current prev selected header. Use for navigation by selected documents.
References aDocJournal::findDocument(), 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().
|
virtual |
Select document with id = uid.
Reimplemented from aObject.
References aCfg::attr(), aCfg::count(), aCfg::find(), and aDocJournal::findDocument().
Referenced by Copy(), aDocJournal::CurrentDocument(), aIRegister::GetDocument(), and GetDocumentValue().
|
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 aCfg::attr(), aDocJournal::findDocument(), aObject::getUid(), aObject::IsFiltred(), Select(), aObject::setSelected(), and aObject::table().
Referenced by Select().
|
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 aCfg::attr(), aDocJournal::findDocument(), aObject::getUid(), aObject::IsFiltred(), Select(), aObject::setSelected(), and aObject::table().
|
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 |
References aObject::SetMarkDeleted().
|
virtualslot |
Set document marked flag
Marked | - marked flag |
References aObject::SetMarked().
|
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.
References aDocJournal::setDate(), and aDocJournal::setNumber().
|
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 aCfg::count(), aARegister::deleteDocument(), aIRegister::deleteDocument(), aCfg::find(), 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.
References aDocJournal::getDate(), aDocJournal::getNumber(), and aDocJournal::getSerialNumber().
|
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(), aDatabase::markDeleted(), 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 aDatabase::db(), 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 aCfg::attr(), aCfg::count(), aCfg::find(), IsConducted(), and aLog::print().
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(), GetDocumentValue(), aARegister::New(), and aARegister::Update().