Ananas Library 0.9.5
|
#include <adocjournal.h>
Public Slots | |
aDocument * | CurrentDocument () |
Gets current document. | |
virtual ERR_Code | Delete () |
Delets current document. | |
virtual ERR_Code | Select (QDateTime from, QDateTime to, const QString &mdName="") |
Select documents at some period. | |
virtual ERR_Code | Select (const QString &num, const QString &mdName="") |
Select document by number and type. | |
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 QVariant | sysValue (const QString &name, const QString &tableName="") |
Gets system field value. | |
virtual int | setSysValue (const QString &name, QVariant value, const QString &tableName="") |
Sets system field value. | |
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 | |
aDocJournal (aCfgItem context, aDatabase *adb=0) | |
Constructor. Init object with context. | |
aDocJournal (const QString &name, aDatabase *adb=0) | |
Constructor. Init object with md object, founded by name. | |
aDocJournal (aDatabase *adb=0) | |
Constructor. Creates system journal. | |
virtual ERR_Code | initObject () |
ERR_Code | selectDocument (Q_ULLONG idd) |
Select document with id =idd. | |
virtual Q_ULLONG | docId () |
Get current document id. | |
int | docType () |
Gets current document type. | |
int | type () |
QString | nextNumber (const QString &prefix, int mdId) |
Generate next document number. | |
QVariant | getDate () |
Gets current document date. | |
QString | getNumber () |
Gets current document prefix + number. | |
int | getSerialNumber () |
Gets current document number. | |
ERR_Code | setDate (QVariant date) |
Sets current document date. | |
ERR_Code | setNumber (QVariant number) |
Sets current document number. | |
virtual ERR_Code | New (Q_ULLONG idd, const QString &docPrefix, int type) |
Create new record in system journal. | |
virtual ERR_Code | deleteDocument (Q_ULLONG idd) |
Delets document with id =idd. | |
Q_ULLONG | findDocument (Q_ULLONG idd) |
Find document by id. | |
Q_ULLONG | findDoc (const QString &num, int type) |
Find document by number and type. | |
QString | getPrefix () |
Gets current document prefix. | |
QString | selectionFilter (QDateTime from, QDateTime to, const QString &mdName="", bool full=false) |
QString | selectionFilter (const QString &num, const QString &mdName="", bool full=false) |
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) |
Осуществляет выделение символьного префикса из строки. | |
virtual ERR_Code | select (Q_ULLONG id) |
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 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. | |
virtual QString | trSysName (const QString &sname) |
Not implemented. | |
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 system journal. Used as interface between database and script or wObjects Included in aDocument for linked document and system journal
aDocJournal::aDocJournal | ( | aCfgItem | context, |
aDatabase * | adb = 0 ) |
Constructor. Init object with context.
context | - md object |
adb | - link to database |
References aObject::aObject(), and initObject().
aDocJournal::aDocJournal | ( | const QString & | name, |
aDatabase * | adb = 0 ) |
Constructor. Init object with md object, founded by name.
name | - md object name |
adb | - link to database |
References aObject::aObject(), and initObject().
aDocJournal::aDocJournal | ( | aDatabase * | adb = 0 | ) |
|
slot |
Gets current document.
References docId(), docType(), and aDocument::select().
Referenced by Delete(), and wDBTable::systemIcon().
|
virtualslot |
Delets current document.
References CurrentDocument(), and aDocument::Delete().
|
virtual |
Delets document with id =idd.
idd | - document id. |
References findDocument(), aObject::LastErrorCode(), aLog::print(), aObject::setLastError(), aObject::table(), and aObject::Uid().
|
virtual |
Get current document id.
Get database id for current document.
Reimplemented from aObject.
References aDataTable::sysValue(), and aObject::table().
Referenced by CurrentDocument(), docType(), and getPrefix().
int aDocJournal::docType | ( | ) |
Gets current document type.
References docId().
Referenced by CurrentDocument(), Select(), and selectionFilter().
Q_ULLONG aDocJournal::findDoc | ( | const QString & | number, |
int | type ) |
Find document by number and type.
number | - document number |
type | - document type |
References aObject::decodeDocNum(), aLog::print(), aObject::select(), aObject::setSelected(), aDataTable::sysValue(), aObject::table(), and type().
Q_ULLONG aDocJournal::findDocument | ( | Q_ULLONG | idd | ) |
Find document by id.
idd | - document number. |
References aObject::getUid(), aLog::print(), aObject::setSelected(), and aObject::table().
Referenced by deleteDocument(), and wDBTable::systemIcon().
QVariant aDocJournal::getDate | ( | ) |
Gets current document date.
References aObject::selected(), and aObject::table().
QString aDocJournal::getNumber | ( | ) |
Gets current document prefix + number.
References aObject::selected(), and aObject::table().
QString aDocJournal::getPrefix | ( | ) |
int aDocJournal::getSerialNumber | ( | ) |
Gets current document number.
References aObject::selected(), and aObject::table().
|
virtual |
Reimplemented from aObject.
References aObject::LastErrorCode(), aLog::print(), aObject::setLastError(), aDatabase::tableDbName(), and aObject::tableInsert().
Referenced by aDocJournal(), aDocJournal(), and aDocJournal().
|
virtual |
Create new record in system journal.
Record create afte crate new document and use information about doc's database id, prefix and metadata id(type). Document number generate automatically by nextNumber().
idd | - database document id. |
docPrefix | - document number prefix. |
type | - document metadata id. |
References nextNumber(), aLog::print(), selectDocument(), aObject::setSelected(), aObject::table(), and type().
QString aDocJournal::nextNumber | ( | const QString & | prefix, |
int | mdId ) |
Generate next document number.
prefix | - number prefix |
mdId | - document's number in metadata |
References aLog::print().
Referenced by New().
|
virtualslot |
Select document by number and type.
number | - document number |
nmName | - document type |
References aObject::decodeDocNum(), aLog::print(), aObject::setSelected(), and aObject::table().
|
virtualslot |
Select documents at some period.
from | - begin date |
to | - end date |
nmName | - document type |
References docType(), aObject::setSelected(), aObject::table(), and type().
ERR_Code aDocJournal::selectDocument | ( | Q_ULLONG | idd | ) |
Select document with id =idd.
idd | - document id. |
References aObject::setSelected(), and aObject::table().
Referenced by New().
QString aDocJournal::selectionFilter | ( | const QString & | num, |
const QString & | mdName = "", | ||
bool | full = false ) |
References aObject::decodeDocNum().
QString aDocJournal::selectionFilter | ( | QDateTime | from, |
QDateTime | to, | ||
const QString & | mdName = "", | ||
bool | full = false ) |
References docType(), and type().
Referenced by aIRegister::Select().
ERR_Code aDocJournal::setDate | ( | QVariant | date | ) |
Sets current document date.
date | - document date. |
References aObject::selected(), and aObject::table().
ERR_Code aDocJournal::setNumber | ( | QVariant | number | ) |
Sets current document number.
number | - document number |
References aObject::decodeDocNum(), aObject::selected(), and aObject::table().
|
inline |
Referenced by findDoc(), New(), Select(), and selectionFilter().