modifiche cristina al 4/9/1996
git-svn-id: svn://10.65.10.50/trunk@3512 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
1942d8fcb4
commit
ca0ec635c3
160
at/at0100a.h
Executable file
160
at/at0100a.h
Executable file
@ -0,0 +1,160 @@
|
|||||||
|
// definizione campi della maschera at0100a.msk
|
||||||
|
// SOGGETTI e dati collegati
|
||||||
|
|
||||||
|
// pagina 1
|
||||||
|
#define F_CODICE 101
|
||||||
|
#define F_COGNOME 102
|
||||||
|
#define F_NOME 103
|
||||||
|
#define F_DATANASC 104
|
||||||
|
#define F_CODSEZ 105
|
||||||
|
#define F_DENSEZ 106
|
||||||
|
#define F_CODSOT 107
|
||||||
|
#define F_DENSOT 108
|
||||||
|
#define F_CATDON 109
|
||||||
|
#define F_DESC_CATDON 110
|
||||||
|
#define F_DATAISC 111
|
||||||
|
#define F_DATADIM 112
|
||||||
|
#define F_COMNASC 113
|
||||||
|
#define F_DENCOMNASC 114
|
||||||
|
#define F_PROVCOMNASC 115
|
||||||
|
#define F_INDIRIZZO 116
|
||||||
|
#define F_COM 117
|
||||||
|
#define F_DENCOM 118
|
||||||
|
#define F_CAPCOM 119
|
||||||
|
#define F_PROVCOM 120
|
||||||
|
#define F_LOCALITA 121
|
||||||
|
#define F_DENLOC 122
|
||||||
|
#define F_TELABI 123
|
||||||
|
#define F_TELLAV 124
|
||||||
|
#define F_TELALT 125
|
||||||
|
#define F_SESSO 126
|
||||||
|
#define F_DATAULTAGG 127
|
||||||
|
#define F_UTENULTAGG 128
|
||||||
|
|
||||||
|
// pagina 2
|
||||||
|
#define F_CATNOND1 201
|
||||||
|
#define F_DESC_CATNOND1 202
|
||||||
|
#define F_CATNOND2 203
|
||||||
|
#define F_DESC_CATNOND2 204
|
||||||
|
#define F_TITINDIR 205
|
||||||
|
#define F_TESSAVIS 206
|
||||||
|
#define F_CODCT 207
|
||||||
|
#define F_CODCL 208
|
||||||
|
#define F_TESSSSN 209
|
||||||
|
#define F_DOCID 210
|
||||||
|
#define F_CF 211
|
||||||
|
#define F_CONDOCC 212
|
||||||
|
#define F_POSPROF 213
|
||||||
|
#define F_RAMOATT 214
|
||||||
|
#define F_TITSTUD 215
|
||||||
|
#define F_PROFESS 216
|
||||||
|
#define F_DESC_PROF 217
|
||||||
|
#define F_LUOGOLAV 218
|
||||||
|
#define F_DESC_LUOGO 219
|
||||||
|
|
||||||
|
// pagina 3
|
||||||
|
#define F_STATO 301
|
||||||
|
#define F_DESCSTATO 302
|
||||||
|
#define F_DATASTATO 303
|
||||||
|
#define F_IDON1 304
|
||||||
|
#define F_DESC_ID1 305
|
||||||
|
#define F_IDON2 306
|
||||||
|
#define F_DESC_ID2 307
|
||||||
|
#define F_IDON3 308
|
||||||
|
#define F_DESC_ID3 309
|
||||||
|
#define F_IDON4 310
|
||||||
|
#define F_DESC_ID4 311
|
||||||
|
#define F_DATAULTID 312
|
||||||
|
#define F_TIPOULTID 313
|
||||||
|
#define F_INTSI 314
|
||||||
|
#define F_INTAF 315
|
||||||
|
#define F_TOTDON 316
|
||||||
|
#define F_DATAULTDON 317
|
||||||
|
#define F_TIPOULTDON 318
|
||||||
|
#define F_DESC_ULTDON 319
|
||||||
|
#define F_DATAPROSSI 320
|
||||||
|
#define F_DATAPROSAF 321
|
||||||
|
#define F_DATAULTSI 322
|
||||||
|
#define F_DATAULTAF 323
|
||||||
|
#define F_TOTDONSI 324
|
||||||
|
#define F_TOTDONAF 325
|
||||||
|
|
||||||
|
|
||||||
|
// pagina 4
|
||||||
|
#define F_GRUPPOAB0 401
|
||||||
|
#define F_RHANTID 402
|
||||||
|
#define F_KELL 403
|
||||||
|
#define F_FENOTIPORH 404
|
||||||
|
#define F_DU 405
|
||||||
|
#define F_MODCONV 406
|
||||||
|
#define F_GIOPREDON 407
|
||||||
|
#define F_GIOPRECON 408
|
||||||
|
#define F_ESCLUSO 409
|
||||||
|
#define F_TERMESCL 410
|
||||||
|
#define F_MOTESCL 411
|
||||||
|
#define F_CODMED 412
|
||||||
|
#define F_COGNMED 413
|
||||||
|
#define F_NOMMED 414
|
||||||
|
|
||||||
|
// pagina 5
|
||||||
|
#define F_DONAZIONI 501
|
||||||
|
|
||||||
|
// pagina 6
|
||||||
|
#define F_CONTROLLI 601
|
||||||
|
|
||||||
|
// pagina 7
|
||||||
|
#define F_BENEMERENZE 701
|
||||||
|
#define F_STORICO 702
|
||||||
|
|
||||||
|
// bottoni personalizzati per l'applicazione
|
||||||
|
#define DLG_GENDON 801
|
||||||
|
|
||||||
|
// pagina donazioni
|
||||||
|
#define F_D_DATADON 101
|
||||||
|
#define F_D_TIPODON 102
|
||||||
|
#define F_D_LUOGODON 103
|
||||||
|
#define F_D_ETICHETTA 104
|
||||||
|
#define F_D_CC 105
|
||||||
|
#define F_D_PA 106
|
||||||
|
#define F_D_HB 107
|
||||||
|
#define F_D_SGPT 108
|
||||||
|
#define F_D_PROTIDEMIA 109
|
||||||
|
//#define F_D_PRIMADON 110
|
||||||
|
#define F_D_DESC_TIPODON 211
|
||||||
|
#define F_D_DESC_LUOGODON 212
|
||||||
|
|
||||||
|
// pagina controlli sanitari
|
||||||
|
#define F_C_DATACON 101
|
||||||
|
#define F_C_TIPOCON 102
|
||||||
|
#define F_C_IDON1 103
|
||||||
|
#define F_C_IDON2 104
|
||||||
|
#define F_C_IDON3 105
|
||||||
|
#define F_C_IDON4 106
|
||||||
|
#define F_C_INTSI 107
|
||||||
|
#define F_C_INTAF 108
|
||||||
|
#define F_C_PROSSTIPO 109
|
||||||
|
#define F_C_PROSSDATA 110
|
||||||
|
#define F_C_DESC_TIPOCON 211
|
||||||
|
#define F_C_DESC_IDON1 212
|
||||||
|
#define F_C_DESC_IDON2 213
|
||||||
|
#define F_C_DESC_IDON3 214
|
||||||
|
#define F_C_DESC_IDON4 215
|
||||||
|
#define F_C_DESC_PROSSTIPO 216
|
||||||
|
|
||||||
|
// pagina benemerenze
|
||||||
|
#define F_B_TIPOBEN 101
|
||||||
|
#define F_B_DATABEN 102
|
||||||
|
#define F_B_RITIRATA 103
|
||||||
|
#define F_B_DESC_TIPOBEN 211
|
||||||
|
|
||||||
|
// pagina storico iscrizioni e dimissioni
|
||||||
|
#define F_S_DATAISC 101
|
||||||
|
#define F_S_DATADIM 102
|
||||||
|
#define F_S_CODSEZ 103
|
||||||
|
#define F_S_CODSOT 104
|
||||||
|
#define F_S_CATISC 105
|
||||||
|
#define F_S_MOTDIM 106
|
||||||
|
#define F_S_DENSEZ 211
|
||||||
|
#define F_S_DENSOT 212
|
||||||
|
#define F_S_DESC_CATISC 213
|
||||||
|
|
@ -1,7 +1,14 @@
|
|||||||
#include "at0100.h"
|
#include "at0100a.h"
|
||||||
#include "lf.h"
|
#include "lf.h"
|
||||||
|
|
||||||
TOOLBAR "" 0 20 0 2
|
TOOLBAR "" 0 20 0 2
|
||||||
|
|
||||||
|
BUTTON DLG_GENDON 25 1
|
||||||
|
BEGIN
|
||||||
|
PROMPT -13 -3 "Genera donazioni"
|
||||||
|
MESSAGE K_F10
|
||||||
|
END
|
||||||
|
|
||||||
#include <toolbar.h>
|
#include <toolbar.h>
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
@ -926,7 +933,7 @@ BEGIN
|
|||||||
DISPLAY "Nome@25" NOME
|
DISPLAY "Nome@25" NOME
|
||||||
DISPLAY "Codice" CODMED
|
DISPLAY "Codice" CODMED
|
||||||
COPY OUTPUT F_CODMED
|
COPY OUTPUT F_CODMED
|
||||||
CHECKTYPE NORMAL
|
CHECKTYPE SEARCH
|
||||||
HELP "Medico di base"
|
HELP "Medico di base"
|
||||||
WARNING "Medico assente"
|
WARNING "Medico assente"
|
||||||
ADD MASK at0800a
|
ADD MASK at0800a
|
||||||
@ -937,7 +944,7 @@ BEGIN
|
|||||||
PROMPT 48 9 ""
|
PROMPT 48 9 ""
|
||||||
USE LF_MEDICI KEY 2
|
USE LF_MEDICI KEY 2
|
||||||
INPUT COGNOME F_COGNMED
|
INPUT COGNOME F_COGNMED
|
||||||
INPUT NOME F_NOMNMED
|
INPUT NOME F_NOMMED
|
||||||
DISPLAY "Cognome@25" COGNOME
|
DISPLAY "Cognome@25" COGNOME
|
||||||
DISPLAY "Nome@25" NOME
|
DISPLAY "Nome@25" NOME
|
||||||
DISPLAY "Codice" CODMED
|
DISPLAY "Codice" CODMED
|
||||||
@ -1466,7 +1473,7 @@ BEGIN
|
|||||||
DISPLAY "Descrizione@30" S0
|
DISPLAY "Descrizione@30" S0
|
||||||
OUTPUT F_C_PROSSTIPO CODTAB
|
OUTPUT F_C_PROSSTIPO CODTAB
|
||||||
OUTPUT F_C_DESC_PROSSTIPO S0
|
OUTPUT F_C_DESC_PROSSTIPO S0
|
||||||
CHECKTYPE REQUIRED
|
CHECKTYPE NORMAL
|
||||||
WARNING "Codice non presente"
|
WARNING "Codice non presente"
|
||||||
HELP "Tipo/Esito controllo sanitario"
|
HELP "Tipo/Esito controllo sanitario"
|
||||||
END
|
END
|
||||||
|
@ -44,14 +44,14 @@ protected:
|
|||||||
virtual TMask& get_mask() { return *_msk; }
|
virtual TMask& get_mask() { return *_msk; }
|
||||||
virtual TRelation* get_relation() const { return _rel; }
|
virtual TRelation* get_relation() const { return _rel; }
|
||||||
|
|
||||||
virtual TAssoc_array& get_array_sogg() { return *_asoggetti; }
|
TAssoc_array& get_array_sogg() { return *_asoggetti; }
|
||||||
virtual int write(TSheet_field& s);
|
int write(TSheet_field& s);
|
||||||
|
|
||||||
static bool check_sog_sheet(const char* codsog);
|
bool check_sog_sheet(const char* codsog);
|
||||||
//static bool codice_handler(TMask_field& f, KEY k);
|
|
||||||
static bool nome_handler(TMask_field& f, KEY k);
|
static bool nome_handler(TMask_field& f, KEY k);
|
||||||
|
static bool codice_handler(TMask_field& f, KEY k);
|
||||||
static bool soggetti_notify(TSheet_field& s, int r, KEY k);
|
static bool soggetti_notify(TSheet_field& s, int r, KEY k);
|
||||||
static void add_rows_soggetti(TSheet_field& s, int count = 10, int start = 1);
|
void add_rows_soggetti(TSheet_field& s, int count = 10, int start = 0);
|
||||||
static bool ins_controlli_handler(TMask_field& f, KEY k);
|
static bool ins_controlli_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -76,10 +76,10 @@ bool TDonaz_app::ins_controlli_handler(TMask_field& f, KEY k)
|
|||||||
|
|
||||||
void TDonaz_app::add_rows_soggetti(TSheet_field& s, int count, int start)
|
void TDonaz_app::add_rows_soggetti(TSheet_field& s, int count, int start)
|
||||||
{
|
{
|
||||||
if (start == 1)
|
if (start == 0)
|
||||||
s.destroy();
|
s.destroy();
|
||||||
for (int r=start; r<=start+count; r++)
|
for (int r=start; r<=start+count-1; r++)
|
||||||
TToken_string& row = s.row(r-1);
|
TToken_string& row = s.row(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TDonaz_app::create()
|
bool TDonaz_app::create()
|
||||||
@ -97,8 +97,8 @@ bool TDonaz_app::create()
|
|||||||
TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI);
|
TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI);
|
||||||
ss.set_notify(soggetti_notify);
|
ss.set_notify(soggetti_notify);
|
||||||
|
|
||||||
//ss.sheet_mask().set_handler(F_S_CODICE,codice_handler);
|
|
||||||
ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
|
ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
|
||||||
|
ss.sheet_mask().set_handler(F_S_CODICE,codice_handler);
|
||||||
|
|
||||||
dispatch_e_menu(BAR_ITEM(1));
|
dispatch_e_menu(BAR_ITEM(1));
|
||||||
|
|
||||||
@ -125,14 +125,19 @@ bool TDonaz_app::menu(MENU_TAG m)
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
TSheet_field& s = (TSheet_field&)msk.field(F_SOGGETTI);
|
TSheet_field& s = (TSheet_field&)msk.field(F_SOGGETTI);
|
||||||
add_rows_soggetti(s,12);
|
s.destroy();
|
||||||
|
add_rows_soggetti(s);
|
||||||
_asoggetti->destroy();
|
_asoggetti->destroy();
|
||||||
msk.set(F_DATADON,oggi);
|
msk.set(F_DATADON,oggi);
|
||||||
tasto = msk.run();
|
tasto = msk.run();
|
||||||
switch (tasto)
|
switch (tasto)
|
||||||
{
|
{
|
||||||
case K_ESC: // annulla
|
case K_ESC: // annulla
|
||||||
|
{
|
||||||
|
if (yesno_box("Registrare le modifiche?"))
|
||||||
|
TDonaz_app::write(s);
|
||||||
msk.reset();
|
msk.reset();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case K_SAVE: // registra
|
case K_SAVE: // registra
|
||||||
{
|
{
|
||||||
@ -146,6 +151,12 @@ bool TDonaz_app::menu(MENU_TAG m)
|
|||||||
msk.reset();
|
msk.reset();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case K_QUIT: // fine
|
||||||
|
{
|
||||||
|
if (yesno_box("Registrare le modifiche?"))
|
||||||
|
TDonaz_app::write(s);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (tasto != K_QUIT);
|
while (tasto != K_QUIT);
|
||||||
@ -447,7 +458,7 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
|
|||||||
}
|
}
|
||||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||||
{
|
{
|
||||||
add_rows_soggetti(s,10,r+1);
|
app().add_rows_soggetti(s,10,r+1);
|
||||||
s.select(r);
|
s.select(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -455,32 +466,9 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
|
|||||||
case K_CTRL+K_TAB:
|
case K_CTRL+K_TAB:
|
||||||
// uscita riga
|
// uscita riga
|
||||||
{
|
{
|
||||||
TToken_string& row = s.row(r);
|
|
||||||
const char* codice = row.get(0);
|
|
||||||
if (codice != NULL)
|
|
||||||
{
|
|
||||||
ok = check_sog_sheet(codice);
|
|
||||||
if (!ok)
|
|
||||||
return s.error_box("Soggetto già inserito");
|
|
||||||
else
|
|
||||||
// controllare che sia idoneo a quel tipo di donazione
|
|
||||||
// il controllo sull'esistenza della donazione viene fatto
|
|
||||||
// al momento della registrazione (write)
|
|
||||||
{
|
|
||||||
const long codsog = row.get_long(0);
|
|
||||||
|
|
||||||
//TLocalisamfile& sog = get_relation()->lfile();
|
|
||||||
//sog.zero();
|
|
||||||
//sog.put(SOG_CODICE, codsog);
|
|
||||||
//int err = sog.read();
|
|
||||||
//if (err == NOERR)
|
|
||||||
//{
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||||
{
|
{
|
||||||
add_rows_soggetti(s,10,r+1);
|
app().add_rows_soggetti(s,10,r+1);
|
||||||
s.select(r);
|
s.select(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -489,21 +477,25 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
bool TDonaz_app::codice_handler(TMask_field& f, KEY k)
|
bool TDonaz_app::codice_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
if (k == K_TAB && f.focusdirty() && f.get().not_empty())
|
if (k == K_TAB && f.focusdirty())
|
||||||
{
|
{
|
||||||
const TMask& m = f.mask();
|
const char* codice = f.get();
|
||||||
const char* codsog = m.get(F_S_CODICE);
|
if (codice != NULL)
|
||||||
ok = check_sog_sheet(codsog); // controllo che il sog. non sia già inserito
|
{
|
||||||
|
ok = app().check_sog_sheet(codice);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
f.error_box("Soggetto già inserito");
|
return f.error_box("Soggetto già inserito");
|
||||||
|
//else
|
||||||
|
// controllare che sia idoneo a quel tipo di donazione
|
||||||
|
// il controllo sull'esistenza della donazione viene fatto
|
||||||
|
// al momento della registrazione (write)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
bool TDonaz_app::nome_handler(TMask_field& f, KEY k)
|
bool TDonaz_app::nome_handler(TMask_field& f, KEY k)
|
||||||
{
|
{
|
||||||
@ -513,9 +505,8 @@ bool TDonaz_app::nome_handler(TMask_field& f, KEY k)
|
|||||||
TMask& m = f.mask();
|
TMask& m = f.mask();
|
||||||
long codsog = m.get_long(F_S_CODICE);
|
long codsog = m.get_long(F_S_CODICE);
|
||||||
if (codsog == 0)
|
if (codsog == 0)
|
||||||
m.send_key(K_F9,F_S_NOME);
|
f.on_key(K_F9);
|
||||||
}
|
}
|
||||||
//f.message_box("sono in nome_handler");
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,38 @@
|
|||||||
#include "lf.h"
|
#include "lf.h"
|
||||||
|
|
||||||
TOOLBAR "" 0 20 0 2
|
TOOLBAR "" 0 20 0 2
|
||||||
#include <toolbar.h>
|
|
||||||
|
BUTTON DLG_SAVEREC 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -14 -11 "~Registra"
|
||||||
|
MESSAGE EXIT,K_SAVE
|
||||||
|
PICTURE BMP_SAVEREC
|
||||||
|
PICTURE BMP_SAVERECDN
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_NEWREC 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -24 -11 "~Nuovo"
|
||||||
|
MESSAGE EXIT,K_INS
|
||||||
|
PICTURE BMP_NEWREC
|
||||||
|
PICTURE BMP_NEWRECDN
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_CANCEL 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -34 -11 "~Annulla"
|
||||||
|
MESSAGE EXIT,K_ESC
|
||||||
|
PICTURE 102
|
||||||
|
END
|
||||||
|
|
||||||
|
BUTTON DLG_QUIT 10 2
|
||||||
|
BEGIN
|
||||||
|
PROMPT -44 -11 "~Fine"
|
||||||
|
MESSAGE EXIT,K_QUIT
|
||||||
|
PICTURE BMP_QUIT
|
||||||
|
PICTURE BMP_QUITDN
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "Giornaliero donazioni/controlli" -1 -1 78 20
|
PAGE "Giornaliero donazioni/controlli" -1 -1 78 20
|
||||||
|
@ -37,6 +37,8 @@ class TPereta_application : public TPrintapp
|
|||||||
TMask* _msk;
|
TMask* _msk;
|
||||||
TEti_pereta_form* _form_eti;
|
TEti_pereta_form* _form_eti;
|
||||||
|
|
||||||
|
TAssoc_array* _categorie;
|
||||||
|
|
||||||
int _cur1, _cur2, _cur3, _cur4;
|
int _cur1, _cur2, _cur3, _cur4;
|
||||||
TParagraph_string _cognome_nome, _dencom;
|
TParagraph_string _cognome_nome, _dencom;
|
||||||
|
|
||||||
@ -54,9 +56,12 @@ protected:
|
|||||||
virtual bool preprocess_page (int file, int counter);
|
virtual bool preprocess_page (int file, int counter);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
void set_one_cat(short field_id);
|
||||||
|
void set_categorie();
|
||||||
|
TAssoc_array& get_categorie() { return *_categorie; }
|
||||||
void crea_intestazione();
|
void crea_intestazione();
|
||||||
void filtra_sezioni();
|
void filtra_sezioni();
|
||||||
void header_sezione(TString codsez, TString codsot);
|
void header_sezione(const char* codsez, const char* codsot);
|
||||||
TMask& app_mask() { return *_msk; }
|
TMask& app_mask() { return *_msk; }
|
||||||
|
|
||||||
TPereta_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
|
TPereta_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
|
||||||
@ -70,23 +75,27 @@ TRelation* TEti_pereta_form::relation() const { return cursor()->relation(); }
|
|||||||
|
|
||||||
void TPereta_application::filtra_sezioni()
|
void TPereta_application::filtra_sezioni()
|
||||||
{
|
{
|
||||||
TString sezini = _msk->get(F_SEZINI);
|
const char* sezini = _msk->get(F_SEZINI);
|
||||||
TString sotini = _msk->get(F_SOTINI);
|
const char* sotini = _msk->get(F_SOTINI);
|
||||||
TString sezfin = _msk->get(F_SEZFIN);
|
const char* sezfin = _msk->get(F_SEZFIN);
|
||||||
TString sotfin = _msk->get(F_SOTFIN);
|
const char* sotfin = _msk->get(F_SOTFIN);
|
||||||
select_cursor(_cur4);
|
select_cursor(_cur4);
|
||||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||||
TRectype da(fl.curr());
|
TRectype da(fl.curr());
|
||||||
TRectype a(fl.curr());
|
TRectype a(fl.curr());
|
||||||
da.zero();
|
da.zero();
|
||||||
a.zero();
|
a.zero();
|
||||||
if ((sezini.not_empty()) && (sezini.ok()))
|
//if ((sezini.not_empty()) && (sezini.ok()))
|
||||||
|
if (sezini != NULL)
|
||||||
da.put(SOG_CODSEZ, sezini);
|
da.put(SOG_CODSEZ, sezini);
|
||||||
if ((sotini.not_empty()) && (sotini.ok()))
|
//if ((sotini.not_empty()) && (sotini.ok()))
|
||||||
|
if (sotini != NULL)
|
||||||
da.put(SOG_CODSOT, sotini);
|
da.put(SOG_CODSOT, sotini);
|
||||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
//if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||||
|
if (sezfin != NULL)
|
||||||
a.put(SOG_CODSEZ, sezfin);
|
a.put(SOG_CODSEZ, sezfin);
|
||||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
//if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||||
|
if (sotfin != NULL)
|
||||||
a.put(SOG_CODSOT, sotfin);
|
a.put(SOG_CODSOT, sotfin);
|
||||||
current_cursor()->setregion(da, a);
|
current_cursor()->setregion(da, a);
|
||||||
}
|
}
|
||||||
@ -132,33 +141,11 @@ bool TPereta_application::filter_func_pereta(const TRelation * rel)
|
|||||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||||
|
|
||||||
//filtro per categorie
|
//filtro per categorie
|
||||||
|
TAssoc_array& categorie = TPereta_application::get_categorie();
|
||||||
TMask& msk = app().app_mask();
|
|
||||||
TString catpri = msk.get(F_CAT1);
|
|
||||||
TString catsec = msk.get(F_CAT2);
|
|
||||||
TString catter = msk.get(F_CAT3);
|
|
||||||
TString catqua = msk.get(F_CAT4);
|
|
||||||
TString catqui = msk.get(F_CAT5);
|
|
||||||
TString catses = msk.get(F_CAT6);
|
|
||||||
|
|
||||||
TAssoc_array categorie;
|
|
||||||
if (catpri.not_empty() && catpri.ok())
|
|
||||||
categorie.add((const char*) catpri);
|
|
||||||
if (catsec.not_empty() && catsec.ok())
|
|
||||||
categorie.add((const char*) catsec);
|
|
||||||
if (catter.not_empty() && catter.ok())
|
|
||||||
categorie.add((const char*) catter);
|
|
||||||
if (catqua.not_empty() && catqua.ok())
|
|
||||||
categorie.add((const char*) catqua);
|
|
||||||
if (catqui.not_empty() && catqui.ok())
|
|
||||||
categorie.add((const char*) catqui);
|
|
||||||
if (catses.not_empty() && catses.ok())
|
|
||||||
categorie.add((const char*) catses);
|
|
||||||
|
|
||||||
if (categorie.items() != 0)
|
if (categorie.items() != 0)
|
||||||
{
|
{
|
||||||
TString cat = sog->curr().get(SOG_CATDON);
|
const char* cat = sog->curr().get(SOG_CATDON);
|
||||||
if (categorie.is_key((const char*) cat))
|
if (categorie.is_key(cat))
|
||||||
filtrato = TRUE;
|
filtrato = TRUE;
|
||||||
else
|
else
|
||||||
filtrato = FALSE;
|
filtrato = FALSE;
|
||||||
@ -214,7 +201,6 @@ bool TPereta_application::preprocess_page(int file, int counter)
|
|||||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||||
{
|
{
|
||||||
//if (!_codsez.blank())
|
|
||||||
if (_codsez != "**")
|
if (_codsez != "**")
|
||||||
printer().formfeed();
|
printer().formfeed();
|
||||||
_codsez = codsez;
|
_codsez = codsez;
|
||||||
@ -227,8 +213,8 @@ bool TPereta_application::preprocess_page(int file, int counter)
|
|||||||
|
|
||||||
void TPereta_application::header_sezione(TString codsez, TString codsot)
|
void TPereta_application::header_sezione(TString codsez, TString codsot)
|
||||||
{
|
{
|
||||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
const char* densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||||
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
const char* densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||||
TString intestazione(132);
|
TString intestazione(132);
|
||||||
intestazione = "Sezione: ";
|
intestazione = "Sezione: ";
|
||||||
intestazione << codsez;
|
intestazione << codsez;
|
||||||
@ -255,8 +241,6 @@ bool TPereta_application::set_print(int)
|
|||||||
{
|
{
|
||||||
case F_ELENCO:
|
case F_ELENCO:
|
||||||
_tipo_stampa = elenco;
|
_tipo_stampa = elenco;
|
||||||
//_codsez.spaces(2);
|
|
||||||
//_codsot.spaces(2);
|
|
||||||
_codsez = "**";
|
_codsez = "**";
|
||||||
_codsot = "**";
|
_codsot = "**";
|
||||||
break;
|
break;
|
||||||
@ -271,6 +255,7 @@ bool TPereta_application::set_print(int)
|
|||||||
_dataini = _msk->get(F_DATAINI);
|
_dataini = _msk->get(F_DATAINI);
|
||||||
_datafin = _msk->get(F_DATAFIN);
|
_datafin = _msk->get(F_DATAFIN);
|
||||||
filtra_sezioni();
|
filtra_sezioni();
|
||||||
|
set_categorie();
|
||||||
current_cursor()->set_filterfunction (filter_func_pereta);
|
current_cursor()->set_filterfunction (filter_func_pereta);
|
||||||
reset_print();
|
reset_print();
|
||||||
crea_intestazione();
|
crea_intestazione();
|
||||||
@ -280,6 +265,23 @@ bool TPereta_application::set_print(int)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TPereta_application::set_one_cat(short field_id)
|
||||||
|
{
|
||||||
|
const char* cat = _msk->get(field_id);
|
||||||
|
if (cat != NULL)
|
||||||
|
_categorie->add(cat);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TPereta_application::set_categorie()
|
||||||
|
{
|
||||||
|
set_one_cat(F_CAT1);
|
||||||
|
set_one_cat(F_CAT2);
|
||||||
|
set_one_cat(F_CAT3);
|
||||||
|
set_one_cat(F_CAT4);
|
||||||
|
set_one_cat(F_CAT5);
|
||||||
|
set_one_cat(F_CAT6);
|
||||||
|
}
|
||||||
|
|
||||||
void TPereta_application::crea_intestazione()
|
void TPereta_application::crea_intestazione()
|
||||||
{
|
{
|
||||||
reset_header();
|
reset_header();
|
||||||
|
231
at/at5100.cpp
231
at/at5100.cpp
@ -1,118 +1,155 @@
|
|||||||
// trasferimenti !!!!
|
// trasferimenti
|
||||||
|
|
||||||
class TTransfer : public TObject
|
#include <applicat.h>
|
||||||
|
#include <config.h>
|
||||||
|
#include <mask.h>
|
||||||
|
#include <relation.h>
|
||||||
|
#include <urldefid.h>
|
||||||
|
|
||||||
|
#include "atfield.cpp"
|
||||||
|
#include "lf.h"
|
||||||
|
|
||||||
|
// nomi delle variabili in .ini per i campi
|
||||||
|
#define FIELD "FIELD"
|
||||||
|
#define LEN "LEN"
|
||||||
|
#define DEC "DEC"
|
||||||
|
#define FLAGS "FLAGS"
|
||||||
|
|
||||||
|
// nomi delle variabili in .ini per HEADER
|
||||||
|
#define HEADER "HEADER"
|
||||||
|
#define NOMEFILE "NOMEFILE"
|
||||||
|
#define LUNGHEZZA "LUNGHEZZA"
|
||||||
|
#define RECORDSEP "RECORDSEP"
|
||||||
|
#define FIELDSEP "FIELDSEP"
|
||||||
|
|
||||||
|
class TTransfer_app : public TApplication
|
||||||
{
|
{
|
||||||
TArray _cursors;
|
TMask* _msk;
|
||||||
TCursor* _current_cursor;
|
TRelation* _rel;
|
||||||
|
|
||||||
TArray _configs;
|
|
||||||
TConfig* _current_config;
|
|
||||||
|
|
||||||
const char* _wmess;
|
|
||||||
bool _wbar;
|
|
||||||
bool _wcancel;
|
|
||||||
int _wthr;
|
|
||||||
|
|
||||||
MENU_TAG _last_choice;
|
|
||||||
|
|
||||||
virtual bool create();
|
|
||||||
virtual bool destroy();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool user_create() pure;
|
virtual bool create();
|
||||||
virtual bool user_destroy() pure;
|
virtual bool destroy();
|
||||||
|
virtual bool menu(MENU_TAG m) ;
|
||||||
void do_trasf(int n);
|
virtual TMask& get_mask() { return *_msk; }
|
||||||
|
virtual TRelation* get_relation() const { return _rel; }
|
||||||
|
virtual void scarica();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void select_cursor(int i);
|
TTransfer_app() {}
|
||||||
TCursor* get_cursor(int i);
|
|
||||||
int add_cursor(TCursor* c);
|
|
||||||
TCursor* current_cursor() { return _current_cursor; }
|
|
||||||
|
|
||||||
void select_config(int i);
|
|
||||||
TConfig* get_config(int i);
|
|
||||||
int add_config(TConfig* c);
|
|
||||||
TConfig* current_config() { return _current_config; }
|
|
||||||
|
|
||||||
virtual bool menu(MENU_TAG m);
|
|
||||||
|
|
||||||
void reset_files();
|
|
||||||
void add_file(int file, int from = 0);
|
|
||||||
void add_file(const char* tab, int from = 0);
|
|
||||||
|
|
||||||
|
|
||||||
TTransfer();
|
|
||||||
virtual ~TTransfer{};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TTransfer::TTransfer():TObject(),_cursors(10),_configs(10)
|
HIDDEN inline TTransfer_app& app() { return (TTransfer_app&) main_app(); }
|
||||||
{
|
|
||||||
_current_cursor = NULL;
|
|
||||||
_current_config = NULL;
|
|
||||||
_last_choice = BAR_ITEM (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TTransfer::create()
|
bool TTransfer_app::create()
|
||||||
{
|
{
|
||||||
if (user_create())
|
_msk = new TMask("at5100a");
|
||||||
{
|
_rel = new TRelation(LF_SOGGETTI);
|
||||||
dispatch_e_menu (_last_choice);
|
|
||||||
|
/*
|
||||||
|
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
|
||||||
|
_donaz = new TLocalisamfile(LF_DONAZ);
|
||||||
|
_contsan = new TLocalisamfile(LF_CONTSAN);
|
||||||
|
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
|
||||||
|
_scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON);
|
||||||
|
_asoggetti = new TAssoc_array();
|
||||||
|
|
||||||
|
_msk->set_handler(F_INS_CONTROLLI,ins_controlli_handler);
|
||||||
|
TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI);
|
||||||
|
ss.set_notify(soggetti_notify);
|
||||||
|
|
||||||
|
//ss.sheet_mask().set_handler(F_S_CODICE,codice_handler);
|
||||||
|
ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
|
||||||
|
*/
|
||||||
|
|
||||||
|
dispatch_e_menu(BAR_ITEM(1));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TTransfer_app::destroy()
|
||||||
|
{
|
||||||
|
delete _rel;
|
||||||
|
delete _msk;
|
||||||
|
/*
|
||||||
|
delete _donaz;
|
||||||
|
delete _contsan;
|
||||||
|
delete _sdonazioni;
|
||||||
|
delete _scontrolli;
|
||||||
|
delete _asoggetti;
|
||||||
|
*/
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TTransfer_app::menu(MENU_TAG m)
|
||||||
|
{
|
||||||
|
TMask& msk = get_mask();
|
||||||
|
const TDate oggi(TODAY);
|
||||||
|
KEY tasto;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
tasto = msk.run();
|
||||||
|
switch (tasto)
|
||||||
|
{
|
||||||
|
case K_ESC: // annulla
|
||||||
|
msk.reset();
|
||||||
|
break;
|
||||||
|
case K_ENTER: // registra
|
||||||
|
{
|
||||||
|
TTransfer_app::scarica();
|
||||||
|
msk.reset();
|
||||||
}
|
}
|
||||||
else return FALSE;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (tasto != K_QUIT);
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TTransfer::destroy()
|
void TTransfer_app::scarica()
|
||||||
{
|
{
|
||||||
user_destroy();
|
|
||||||
//reset_files();
|
TArray arr_exprs; // array delle TExpr corrispondenti ai campi da scaricare
|
||||||
_cursors.destroy();
|
TArray arr_fields; // array dei TField_text (campi indicati in .ini)
|
||||||
_configs.destroy()
|
|
||||||
return //TApplication::destroy();
|
TConfig ini("esporta.ini");
|
||||||
|
TString_array campi;
|
||||||
|
int i = ini.list_paragraphs(campi);
|
||||||
|
int poshead = campi.find("HEADER");
|
||||||
|
campi.remove(poshead,TRUE);
|
||||||
|
for ( int k = 0; k < campi.items(); k++ )
|
||||||
|
{
|
||||||
|
const char* campo = campi.row(k);
|
||||||
|
TString_array vl;
|
||||||
|
int i = ini.list_variables(vl, TRUE, campo);
|
||||||
|
//for ( int j = 0; j < vl.items(); j++ )
|
||||||
|
int pos = vl.find(FIELD);
|
||||||
|
TExpr* espressione = vl.row(pos).get(1);
|
||||||
|
arr_exprs.add(espressione)
|
||||||
|
TToken_string variabile = vl.row(pos);
|
||||||
|
int pos = vl.find(LEN);
|
||||||
|
TToken_string variabile = vl.row(pos);
|
||||||
|
int pos = vl.find(DEC);
|
||||||
|
TToken_string variabile = vl.row(pos);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
TText_field campo()
|
||||||
|
|
||||||
|
arr_fields.add();
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TTransfer::select_cursor(int c)
|
int at5100(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
if (c == -1) _current_cursor = NULL;
|
TTransfer_app a;
|
||||||
else _current_cursor = (TCursor*) &_cursors[c];
|
a.run(argc, argv, "Scarico dati");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TCursor* TTransfer::get_cursor(int c)
|
|
||||||
{
|
|
||||||
if (c == -1) return NULL;
|
|
||||||
else return (TCursor*) &_cursors[c];
|
|
||||||
}
|
|
||||||
|
|
||||||
int TTransfer::add_cursor(TCursor* c)
|
|
||||||
{
|
|
||||||
if (c == NULL)
|
|
||||||
return -1;
|
|
||||||
_cursors.add(c);
|
|
||||||
_current_cursor = c;
|
|
||||||
return _cursors.items() - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TTransfer::select_config(int c)
|
|
||||||
{
|
|
||||||
if (c == -1) _current_config = NULL;
|
|
||||||
else _current_config = (TConfig*) &_configs[c];
|
|
||||||
}
|
|
||||||
|
|
||||||
TConfig* TTransfer::get_config(int c)
|
|
||||||
{
|
|
||||||
if (c == -1) return NULL;
|
|
||||||
else return (TConfig*) &_configs[c];
|
|
||||||
}
|
|
||||||
|
|
||||||
int TTransfer::add_config(TConfig* c)
|
|
||||||
{
|
|
||||||
if (c == NULL)
|
|
||||||
return -1;
|
|
||||||
_configs.add(c);
|
|
||||||
_current_config = c;
|
|
||||||
return _configs.items() - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -9,4 +9,5 @@
|
|||||||
#define F_D_SEZFIN 106
|
#define F_D_SEZFIN 106
|
||||||
#define F_SOTFIN 107
|
#define F_SOTFIN 107
|
||||||
#define F_D_SOTFIN 108
|
#define F_D_SOTFIN 108
|
||||||
#define F_DATA 109
|
#define F_DATAINI 109
|
||||||
|
#define F_DATAFIN 110
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "at4100a.h"
|
#include "at5100a.h"
|
||||||
#include "lf.h"
|
#include "lf.h"
|
||||||
PAGE "Scarico dati" -1 -1 78 20
|
PAGE "Scarico dati" -1 -1 78 11
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 77 4
|
GROUPBOX DLG_NULL 77 4
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -30,7 +30,7 @@ STRING F_D_SEZINI 25
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 11 2 ""
|
PROMPT 11 2 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_SEZIONI 2
|
USE LF_SEZIONI KEY 2
|
||||||
INPUT DENSEZ F_D_SEZINI
|
INPUT DENSEZ F_D_SEZINI
|
||||||
DISPLAY "Sezione@25" DENSEZ
|
DISPLAY "Sezione@25" DENSEZ
|
||||||
DISPLAY "Sottogruppo@25" DENSOT
|
DISPLAY "Sottogruppo@25" DENSOT
|
||||||
@ -85,7 +85,7 @@ STRING F_D_SEZFIN 25
|
|||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 49 2 ""
|
PROMPT 49 2 ""
|
||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
USE LF_SEZIONI 2
|
USE LF_SEZIONI KEY 2
|
||||||
INPUT DENSEZ F_D_SEZFIN
|
INPUT DENSEZ F_D_SEZFIN
|
||||||
DISPLAY "Sezione@25" DENSEZ
|
DISPLAY "Sezione@25" DENSEZ
|
||||||
DISPLAY "Sottogruppo@25" DENSOT
|
DISPLAY "Sottogruppo@25" DENSOT
|
||||||
@ -117,21 +117,33 @@ BEGIN
|
|||||||
HELP "Sottogruppo finale"
|
HELP "Sottogruppo finale"
|
||||||
END
|
END
|
||||||
|
|
||||||
DATE F_DATA
|
|
||||||
|
GROUPBOX DLG_NULL 77 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 5 "Data scarico "
|
PROMPT 1 5 "Intervallo date ultimo aggiornamento"
|
||||||
CHECKTYPE REQUIRED
|
|
||||||
HELP "Data scarico"
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
DATE F_DATAINI
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 6 "Data ultimo aggiornamento dal "
|
||||||
|
HELP "Data di ultimo aggiornamento iniziale"
|
||||||
|
END
|
||||||
|
|
||||||
|
DATE F_DATAFIN
|
||||||
|
BEGIN
|
||||||
|
PROMPT 46 6 "al "
|
||||||
|
HELP "Data di ultimo aggiornamento finale"
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
BUTTON DLG_OK 9 2
|
BUTTON DLG_OK 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -12 14 ""
|
PROMPT -12 9 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_QUIT 9 2
|
BUTTON DLG_QUIT 9 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -22 14 ""
|
PROMPT -22 9 ""
|
||||||
END
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user