-
Notifications
You must be signed in to change notification settings - Fork 0
/
tinformer.h
executable file
·69 lines (54 loc) · 1.7 KB
/
tinformer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef TINFORMER_H
#define TINFORMER_H
//#include <QObject>
#include <QString>
//#include <QMYSQLDriver>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QStringList>
#include <QVariant>
#include "tovar.h"
#include "sql_config.h"
#include "dbf_config.h"
#include "db_translator.h"
#include "dbf_informer.h"
class Tinformer {
public:
enum DataSource { MySQL, DBF };
enum SearchMethod { tbarcode, tnomer, tname };
//Tinformer (int mode);
Tinformer ();
~Tinformer ();
bool prepare(SqlConfig *sql);
bool prepare(DbfConfig *dbf);
bool set_fields(dbTranslator *rows);
bool set_tb_name(QString tbName);
int get_maximum();
QList<Tovar> info (QString text, QString method = "tbarcode",
int startPos = 0, int endPos = -1, int limit = 0,
bool FromStartToEnd = true, bool AllowFastSearch = true);
QList<Tovar> check_line_prices (QList<Tovar> inputList);
int last_found_record_number();
QStringList db_describe();
QStringList tb_describe(QString tbName);
void set_limit_search(int number);
private:
QSqlDatabase db;
DataSource datasource;
bool db_is_ready;
bool tb_is_ready;
SqlConfig *sqlDB;
DbfConfig *dbfDB;
QString values_to_select; // список полей для селекта из mysql
dbTranslator* fields; //для понимания полей SQLтаблицы
dbf_informer* dbf_info; //класс для работы с DBF-файлами
int limit_search; //ограничение поиска
int last_record;
//public slots:
/*
public slots:
bool is_valid();
Tovar info(QString barcode, int method);
*/
};
#endif // TINFORMER_H