Ananas Library  0.9.5
adocjournal.h
1 /****************************************************************************
2 ** $Id: adocjournal.h,v 1.31 2006/08/23 07:51:09 app Exp $
3 **
4 ** Documents journal metadata object header file of
5 ** Ananas application library
6 **
7 ** Created : 20040701
8 **
9 ** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
10 ** Copyright (C) Andrey Paskal <app at lrn dot ru>, Yoshkar-Ola
11 **
12 ** This file is part of the Designer application of the Ananas
13 ** automation accounting system.
14 **
15 ** This file may be distributed and/or modified under the terms of the
16 ** GNU General Public License version 2 as published by the Free Software
17 ** Foundation and appearing in the file LICENSE.GPL included in the
18 ** packaging of this file.
19 **
20 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
21 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 **
23 ** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
24 ** See http://www.leaderit.ru/gpl/ for GPL licensing information.
25 **
26 ** Contact org@leaderit.ru if any conditions of this licensing are
27 ** not clear to you.
28 **
29 **********************************************************************/
30 
31 #ifndef ADOCJOURNAL_H
32 #define ADOCJOURNAL_H
33 
34 #include <qdatetime.h>
35 #include "acfg.h"
36 #include "aobject.h"
37 #include "adocument.h"
38 
39 class aDatabase;
40 
41 
42 
58 class ANANAS_EXPORT aDocJournal :public aObject
59 {
60  Q_OBJECT
61 private:
68  int journalType;
69 public:
70  aDocJournal(aCfgItem context, aDatabase * adb = 0);
71  aDocJournal( const QString & name, aDatabase * adb = 0);
72  aDocJournal( aDatabase * adb = 0);
73  virtual ERR_Code initObject();
74  ERR_Code selectDocument( Q_ULLONG idd );
75  virtual Q_ULLONG docId();
76  int docType();
77 
84  int type() { return journalType; }
85  QString nextNumber( const QString &prefix, int mdId );
86  QVariant getDate();
87  QString getNumber();
88  // may be need return ULongLong ?
89  int getSerialNumber();
90  ERR_Code setDate( QVariant date );
91  ERR_Code setNumber( QVariant number );
92 
93  virtual ERR_Code New ( Q_ULLONG idd, const QString & docPrefix, int type );
94  virtual ERR_Code deleteDocument ( Q_ULLONG idd );
95  Q_ULLONG findDocument( Q_ULLONG idd );
96 // Q_ULLONG docId( Q_ULLONG id );
97  Q_ULLONG findDoc( const QString & num, int type );
98  QString getPrefix();
99  QString selectionFilter( QDateTime from, QDateTime to, const QString & mdName = "",
100  bool full=false );
101  QString selectionFilter( const QString & num, const QString & mdName = "", bool full=false );
102 
103 public slots:
104  aDocument* CurrentDocument();
105  virtual ERR_Code Delete();
106  virtual ERR_Code Select( QDateTime from, QDateTime to, const QString & mdName = "" );
107  virtual ERR_Code Select( const QString & num, const QString & mdName = "" );
108 };
109 
110 #endif// ADOCJOURNAL_H
Определяет программный интерфейс для работы с бизнес объектами типа Документ и их атрибутами...
Definition: adocument.h:62
virtual Q_ULLONG docId()
Возвращает id документа в базе данных.
Definition: aobject.cpp:842
virtual ERR_Code initObject()
Инициализирует объект при его создании.
Definition: aobject.cpp:253
int type()
Definition: adocjournal.h:84
virtual int Delete()
Удаляет текущий объект из базы данных.
Definition: aobject.cpp:692
virtual int New()
Add new object record in database.
Definition: aobject.cpp:625
Определяет программный интерфейс управления общим (системным) журналом документов. Наследует aObject.
Definition: adocjournal.h:58
Класс для работы с СУБД. Ananas Data Abstraction Layer. Наследует QObject.
Definition: adatabase.h:77
Базовый класс для невизуальных классов (моделей в терминологии MVC) Ананаса, которым необходим доступ...
Definition: aobject.h:63