Subversion Repositories OpenInventory

Rev

Rev 6 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 17
Line 15... Line 15...
15
QStringList addmemoryForm::getManufacturiesList(){
15
QStringList addmemoryForm::getManufacturiesList(){
16
        QStringList mnfctrlist;
16
        QStringList mnfctrlist;
17
        QString mnfctSqlText, tmp;
17
        QString mnfctSqlText, tmp;
18
        QSqlQuery qproiz;
18
        QSqlQuery qproiz;
19
        int field_proizvoditel;
19
        int field_proizvoditel;
20
        mnfctSqlText = tr("select * from an_db.proizvoditeli_pamyati");
20
        mnfctSqlText = tr("select * from proizvoditeli_pamyati");
21
//      QSqlQuery qns(tr("SET NAMES utf8"));
21
//      QSqlQuery qns(tr("SET NAMES utf8"));
22
        qproiz.prepare(mnfctSqlText);
22
        qproiz.prepare(mnfctSqlText);
23
        qproiz.exec();
23
        qproiz.exec();
24
//      QSqlQuery qproiz("SELECT * FROM an_db.Ïðîèçâîäèòåëè_ïàìÿòè");
24
//      QSqlQuery qproiz("SELECT * FROM Ïðîèçâîäèòåëè_ïàìÿòè");
25
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
25
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
26
        mnfctrlist.clear();
26
        mnfctrlist.clear();
27
        while (qproiz.next()){
27
        while (qproiz.next()){
28
                tmp = qproiz.value(field_proizvoditel).toString();
28
                tmp = qproiz.value(field_proizvoditel).toString();
29
//      comboBox->addItem(tmp);
29
//      comboBox->addItem(tmp);
Line 37... Line 37...
37
QStringList addmemoryForm::getManufacturiesListVIDEO(){
37
QStringList addmemoryForm::getManufacturiesListVIDEO(){
38
        QStringList mnfctrlist;
38
        QStringList mnfctrlist;
39
        QString mnfctSqlText, tmp;
39
        QString mnfctSqlText, tmp;
40
        QSqlQuery qproiz;
40
        QSqlQuery qproiz;
41
        int field_proizvoditel;
41
        int field_proizvoditel;
42
        mnfctSqlText = tr("select * from an_db.proizvoditeli_video");
42
        mnfctSqlText = tr("select * from proizvoditeli_video");
43
//      QSqlQuery qns(tr("SET NAMES utf8"));
43
//      QSqlQuery qns(tr("SET NAMES utf8"));
44
        qproiz.prepare(mnfctSqlText);
44
        qproiz.prepare(mnfctSqlText);
45
        qproiz.exec();
45
        qproiz.exec();
46
//      QSqlQuery qproiz("SELECT * FROM an_db.Ïðîèçâîäèòåëè_ïàìÿòè");
46
//      QSqlQuery qproiz("SELECT * FROM Ïðîèçâîäèòåëè_ïàìÿòè");
47
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
47
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
48
        mnfctrlist.clear();
48
        mnfctrlist.clear();
49
        while (qproiz.next()){
49
        while (qproiz.next()){
50
                tmp = qproiz.value(field_proizvoditel).toString();
50
                tmp = qproiz.value(field_proizvoditel).toString();
51
//      comboBox->addItem(tmp);
51
//      comboBox->addItem(tmp);
Line 61... Line 61...
61
QStringList addmemoryForm::getManufacturiesListMB(){
61
QStringList addmemoryForm::getManufacturiesListMB(){
62
        QStringList mnfctrlist;
62
        QStringList mnfctrlist;
63
        QString mnfctSqlText, tmp;
63
        QString mnfctSqlText, tmp;
64
        QSqlQuery qproiz;
64
        QSqlQuery qproiz;
65
        int field_proizvoditel;
65
        int field_proizvoditel;
66
        mnfctSqlText = tr("select * from an_db.proizvoditeli_mb");
66
        mnfctSqlText = tr("select * from proizvoditeli_mb");
67
//      QSqlQuery qns(tr("SET NAMES utf8"));
67
//      QSqlQuery qns(tr("SET NAMES utf8"));
68
        qproiz.prepare(mnfctSqlText);
68
        qproiz.prepare(mnfctSqlText);
69
        qproiz.exec();
69
        qproiz.exec();
70
//      QSqlQuery qproiz("SELECT * FROM an_db.Ïðîèçâîäèòåëè_ïàìÿòè");
70
//      QSqlQuery qproiz("SELECT * FROM Ïðîèçâîäèòåëè_ïàìÿòè");
71
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
71
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
72
        mnfctrlist.clear();
72
        mnfctrlist.clear();
73
        while (qproiz.next()){
73
        while (qproiz.next()){
74
                tmp = qproiz.value(field_proizvoditel).toString();
74
                tmp = qproiz.value(field_proizvoditel).toString();
75
//      comboBox->addItem(tmp);
75
//      comboBox->addItem(tmp);
Line 83... Line 83...
83
QStringList addmemoryForm::getManufacturiesListHDD(){
83
QStringList addmemoryForm::getManufacturiesListHDD(){
84
        QStringList mnfctrlist;
84
        QStringList mnfctrlist;
85
        QString mnfctSqlText, tmp;
85
        QString mnfctSqlText, tmp;
86
        QSqlQuery qproiz;
86
        QSqlQuery qproiz;
87
        int field_proizvoditel;
87
        int field_proizvoditel;
88
        mnfctSqlText = tr("select * from an_db.proizvoditeli_hdd");
88
        mnfctSqlText = tr("select * from proizvoditeli_hdd");
89
//      QSqlQuery qns(tr("SET NAMES utf8"));
89
//      QSqlQuery qns(tr("SET NAMES utf8"));
90
        qproiz.prepare(mnfctSqlText);
90
        qproiz.prepare(mnfctSqlText);
91
        qproiz.exec();
91
        qproiz.exec();
92
//      QSqlQuery qproiz("SELECT * FROM an_db.Ïðîèçâîäèòåëè_ïàìÿòè");
92
//      QSqlQuery qproiz("SELECT * FROM Ïðîèçâîäèòåëè_ïàìÿòè");
93
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
93
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
94
        mnfctrlist.clear();
94
        mnfctrlist.clear();
95
        while (qproiz.next()){
95
        while (qproiz.next()){
96
                tmp = qproiz.value(field_proizvoditel).toString();
96
                tmp = qproiz.value(field_proizvoditel).toString();
97
//      comboBox->addItem(tmp);
97
//      comboBox->addItem(tmp);
Line 104... Line 104...
104
QStringList addmemoryForm::getManufacturiesListCPU(){
104
QStringList addmemoryForm::getManufacturiesListCPU(){
105
        QStringList mnfctrlist;
105
        QStringList mnfctrlist;
106
        QString mnfctSqlText, tmp;
106
        QString mnfctSqlText, tmp;
107
        QSqlQuery qproiz;
107
        QSqlQuery qproiz;
108
        int field_proizvoditel;
108
        int field_proizvoditel;
109
        mnfctSqlText = tr("select * from an_db.proizvoditeli_cpu");
109
        mnfctSqlText = tr("select * from proizvoditeli_cpu");
110
//      QSqlQuery qns(tr("SET NAMES utf8"));
110
//      QSqlQuery qns(tr("SET NAMES utf8"));
111
        qproiz.prepare(mnfctSqlText);
111
        qproiz.prepare(mnfctSqlText);
112
        qproiz.exec();
112
        qproiz.exec();
113
//      QSqlQuery qproiz("SELECT * FROM an_db.Ïðîèçâîäèòåëè_ïàìÿòè");
113
//      QSqlQuery qproiz("SELECT * FROM Ïðîèçâîäèòåëè_ïàìÿòè");
114
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
114
        field_proizvoditel = qproiz.record().indexOf(tr("Ïðîèçâîäèòåëü"));
115
        mnfctrlist.clear();
115
        mnfctrlist.clear();
116
        while (qproiz.next()){
116
        while (qproiz.next()){
117
                tmp = qproiz.value(field_proizvoditel).toString();
117
                tmp = qproiz.value(field_proizvoditel).toString();
118
//      comboBox->addItem(tmp);
118
//      comboBox->addItem(tmp);
Line 127... Line 127...
127
QStringList addmemoryForm::getModelListMB(QString proizvoditel){
127
QStringList addmemoryForm::getModelListMB(QString proizvoditel){
128
        QStringList modelList;
128
        QStringList modelList;
129
        QString SqlText, tmp;
129
        QString SqlText, tmp;
130
        QSqlQuery qmodel;
130
        QSqlQuery qmodel;
131
        int field_model;
131
        int field_model;
132
        SqlText = tr("select * from an_db.Ìîäåëè_ìàòåðèíñêèõ_ïëàò where an_db.Ìîäåëè_ìàòåðèíñêèõ_ïëàò.Ïðîèçâîäèòåëü = \"");
132
        SqlText = tr("select * from Ìîäåëè_ìàòåðèíñêèõ_ïëàò where Ìîäåëè_ìàòåðèíñêèõ_ïëàò.Ïðîèçâîäèòåëü = \"");
133
        SqlText.append(proizvoditel);
133
        SqlText.append(proizvoditel);
134
        SqlText.append(tr("\""));
134
        SqlText.append(tr("\""));
135
        qmodel.prepare(SqlText);
135
        qmodel.prepare(SqlText);
136
        qmodel.exec();
136
        qmodel.exec();
137
        field_model = qmodel.record().indexOf(tr("Ìîäåëü"));
137
        field_model = qmodel.record().indexOf(tr("Ìîäåëü"));
Line 150... Line 150...
150
QStringList addmemoryForm::getModelListVIDEO(QString proizvoditel){
150
QStringList addmemoryForm::getModelListVIDEO(QString proizvoditel){
151
        QStringList modelList;
151
        QStringList modelList;
152
        QString SqlText, tmp;
152
        QString SqlText, tmp;
153
        QSqlQuery qmodel;
153
        QSqlQuery qmodel;
154
        int field_model;
154
        int field_model;
155
        SqlText = tr("select * from an_db.video_models where an_db.video_models.Ïðîèçâîäèòåëü = \"");
155
        SqlText = tr("select * from video_models where video_models.Ïðîèçâîäèòåëü = \"");
156
        SqlText.append(proizvoditel);
156
        SqlText.append(proizvoditel);
157
        SqlText.append(tr("\""));
157
        SqlText.append(tr("\""));
158
        qmodel.prepare(SqlText);
158
        qmodel.prepare(SqlText);
159
        qmodel.exec();
159
        qmodel.exec();
160
        field_model = qmodel.record().indexOf(tr("Ìîäåëü"));
160
        field_model = qmodel.record().indexOf(tr("Ìîäåëü"));
Line 173... Line 173...
173
QStringList addmemoryForm::getModelListCPU(QString proizvoditel){
173
QStringList addmemoryForm::getModelListCPU(QString proizvoditel){
174
        QStringList modelList;
174
        QStringList modelList;
175
        QString SqlText, tmp;
175
        QString SqlText, tmp;
176
        QSqlQuery qmodel;
176
        QSqlQuery qmodel;
177
        int field_model;
177
        int field_model;
178
        SqlText = tr("select * from an_db.processor_models where an_db.processor_models.Ïðîèçâîäèòåëü = \"");
178
        SqlText = tr("select * from processor_models where processor_models.Ïðîèçâîäèòåëü = \"");
179
        SqlText.append(proizvoditel);
179
        SqlText.append(proizvoditel);
180
        SqlText.append(tr("\""));
180
        SqlText.append(tr("\""));
181
        qmodel.prepare(SqlText);
181
        qmodel.prepare(SqlText);
182
        qmodel.exec();
182
        qmodel.exec();
183
        field_model = qmodel.record().indexOf(tr("Ìîäåëü"));
183
        field_model = qmodel.record().indexOf(tr("Ìîäåëü"));
Line 195... Line 195...
195
QStringList addmemoryForm::getSystemBlockList(){
195
QStringList addmemoryForm::getSystemBlockList(){
196
        QStringList sysBlockList;
196
        QStringList sysBlockList;
197
        bool b1, b2;
197
        bool b1, b2;
198
        QString tmp, SerialNum, InventarNum, DataPokypki, SrokGarantii, UserId, Identifikator;
198
        QString tmp, SerialNum, InventarNum, DataPokypki, SrokGarantii, UserId, Identifikator;
199
        int field_identifikator, field_serial_num, field_inventar_num, field_data_pokypki, field_srok_garantii, field_user_id;
199
        int field_identifikator, field_serial_num, field_inventar_num, field_data_pokypki, field_srok_garantii, field_user_id;
200
        QSqlQuery qysBlockList(tr("select * from an_db.system_blocks"));
200
        QSqlQuery qysBlockList(tr("select * from system_blocks"));
201
        field_serial_num = qysBlockList.record().indexOf(tr("Ñåðèéíûé_íîìåð"));
201
        field_serial_num = qysBlockList.record().indexOf(tr("Ñåðèéíûé_íîìåð"));
202
        field_inventar_num = qysBlockList.record().indexOf(tr("Èíâåíòàðíûé_íîìåð"));
202
        field_inventar_num = qysBlockList.record().indexOf(tr("Èíâåíòàðíûé_íîìåð"));
203
        field_data_pokypki = qysBlockList.record().indexOf(tr("Äàòà_ïîêóïêè"));
203
        field_data_pokypki = qysBlockList.record().indexOf(tr("Äàòà_ïîêóïêè"));
204
        field_srok_garantii = qysBlockList.record().indexOf(tr("Ñðîê_ãàðàíòèè"));
204
        field_srok_garantii = qysBlockList.record().indexOf(tr("Ñðîê_ãàðàíòèè"));
205
        field_user_id = qysBlockList.record().indexOf(tr("Èäåíòèôèêàòîð_îòâåòñòâåííîãî_ëèöà"));
205
        field_user_id = qysBlockList.record().indexOf(tr("Èäåíòèôèêàòîð_îòâåòñòâåííîãî_ëèöà"));
Line 235... Line 235...
235
QString addmemoryForm::getUserInfo(QString userID){
235
QString addmemoryForm::getUserInfo(QString userID){
236
        QString rslt, tmp, sqlQueryText;
236
        QString rslt, tmp, sqlQueryText;
237
        QString identifikator_polzovatela, fio_polzovatela, identifikator_otdela;
237
        QString identifikator_polzovatela, fio_polzovatela, identifikator_otdela;
238
        int field_identifikator, field_fio, field_id_otdela;
238
        int field_identifikator, field_fio, field_id_otdela;
239
        QSqlQuery qSqlUserInfo;
239
        QSqlQuery qSqlUserInfo;
240
        sqlQueryText = tr("select * from an_db.Ñîòðóäíèêè where Èäåíòèôèêàòîð = ");
240
        sqlQueryText = tr("select * from Ñîòðóäíèêè where Èäåíòèôèêàòîð = ");
241
        sqlQueryText.append(userID);
241
        sqlQueryText.append(userID);
242
        qSqlUserInfo.prepare(sqlQueryText);
242
        qSqlUserInfo.prepare(sqlQueryText);
243
        qSqlUserInfo.exec();
243
        qSqlUserInfo.exec();
244
        field_identifikator = qSqlUserInfo.record().indexOf(tr("Èäåíòèôèêàòîð"));
244
        field_identifikator = qSqlUserInfo.record().indexOf(tr("Èäåíòèôèêàòîð"));
245
        field_fio = qSqlUserInfo.record().indexOf(tr("ÔÈÎ"));
245
        field_fio = qSqlUserInfo.record().indexOf(tr("ÔÈÎ"));
Line 264... Line 264...
264
264
265
QString addmemoryForm::getOtdelName(QString otdelID){
265
QString addmemoryForm::getOtdelName(QString otdelID){
266
        QString otdel, sqlText, tmp;
266
        QString otdel, sqlText, tmp;
267
        QSqlQuery query;
267
        QSqlQuery query;
268
        int field_name;
268
        int field_name;
269
        sqlText = (tr("select an_db.Îòäåëû.Íàçâàíèå from an_db.Îòäåëû where Èäåíòèôèêàòîð = "));
269
        sqlText = (tr("select Îòäåëû.Íàçâàíèå from Îòäåëû where Èäåíòèôèêàòîð = "));
270
        sqlText.append(otdelID);
270
        sqlText.append(otdelID);
271
        query.prepare(sqlText);
271
        query.prepare(sqlText);
272
        query.exec();
272
        query.exec();
273
        field_name = query.record().indexOf(tr("Íàçâàíèå"));
273
        field_name = query.record().indexOf(tr("Íàçâàíèå"));
274
        tmp="";
274
        tmp="";