Ananas Library  0.9.5
Public Slots | Public Member Functions | Protected Attributes | List of all members
aIRegister Class Reference

#include <airegister.h>

Inheritance diagram for aIRegister:
aObject aARegister

Public Slots

virtual int SetDocument (aDocument *doc)
 Sets document. More...
 
virtual aDocumentGetDocument ()
 Gets document. More...
 
virtual int SetTable (const QString &tblname)
 Sets table. More...
 
virtual int New ()
 Adds new line to infomation register table. More...
 
virtual int Select (const QString &from, const QString &to)
 Selects records for date interval. More...
 
virtual int Select (QDateTime from, QDateTime to)
 Selects records for period. More...
 
virtual int SelectByDoc ()
 
virtual QVariant Value (const QString &name, const QString &tableName="")
 Return field value with name = name of the primary object database table. More...
 
virtual int SetFilter (const QString &fieldName, const QVariant &value)
 Sets filter. More...
 
virtual bool Next ()
 
virtual bool Prev ()
 
virtual bool First ()
 
virtual bool Last ()
 
- Public Slots inherited from aObject
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 QVariant sysValue (const QString &name, const QString &tableName="")
 Gets system field value. More...
 
virtual int setSysValue (const QString &name, QVariant value, const QString &tableName="")
 Sets system field value. 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 ()
 Показывает наличие активного фильтра
 

Public Member Functions

 aIRegister (aCfgItem registerItem, aDatabase *adb=0)
 Create object aIRegister by ananas configuration object. More...
 
 aIRegister (const QString &name, aDatabase *adb=0, const QString &type="InfoRegister.")
 Create object aIRegister by information register metadata name. More...
 
virtual ERR_Code initObject ()
 Initing this object by information registr from metadata object. More...
 
virtual bool deleteDocument (aDocument *doc)
 Delete all record with document id from all information registers. More...
 
virtual bool deleteTable (Q_ULLONG iddt)
 Removes records with given table id. More...
 
- 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)
 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...
 
virtual ERR_Code select (Q_ULLONG id)
 
Q_ULLONG getUid ()
 Возвращает уникальный идентификатор объекта из базы данных. More...
 
bool selected (const QString &tablename="")
 Показывает задан ли текущий объект или запись в его табличной части. More...
 
ERR_Code select (const QString &query, const QString &tableName="")
 Осуществляет SQL запрос. More...
 
aDataTabletable (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...
 
virtual int TableUpdate (const QString &tablename)
 
virtual QString displayString ()
 Возвращает строку, предназначенную для отображения пользователю объекта сложного типа. More...
 
virtual int LastErrorCode ()
 
virtual QString LastErrorMessage ()
 

Protected Attributes

bool docseted
 
bool tableseted
 
QString tname
 
aDocumentnowDoc
 
- Protected Attributes inherited from aObject
bool concrete
 

Additional Inherited Members

- Public Attributes inherited from aObject
aCfgmd
 
aCfgItem obj
 
aDatabasedb
 
- Protected Member Functions inherited from aObject
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.
 
virtual QString trSysName (const QString &sname)
 Not implemented. More...
 
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...
 

Detailed Description

Object for working with information register in database. Using for provide between database tables and wobjects or ananas scripts

Constructor & Destructor Documentation

◆ aIRegister() [1/2]

aIRegister::aIRegister ( aCfgItem  context,
aDatabase adb = 0 
)

Create object aIRegister by ananas configuration object.

New object initing by md ojbect

Parameters
context- md object used for initing aDocument
adb- ananas database for working

References initObject().

◆ aIRegister() [2/2]

aIRegister::aIRegister ( const QString &  name,
aDatabase adb = 0,
const QString &  type = "InfoRegister." 
)

Create object aIRegister by information register metadata name.

New object initing by md ojbect with some name. Use for creating object if you know it's name.

Parameters
name- md name of document
adb- ananas database for working
type- ananas database for working

References initObject().

Member Function Documentation

◆ deleteDocument()

bool aIRegister::deleteDocument ( aDocument doc)
virtual

Delete all record with document id from all information registers.

Parameters
doc- document to delete.
Returns
true - ok, false - error

Reimplemented in aARegister.

References aCfg::attr(), aDatabase::cfg, aCfg::count(), aDatabase::db(), aCfg::find(), aObject::getUid(), aObject::setLastError(), and aDatabase::tableDbName().

Referenced by aDocument::SignOut().

◆ deleteTable()

bool aIRegister::deleteTable ( Q_ULLONG  iddt)
virtual

Removes records with given table id.

Parameters
iddt- table id.
Returns
true - ok, false - error

References aCfg::attr(), aDatabase::cfg, aCfg::count(), aDatabase::db(), aCfg::find(), aObject::setLastError(), and aDatabase::tableDbName().

Referenced by aDocument::TableDelete().

◆ GetDocument

aDocument * aIRegister::GetDocument ( )
virtualslot

Gets document.

Returns
Document pointer

References aCfg::find(), aDocument::select(), aDataTable::sysValue(), aObject::table(), and aDatabase::uidType().

◆ initObject()

ERR_Code aIRegister::initObject ( )
virtual

Initing this object by information registr from metadata object.

Returns
Error code

Reimplemented from aObject.

Reimplemented in aARegister.

References aObject::initObject(), aDatabase::tableDbName(), and aObject::tableInsert().

Referenced by aIRegister(), and aARegister::initObject().

◆ New

int aIRegister::New ( )
virtualslot

◆ Select [1/2]

int aIRegister::Select ( const QString &  from,
const QString &  to 
)
virtualslot

Selects records for date interval.

Returns
Error code
See also
Select( QDateTime from, QDateTime to )

References aLog::print().

◆ Select [2/2]

int aIRegister::Select ( QDateTime  from,
QDateTime  to 
)
virtualslot

Selects records for period.

Parameters
from- Period begin date
to- Period end date
Returns
Error code

References aObject::IsFiltred(), aObject::setSelected(), and aObject::table().

◆ SelectByDoc

int aIRegister::SelectByDoc ( )
virtualslot
Returns
Error code

References aObject::getUid(), and aObject::table().

◆ SetDocument

int aIRegister::SetDocument ( aDocument doc)
virtualslot

Sets document.

Parameters
doc- Reference to documetn.
Returns
Error code
See also
New()

References aObject::getUid(), and SetFilter().

◆ SetFilter

int aIRegister::SetFilter ( const QString &  name,
const QVariant &  value 
)
virtualslot

Sets filter.

Parameters
name- Field name.
value- Field value.
Returns
Error code

References aCfg::find(), and aObject::SetFilter().

Referenced by SetDocument().

◆ SetTable

int aIRegister::SetTable ( const QString &  tblname)
virtualslot

Sets table.

Parameters
tblname- Table name.
Returns
Error code

◆ Value

QVariant aIRegister::Value ( const QString &  name,
const QString &  tableName = "" 
)
virtualslot

Return field value with name = name of the primary object database table.

Parameters
name- field name
Returns
field value

References aObject::Value().


The documentation for this class was generated from the following files: