modifiche alla maschera e al trascciato dell'archivio soggetti e prog. collegati

git-svn-id: svn://10.65.10.50/trunk@3930 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1996-11-27 08:56:33 +00:00
parent 53a83cb7b2
commit bac717a9ac
17 changed files with 3068 additions and 2651 deletions

View File

@ -6,51 +6,76 @@
#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
#define F_TESSAVIS 105
#define F_CODSEZ 106
#define F_DENSEZ 107
#define F_CODSOT 108
#define F_DENSOT 109
#define F_CATDON 110
#define F_DESC_CATDON 111
#define F_DATAISC 112
#define F_DATADIM 113
#define F_DOM_INDIR 114
#define F_DOM_CODCOM 115
#define F_DOM_DENCOM 116
#define F_DOM_CAPCOM 117
#define F_DOM_PROVCOM 118
#define F_DOM_CODLOC 119
#define F_DOM_DENLOC 120
#define F_DOM_STRADA 121
#define F_DOM_DISTRI 122
#define F_RES_INDIR 123
#define F_RES_CODCOM 124
#define F_RES_DENCOM 125
#define F_RES_CAPCOM 126
#define F_RES_PROVCOM 127
#define F_RES_CODLOC 128
#define F_RES_DENLOC 129
#define F_COMNASC 130
#define F_DENCOMNASC 131
#define F_PROVCOMNASC 132
#define F_SESSO 133
#define F_CF 134
#define F_DOCID 135
#define F_TELABI 136
#define F_TELLAV 137
#define F_TELALT 138
// 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
#define F_CODCL 205
#define F_CODCT 206
#define F_TESSSSN 207
#define F_TITINDIR 208
#define F_CODMED 209
#define F_COGNMED 210
#define F_NOMMED 211
#define F_GRUPPOAB0 212
#define F_RHANTID 213
#define F_KELL 214
#define F_FENOTIPORH 215
#define F_DU 216
#define F_MODCONV 217
#define F_PUNTORACC 218
#define F_DESC_PUNTORACC 219
#define F_GPD_LUN 220
#define F_GPD_MAR 221
#define F_GPD_MER 222
#define F_GPD_GIO 223
#define F_GPD_VEN 224
#define F_GPD_SAB 225
#define F_GPD_DOM 226
#define F_GPC_LUN 227
#define F_GPC_MAR 228
#define F_GPC_MER 229
#define F_GPC_GIO 230
#define F_GPC_VEN 231
#define F_GPC_SAB 232
#define F_GPC_DOM 233
// pagina 3
#define F_STATO 301
@ -78,23 +103,23 @@
#define F_DATAULTAF 323
#define F_TOTDONSI 324
#define F_TOTDONAF 325
#define F_DATACONV 326
#define F_NUMCONV 327
// 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
// pagina 4
#define F_CONDOCC 401
#define F_POSPROF 402
#define F_RAMOATT 403
#define F_TITSTUD 404
#define F_PROFESS 405
#define F_DESC_PROFESS 406
#define F_LUOGOLAV 407
#define F_DESC_LUOGOLAV 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
#define F_UTENULTAGG 412
#define F_DATAULTAGG 413
// pagina 5
#define F_DONAZIONI 501
@ -119,7 +144,7 @@
#define F_D_HB 107
#define F_D_SGPT 108
#define F_D_PROTIDEMIA 109
//#define F_D_PRIMADON 110
#define F_D_PRIMADON 110
#define F_D_DESC_TIPODON 211
#define F_D_DESC_LUOGODON 212

File diff suppressed because it is too large Load Diff

View File

@ -49,7 +49,6 @@ protected:
bool check_sog_sheet(const char* codsog);
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);
void add_rows_soggetti(TSheet_field& s, int count = 10, int start = 0);
static bool ins_controlli_handler(TMask_field& f, KEY k);
@ -98,7 +97,6 @@ bool TDonaz_app::create()
ss.set_notify(soggetti_notify);
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));
@ -431,10 +429,7 @@ bool TDonaz_app::check_sog_sheet(const char* codsog)
if (array_sogg.is_key(codsog))
return FALSE;
else
{
array_sogg.add(codsog);
return TRUE;
}
}
bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
@ -444,18 +439,13 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
{
case K_CTRL+K_DEL:
// avvenuta cancellazione riga
break;
case K_SPACE:
// inizio modifica riga
break;
case K_TAB:
// entrata riga
// entrata riga
{
TToken_string& row = s.row(r);
const char* codsog = row.get(0);
if (codsog != NULL)
{
TAssoc_array& array_sogg = app().get_array_sogg();
if (array_sogg.is_key(codsog))
array_sogg.remove(codsog);
}
if ((r == s.items()-1) && (r == s.first_empty()))
{
app().add_rows_soggetti(s,10,r+1);
@ -463,10 +453,34 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
}
}
break;
case K_ENTER:
// uscita da riga modificata
case K_CTRL+K_TAB:
// uscita riga
{
if ((r == s.items()-1) && (r == s.first_empty()))
TToken_string& row = s.row(r);
const long codsog = row.get_long(0);
if (codsog != 0)
for (int i=s.items()-1; i>=0; i--)
{
if (i != r)
{
TToken_string& row = s.row(i);
if (codsog == row.get_long(0))
return s.sheet_mask().field(F_S_CODICE).error_box("Soggetto gia' inserito");
}
}
else
{
const char* cognome = row.get(1);
if ((cognome != NULL) && (cognome != "\0"))
{
TMask& m = s.sheet_mask();
m.send_key(K_F9,F_S_CODICE);
}
}
/*if ((r == s.items()-1) && (r == s.first_empty())) */
if (r == s.items()-1)
{
app().add_rows_soggetti(s,10,r+1);
s.select(r);
@ -477,26 +491,6 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
return ok;
}
bool TDonaz_app::codice_handler(TMask_field& f, KEY k)
{
bool ok = TRUE;
if (k == K_TAB && f.focusdirty())
{
const char* codice = f.get();
if (codice != NULL)
{
ok = app().check_sog_sheet(codice);
if (!ok)
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;
}
bool TDonaz_app::nome_handler(TMask_field& f, KEY k)
{
bool ok = TRUE;

View File

@ -1,27 +1,41 @@
// definizione campi della maschera at0200a.msk
// INSERIMENTO VELOCE DONAZIONI
// dati fissi
#define F_DATADON 101
#define F_TIPODON 102
#define F_LUOGODON 103
#define F_DESC_TIPODON 104
#define F_DESC_LUOGODON 105
#define F_INS_CONTROLLI 106
// spreadsheet
#define F_SOGGETTI 107
// pagina soggetti
#define F_S_CODICE 101
#define F_S_COGNOME 102
#define F_S_NOME 103
#define F_S_TIPOCON 104
#define F_S_DATANASC 105
#define F_S_CODSEZ 106
#define F_S_CODSOT 107
#define F_S_CATDON 108
#define F_S_TESSERA 109
#define F_S_DENSEZ 201
#define F_S_DENSOT 202
#define F_S_DESC_TIPOCON 203
#define F_S_DESC_CATDON 204
// definizione campi della maschera at0200a.msk
// INSERIMENTO VELOCE DONAZIONI
// dati fissi
#define F_DATADON 101
#define F_TIPODON 102
#define F_LUOGODON 103
#define F_DESC_TIPODON 104
#define F_DESC_LUOGODON 105
#define F_INS_CONTROLLI 106
// spreadsheet
#define F_SOGGETTI 107
// pagina soggetti
#define F_S_CODICE 101
#define F_S_COGNOME 102
#define F_S_NOME 103
#define F_S_TIPOCON 104
#define F_S_DATANASC 105
#define F_S_CODSEZ 106
#define F_S_CODSOT 107
#define F_S_CATDON 108
#define F_S_TESSERA 109
#define F_S_DENSEZ 201
#define F_S_DENSOT 202
#define F_S_DESC_TIPOCON 203
#define F_S_DESC_CATDON 204
#define F_S_IDON1 205
#define F_S_IDON2 206
#define F_S_IDON3 207
#define F_S_IDON4 208
#define F_S_INTSI 209
#define F_S_INTAF 210
#define F_S_PROSSTIPO 211
#define F_S_PROSSDATA 212
#define F_S_DESC_IDON1 213
#define F_S_DESC_IDON2 214
#define F_S_DESC_IDON3 215
#define F_S_DESC_IDON4 216
#define F_S_DESC_PROSSTIPO 217

View File

@ -63,7 +63,7 @@ BEGIN
DISPLAY "Descrizione@30" S0
OUTPUT F_TIPODON CODTAB
OUTPUT F_DESC_TIPODON S0
//VALIDATE NOT_EMPTY_FUNC
VALIDATE NOT_EMPTY_FUNC
CHECKTYPE REQUIRED
WARNING "Codice non presente"
HELP "Tipo donazione"
@ -126,10 +126,15 @@ ENDMASK
PAGE "Soggetto " -1 -1 78 20
GROUPBOX DLG_NULL 77 5
BEGIN
PROMPT 1 0 ""
FLAGS "R"
END
NUMBER F_S_CODICE 6
BEGIN
PROMPT 2 1 "Codice "
FIELD LF_SOGGETTI->CODICE
FLAGS "RG"
USE LF_SOGGETTI KEY 1
INPUT CODICE F_S_CODICE
@ -148,6 +153,7 @@ BEGIN
OUTPUT F_S_CODSEZ CODSEZ
OUTPUT F_S_CODSOT CODSOT
OUTPUT F_S_CATDON CATDON
OUTPUT F_S_TESSAVIS TESSAVIS
CHECKTYPE NORMAL
ADD RUN at0 -0
END
@ -155,7 +161,6 @@ END
STRING F_S_COGNOME 25
BEGIN
PROMPT 2 2 "Cognome e nome "
FIELD LF_SOGGETTI->COGNOME
USE LF_SOGGETTI KEY 2
INPUT COGNOME F_S_COGNOME
INPUT NOME F_S_NOME
@ -176,18 +181,21 @@ END
STRING F_S_NOME 25
BEGIN
PROMPT 46 2 ""
FIELD LF_SOGGETTI->NOME
COPY ALL F_S_COGNOME
COPY OUTPUT F_S_CODICE
//CHECKTYPE NORMAL
CHECKTYPE SEARCH
HELP "Nome del soggetto"
ADD RUN at0 -0
END
GROUPBOX DLG_NULL 77 9
BEGIN
PROMPT 1 9 "Dati del controllo sanitario effettuato"
END
STRING F_S_TIPOCON 2
BEGIN
PROMPT 2 5 "Tipo controllo "
PROMPT 2 10 "Tipo controllo "
FLAGS "U"
USE TCS SELECT S6=="N"
INPUT CODTAB F_S_TIPOCON
@ -202,27 +210,29 @@ END
DATE F_S_DATANASC
BEGIN
PROMPT 2 3 "Nato il "
FIELD LF_SOGGETTI->DATANASC
FLAGS "D"
END
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 5 "Dati associativi"
END
STRING F_S_CODSEZ 2
BEGIN
PROMPT 2 7 "Sez. "
FIELD LF_SOGGETTI->CODSEZ
PROMPT 2 6 "Sez. "
FLAGS "D"
END
STRING F_S_DENSEZ 25
BEGIN
PROMPT 13 7 ""
PROMPT 12 6 ""
FLAGS "D"
END
STRING F_S_CODSOT 2
BEGIN
PROMPT 43 7 "Sot. "
FIELD LF_SOGGETTI->CODSOT
PROMPT 40 6 "Sot. "
FLAGS "D"
USE LF_SEZIONI
INPUT CODSEZ F_S_CODSEZ
@ -234,14 +244,13 @@ END
STRING F_S_DENSOT 25
BEGIN
PROMPT 54 7 ""
PROMPT 50 6 ""
FLAGS "D"
END
STRING F_S_CATDON 2
BEGIN
PROMPT 2 8 "Cat. "
FIELD LF_SOGGETTI->CATDON
PROMPT 2 7 "Cat. "
FLAGS "D"
USE CTD
INPUT CODTAB F_S_CATDON
@ -249,22 +258,155 @@ BEGIN
CHECKTYPE NORMAL
END
STRING F_S_TESSERA 10
STRING F_S_TESSAVIS 10
BEGIN
PROMPT 43 8 "Tessera AVIS "
FIELD LF_SOGGETTI->TESSAVIS
PROMPT 52 7 "Tessera AVIS "
FLAGS "D"
END
STRING F_S_DESC_TIPOCON 25
BEGIN
PROMPT 35 5 ""
PROMPT 23 10 ""
FLAGS "D"
END
STRING F_S_DESC_CATDON 22
STRING F_S_DESC_CATDON 25
BEGIN
PROMPT 13 8 ""
PROMPT 12 7 ""
FLAGS "D"
END
TEXT DLG_NULL
BEGIN
PROMPT 2 11 "Se idoneita': Tipi donazione ammessi"
END
STRING F_S_IDON1 2
BEGIN
PROMPT 40 11 ""
FLAGS "U"
USE IDO
INPUT CODTAB F_S_IDON1
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@40" S0
OUTPUT F_S_IDON1 CODTAB
OUTPUT F_S_DESC_IDON1 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Idoneita' alla donazione"
END
STRING F_S_IDON2 2
BEGIN
PROMPT 40 12 ""
FLAGS "U"
USE IDO
INPUT CODTAB F_S_IDON2
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@40" S0
OUTPUT F_S_IDON2 CODTAB
OUTPUT F_S_DESC_IDON2 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Idoneita' alla donazione"
END
STRING F_S_IDON3 2
BEGIN
PROMPT 40 13 ""
FLAGS "U"
USE IDO
INPUT CODTAB F_S_IDON3
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@40" S0
OUTPUT F_S_IDON3 CODTAB
OUTPUT F_S_DESC_IDON3 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Idoneita' alla donazione"
END
STRING F_S_IDON4 2
BEGIN
PROMPT 40 14 ""
FLAGS "U"
USE IDO
INPUT CODTAB F_S_IDON4
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@40" S0
OUTPUT F_S_IDON4 CODTAB
OUTPUT F_S_DESC_IDON4 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Idoneita' alla donazione"
END
TEXT DLG_NULL
BEGIN
PROMPT 2 15 " Intervalli"
END
NUMBER F_S_INTSI 3 0
BEGIN
PROMPT 40 15 "Sangue intero "
FLAGS "U"
END
NUMBER F_S_INTAF 3 0
BEGIN
PROMPT 60 15 "Aferesi "
FLAGS "U"
END
STRING F_S_PROSSTIPO 2
BEGIN
PROMPT 2 16 "Prossimo contr.: Tipo "
FLAGS "U"
USE TCS
INPUT CODTAB F_S_PROSSTIPO
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@40" S0
OUTPUT F_S_PROSSTIPO CODTAB
OUTPUT F_S_DESC_PROSSTIPO S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Tipo/Esito controllo sanitario"
END
DATE F_S_PROSSDATA
BEGIN
PROMPT 56 16 "Data "
HELP "Data controllo"
END
STRING F_S_DESC_IDON1 25
BEGIN
PROMPT 46 11 ""
FLAGS "D"
END
STRING F_S_DESC_IDON2 25
BEGIN
PROMPT 46 12 ""
FLAGS "D"
END
STRING F_S_DESC_IDON3 25
BEGIN
PROMPT 46 13 ""
FLAGS "D"
END
STRING F_S_DESC_IDON4 25
BEGIN
PROMPT 46 14 ""
FLAGS "D"
END
STRING F_S_DESC_PROSSTIPO 25
BEGIN
PROMPT 29 16 ""
FLAGS "D"
END

View File

@ -1,40 +1,40 @@
// definizione campi della maschera at0700a.msk
#define F_CODSEZ 101
#define F_CODSOT 102
#define F_DENSEZ 103
#define F_DENSOT 104
#define F_INDIRIZZO 105
#define F_COM 106
#define F_DENCOM 107
#define F_LOCALITA 108
#define F_DENLOC 109
#define F_CAPCOM 110
#define F_PROVCOM 111
#define F_TELEFONO 112
#define F_FAX 113
#define F_REFERCED 114
#define F_STATO 115
#define F_INTMINCONV 116
#define F_INTMIN 117
#define F_INTMAX 118
#define F_TIPOCONV 119
#define F_DATAULTCON 120
#define F_INTESTAZ1 121
#define F_INTESTAZ2 122
#define F_INTESTAZ3 123
#define F_INTESTAZ4 124
#define F_CONVORA 125
#define F_CONVSEDE1 126
#define F_CONVSEDE2 127
#define F_CONVSEDE3 128
#define F_CONVSEDE4 129
#define F_CONVNOTE 130
#define F_DONEMER 131
#define F_INTESTI 132
#define F_CATEMER 133
#define F_DESC_CATEMER 134
#define F_CATESTI 135
#define F_DESC_CATESTI 136
#define F_CATCANC 137
#define F_DESC_CATCANC 138
// definizione campi della maschera at0700a.msk
#define F_CODSEZ 101
#define F_CODSOT 103
#define F_DENSEZ 102
#define F_DENSOT 104
#define F_INDIRIZZO 105
#define F_COM 106
#define F_DENCOM 107
#define F_LOCALITA 108
#define F_DENLOC 109
#define F_CAPCOM 110
#define F_PROVCOM 111
#define F_TELEFONO 112
#define F_FAX 113
#define F_REFERCED 114
#define F_STATO 115
#define F_INTMINCONV 116
#define F_INTMIN 117
#define F_INTMAX 118
#define F_TIPOCONV 119
#define F_DATAULTCON 120
#define F_INTESTAZ1 121
#define F_INTESTAZ2 122
#define F_INTESTAZ3 123
#define F_INTESTAZ4 124
#define F_CONVORA 125
#define F_CONVSEDE1 126
#define F_CONVSEDE2 127
#define F_CONVSEDE3 128
#define F_CONVSEDE4 129
#define F_CONVNOTE 130
#define F_DONEMER 131
#define F_INTESTI 132
#define F_CATEMER 133
#define F_DESC_CATEMER 134
#define F_CATESTI 135
#define F_DESC_CATESTI 136
#define F_CATCANC 137
#define F_DESC_CATCANC 138

View File

@ -1,430 +1,422 @@
#include "at0700.h"
#include "lf.h"
TOOLBAR "" 0 20 0 2
#include <toolbar.h>
ENDPAGE
PAGE "Tabella Sezioni 1/2" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 0 ""
FLAGS "R"
END
STRING F_CODSEZ 2
BEGIN
PROMPT 2 1 "Cod. sezione "
FIELD CODSEZ
FLAGS "U"
KEY 1
USE LF_SEZIONI
INPUT CODSEZ F_CODSEZ
DISPLAY "Cod.sez. " CODSEZ
DISPLAY "Cod.sot. " CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_CODSEZ CODSEZ
OUTPUT F_DENSEZ DENSEZ
OUTPUT F_CODSOT CODSOT
OUTPUT F_DENSOT DENSOT
MESSAGE COPY,1@
CHECKTYPE REQUIRED
END
STRING F_CODSOT 2
BEGIN
PROMPT 2 2 "Cod. sottogruppo "
FIELD CODSOT
FLAGS "U"
KEY 1
USE LF_SEZIONI
INPUT CODSEZ F_CODSEZ
INPUT CODSOT F_CODSOT
DISPLAY "Cod.sez. " CODSEZ
DISPLAY "Cod.sot. " CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_CODSEZ CODSEZ
OUTPUT F_DENSEZ DENSEZ
OUTPUT F_CODSOT CODSOT
OUTPUT F_DENSOT DENSOT
MESSAGE COPY,2@
CHECKTYPE REQUIRED
WARNING "Inserire il codice della sezione"
END
STRING F_DENSEZ 25
BEGIN
PROMPT 29 1 "Denominazione sez. "
FIELD DENSEZ
KEY 2
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_DENSEZ
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez. " CODSEZ
DISPLAY "Cod.sot. " CODSOT
COPY OUTPUT F_CODSEZ
MESSAGE COPY,3@
CHECKTYPE REQUIRED
WARNING "Inserire la denominazione della sezione"
END
STRING F_DENSOT 25
BEGIN
PROMPT 29 2 "Denominazione sot. "
FIELD DENSOT
KEY 2
COPY ALL F_DENSEZ
MESSAGE COPY,4@
CHECKTYPE NORMAL
WARNING "Inserire la denominazione del sottogruppo"
END
GROUPBOX DLG_NULL 77 7
BEGIN
PROMPT 1 4 "Dati anagrafici"
END
STRING F_INDIRIZZO 50
BEGIN
PROMPT 2 5 "Indirizzo "
FIELD INDIRIZZO
END
STRING F_COM 4
BEGIN
PROMPT 2 6 "Comune "
FIELD COM
FLAGS "U"
USE LF_COMUNI
INPUT STATO ""
INPUT COM F_COM
#include <comdcod.h>
OUTPUT F_COM COM
OUTPUT F_DENCOM DENCOM
OUTPUT F_PROVCOM PROVCOM
OUTPUT F_CAPCOM CAPCOM
CHECKTYPE NORMAL
WARNING "Comune assente"
END
STRING F_DENCOM 48
BEGIN
PROMPT 19 6 ""
USE LF_COMUNI KEY 2
INPUT DENCOM F_DENCOM
#include <comdden.h>
COPY OUTPUT F_COM
CHECKTYPE NORMAL
END
STRING F_LOCALITA 4
BEGIN
PROMPT 2 7 "Località "
FIELD LOCALITA
FLAGS "U"
USE LCP SELECT S7=#F_COM
INPUT CODTAB F_LOCALITA
DISPLAY "Codice" CODTAB
DISPLAY "Località@30" S0
DISPLAY "CAP@5" S6
OUTPUT F_LOCALITA CODTAB
OUTPUT F_DENLOC S0
OUTPUT F_CAPCOM S6
OUTPUT F_COM S7
CHECKTYPE NORMAL
HELP "Codice localit… postale se diversa dal comune"
END
STRING F_DENLOC 30
BEGIN
PROMPT 19 7 ""
COPY USE F_LOCALITA
INPUT S0 F_DENLOC
DISPLAY "Località@30" S0
DISPLAY "CAP@5" S6
DISPLAY "Codice" CODTAB
COPY OUTPUT F_LOCALITA
CHECKTYPE NORMAL
HELP "Localit… postale se diversa dal comune"
END
STRING F_PROVCOM 5
BEGIN
PROMPT 71 6 ""
FLAGS "D"
END
STRING F_CAPCOM 5
BEGIN
PROMPT 67 7 "CAP "
FLAGS "D"
END
STRING F_TELEFONO 15
BEGIN
PROMPT 2 8 "Telefono "
FIELD TELEFONO
END
STRING F_FAX 15
BEGIN
PROMPT 32 8 "Fax "
FIELD FAX
END
STRING F_REFERCED 50
BEGIN
PROMPT 2 9 "Referente CED "
FIELD REFERCED
END
RADIOBUTTON F_STATO 13
BEGIN
PROMPT 1 11 "Stato"
FIELD STATO
ITEM "A|Attiva"
ITEM "E|Estinta"
END
GROUPBOX DLG_NULL 35 7
BEGIN
PROMPT 16 11 "Parametri convocazione"
END
NUMBER F_INTMINCONV 4
BEGIN
PROMPT 17 12 "Int. min. convoc. "
FIELD INTMINCONV
HELP "Intervallo minimo di convocazione in giorni (dall'ultima don.)"
END
NUMBER F_INTMIN 4
BEGIN
PROMPT 17 13 "Int. avvisi: min. "
FIELD INTMIN
END
NUMBER F_INTMAX 4
BEGIN
PROMPT 17 14 " max. "
FIELD INTMAX
END
LISTBOX F_TIPOCONV 11
BEGIN
PROMPT 17 15 "Tipo convocazione "
FIELD TIPOCONV
ITEM "D|Data fissa"
ITEM "G|dal Giorno"
END
DATE F_DATAULTCON
BEGIN
PROMPT 17 16 "Data ultima conv. "
FIELD DATAULTCON
FLAGS "D"
END
GROUPBOX DLG_NULL 25 6
BEGIN
PROMPT 53 11 "Intestazione tessere"
END
STRING F_INTESTAZ1 20
BEGIN
PROMPT 55 12 ""
FIELD INTESTAZ1
END
STRING F_INTESTAZ2 20
BEGIN
PROMPT 55 13 ""
FIELD INTESTAZ2
END
STRING F_INTESTAZ3 20
BEGIN
PROMPT 55 14 ""
FIELD INTESTAZ3
END
STRING F_INTESTAZ4 20
BEGIN
PROMPT 55 15 ""
FIELD INTESTAZ4
END
ENDPAGE
PAGE "Tabella Sezioni 2/2" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 0 ""
FLAGS "R"
END
STRING DLG_NULL 2
BEGIN
PROMPT 2 1 "Cod. sezione "
FLAGS "D"
GROUP 1
END
STRING DLG_NULL 2
BEGIN
PROMPT 2 2 "Cod. sottogruppo "
FLAGS "D"
GROUP 2
END
STRING DLG_NULL 25
BEGIN
PROMPT 29 1 "Denominazione sez. "
FLAGS "D"
GROUP 3
END
STRING DLG_NULL 25
BEGIN
PROMPT 29 2 "Denominazione sot. "
FLAGS "D"
GROUP 4
END
GROUPBOX DLG_NULL 35 8
BEGIN
PROMPT 1 4 "Dati per stampa cartolina"
END
STRING F_CONVORA 20
BEGIN
PROMPT 2 5 "Orario "
FIELD CONVORA
END
STRING F_CONVSEDE1 25
BEGIN
PROMPT 2 6 "Sede "
FIELD CONVSEDE1
END
STRING F_CONVSEDE2 25
BEGIN
PROMPT 2 7 " "
FIELD CONVSEDE2
END
STRING F_CONVSEDE3 25
BEGIN
PROMPT 2 8 " "
FIELD CONVSEDE3
END
STRING F_CONVSEDE4 25
BEGIN
PROMPT 2 9 " "
FIELD CONVSEDE4
END
STRING F_CONVNOTE 25
BEGIN
PROMPT 2 10 "Note "
FIELD CONVNOTE
END
GROUPBOX DLG_NULL 41 8
BEGIN
PROMPT 37 4 "Parametri per chiusura fine anno"
END
NUMBER F_DONEMER 3
BEGIN
PROMPT 38 5 "Donazioni per passaggio a emeriti "
FIELD DONEMER
FLAGS "U"
END
NUMBER F_INTESTI 2
BEGIN
PROMPT 38 6 "Intervallo di estinzione in anni "
FIELD INTESTI
FLAGS "U"
END
TEXT DLG_NULL
BEGIN
PROMPT 38 7 "Categorie:"
END
STRING F_CATEMER 2
BEGIN
PROMPT 39 8 "emeriti "
FIELD CATEMER
FLAGS "U"
USE CTD
INPUT CODTAB F_CATEMER
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@30" S0
OUTPUT F_CATEMER CODTAB
OUTPUT F_DESC_CATEMER S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
END
STRING F_DESC_CATEMER 20
BEGIN
PROMPT 56 8 ""
FLAGS "D"
END
STRING F_CATESTI 2
BEGIN
PROMPT 39 9 "estinti "
FIELD CATESTI
FLAGS "U"
USE CTD
INPUT CODTAB F_CATESTI
COPY DISPLAY F_CATEMER
OUTPUT F_CATESTI CODTAB
OUTPUT F_DESC_CATESTI S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
END
STRING F_DESC_CATESTI 20
BEGIN
PROMPT 56 9 ""
FLAGS "D"
END
STRING F_CATCANC 2
BEGIN
PROMPT 39 10 "cancellati "
FIELD CATCANC
FLAGS "U"
USE CTD
INPUT CODTAB F_CATCANC
COPY DISPLAY F_CATEMER
OUTPUT F_CATCANC CODTAB
OUTPUT F_DESC_CATCANC S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
END
STRING F_DESC_CATCANC 20
BEGIN
PROMPT 56 10 ""
FLAGS "D"
END
ENDPAGE
ENDMASK
#include "at0700.h"
#include "lf.h"
TOOLBAR "" 0 20 0 2
#include <toolbar.h>
ENDPAGE
PAGE "Sezioni 1" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 0 ""
FLAGS "R"
END
STRING F_CODSEZ 2
BEGIN
PROMPT 2 1 "Cod. sezione "
FIELD CODSEZ
FLAGS "U"
KEY 1
USE LF_SEZIONI
INPUT CODSEZ F_CODSEZ
INPUT CODSOT F_CODSOT
DISPLAY "Cod.sez. " CODSEZ
DISPLAY "Cod.sot. " CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_CODSEZ CODSEZ
OUTPUT F_DENSEZ DENSEZ
OUTPUT F_CODSOT CODSOT
OUTPUT F_DENSOT DENSOT
MESSAGE COPY,1@
CHECKTYPE REQUIRED
END
STRING F_CODSOT 2
BEGIN
PROMPT 2 2 "Cod. sottogruppo "
FIELD CODSOT
FLAGS "U"
KEY 1
COPY ALL F_CODSEZ
MESSAGE COPY,2@
CHECKTYPE NORMAL
WARNING "Inserire il codice della sezione"
END
STRING F_DENSEZ 25
BEGIN
PROMPT 29 1 "Denominazione sez. "
FIELD DENSEZ
KEY 2
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_DENSEZ
INPUT DENSOT F_DENSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez. " CODSEZ
DISPLAY "Cod.sot. " CODSOT
COPY OUTPUT F_CODSEZ
MESSAGE COPY,3@
CHECKTYPE REQUIRED
WARNING "Inserire la denominazione della sezione"
END
STRING F_DENSOT 25
BEGIN
PROMPT 29 2 "Denominazione sot. "
FIELD DENSOT
KEY 2
COPY ALL F_DENSEZ
MESSAGE COPY,4@
CHECKTYPE NORMAL
WARNING "Inserire la denominazione del sottogruppo"
END
GROUPBOX DLG_NULL 77 7
BEGIN
PROMPT 1 4 "Dati anagrafici"
END
STRING F_INDIRIZZO 50
BEGIN
PROMPT 2 5 "Indirizzo "
FIELD INDIRIZZO
END
STRING F_COM 4
BEGIN
PROMPT 2 6 "Comune "
FIELD COM
FLAGS "U"
USE LF_COMUNI
INPUT STATO ""
INPUT COM F_COM
#include <comdcod.h>
OUTPUT F_COM COM
OUTPUT F_DENCOM DENCOM
OUTPUT F_PROVCOM PROVCOM
OUTPUT F_CAPCOM CAPCOM
CHECKTYPE NORMAL
WARNING "Comune assente"
END
STRING F_DENCOM 48
BEGIN
PROMPT 19 6 ""
USE LF_COMUNI KEY 2
INPUT DENCOM F_DENCOM
#include <comdden.h>
COPY OUTPUT F_COM
CHECKTYPE NORMAL
END
STRING F_LOCALITA 4
BEGIN
PROMPT 2 7 "Località "
FIELD LOCALITA
FLAGS "U"
USE LCP SELECT S7=#F_COM
INPUT CODTAB F_LOCALITA
DISPLAY "Codice" CODTAB
DISPLAY "Località@30" S0
DISPLAY "CAP@5" S6
OUTPUT F_LOCALITA CODTAB
OUTPUT F_DENLOC S0
OUTPUT F_CAPCOM S6
OUTPUT F_COM S7
CHECKTYPE NORMAL
HELP "Codice localit… postale se diversa dal comune"
END
STRING F_DENLOC 30
BEGIN
PROMPT 19 7 ""
COPY USE F_LOCALITA
INPUT S0 F_DENLOC
DISPLAY "Località@30" S0
DISPLAY "CAP@5" S6
DISPLAY "Codice" CODTAB
COPY OUTPUT F_LOCALITA
CHECKTYPE NORMAL
HELP "Localit… postale se diversa dal comune"
END
STRING F_PROVCOM 5
BEGIN
PROMPT 71 6 ""
FLAGS "D"
END
STRING F_CAPCOM 5
BEGIN
PROMPT 67 7 "CAP "
FLAGS "D"
END
STRING F_TELEFONO 15
BEGIN
PROMPT 2 8 "Telefono "
FIELD TELEFONO
END
STRING F_FAX 15
BEGIN
PROMPT 32 8 "Fax "
FIELD FAX
END
STRING F_REFERCED 50
BEGIN
PROMPT 2 9 "Referente CED "
FIELD REFERCED
END
RADIOBUTTON F_STATO 13
BEGIN
PROMPT 1 11 "Stato"
FIELD STATO
ITEM "A|Attiva"
ITEM "E|Estinta"
END
GROUPBOX DLG_NULL 35 7
BEGIN
PROMPT 16 11 "Parametri convocazione"
END
NUMBER F_INTMINCONV 4
BEGIN
PROMPT 17 12 "Int. min. convoc. "
FIELD INTMINCONV
HELP "Intervallo minimo di convocazione in giorni (dall'ultima don.)"
END
NUMBER F_INTMIN 4
BEGIN
PROMPT 17 13 "Int. avvisi: min. "
FIELD INTMIN
END
NUMBER F_INTMAX 4
BEGIN
PROMPT 17 14 " max. "
FIELD INTMAX
END
LISTBOX F_TIPOCONV 11
BEGIN
PROMPT 17 15 "Tipo convocazione "
FIELD TIPOCONV
ITEM "D|Data fissa"
ITEM "G|dal Giorno"
END
DATE F_DATAULTCON
BEGIN
PROMPT 17 16 "Data ultima conv. "
FIELD DATAULTCON
FLAGS "D"
END
GROUPBOX DLG_NULL 25 6
BEGIN
PROMPT 53 11 "Intestazione tessere"
END
STRING F_INTESTAZ1 20
BEGIN
PROMPT 55 12 ""
FIELD INTESTAZ1
END
STRING F_INTESTAZ2 20
BEGIN
PROMPT 55 13 ""
FIELD INTESTAZ2
END
STRING F_INTESTAZ3 20
BEGIN
PROMPT 55 14 ""
FIELD INTESTAZ3
END
STRING F_INTESTAZ4 20
BEGIN
PROMPT 55 15 ""
FIELD INTESTAZ4
END
ENDPAGE
PAGE "Sezioni 2" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 0 ""
FLAGS "R"
END
STRING DLG_NULL 2
BEGIN
PROMPT 2 1 "Cod. sezione "
FLAGS "D"
GROUP 1
END
STRING DLG_NULL 2
BEGIN
PROMPT 2 2 "Cod. sottogruppo "
FLAGS "D"
GROUP 2
END
STRING DLG_NULL 25
BEGIN
PROMPT 29 1 "Denominazione sez. "
FLAGS "D"
GROUP 3
END
STRING DLG_NULL 25
BEGIN
PROMPT 29 2 "Denominazione sot. "
FLAGS "D"
GROUP 4
END
GROUPBOX DLG_NULL 35 8
BEGIN
PROMPT 1 4 "Dati per stampa cartolina"
END
STRING F_CONVORA 20
BEGIN
PROMPT 2 5 "Orario "
FIELD CONVORA
END
STRING F_CONVSEDE1 25
BEGIN
PROMPT 2 6 "Sede "
FIELD CONVSEDE1
END
STRING F_CONVSEDE2 25
BEGIN
PROMPT 2 7 " "
FIELD CONVSEDE2
END
STRING F_CONVSEDE3 25
BEGIN
PROMPT 2 8 " "
FIELD CONVSEDE3
END
STRING F_CONVSEDE4 25
BEGIN
PROMPT 2 9 " "
FIELD CONVSEDE4
END
STRING F_CONVNOTE 25
BEGIN
PROMPT 2 10 "Note "
FIELD CONVNOTE
END
GROUPBOX DLG_NULL 41 8
BEGIN
PROMPT 37 4 "Parametri per chiusura fine anno"
END
NUMBER F_DONEMER 3
BEGIN
PROMPT 38 5 "Donazioni per passaggio a emeriti "
FIELD DONEMER
FLAGS "U"
END
NUMBER F_INTESTI 2
BEGIN
PROMPT 38 6 "Intervallo di estinzione in anni "
FIELD INTESTI
FLAGS "U"
END
TEXT DLG_NULL
BEGIN
PROMPT 38 7 "Categorie:"
END
STRING F_CATEMER 2
BEGIN
PROMPT 39 8 "emeriti "
FIELD CATEMER
FLAGS "U"
USE CTD
INPUT CODTAB F_CATEMER
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@30" S0
OUTPUT F_CATEMER CODTAB
OUTPUT F_DESC_CATEMER S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
END
STRING F_DESC_CATEMER 20
BEGIN
PROMPT 56 8 ""
FLAGS "D"
END
STRING F_CATESTI 2
BEGIN
PROMPT 39 9 "estinti "
FIELD CATESTI
FLAGS "U"
USE CTD
INPUT CODTAB F_CATESTI
COPY DISPLAY F_CATEMER
OUTPUT F_CATESTI CODTAB
OUTPUT F_DESC_CATESTI S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
END
STRING F_DESC_CATESTI 20
BEGIN
PROMPT 56 9 ""
FLAGS "D"
END
STRING F_CATCANC 2
BEGIN
PROMPT 39 10 "cancellati "
FIELD CATCANC
FLAGS "U"
USE CTD
INPUT CODTAB F_CATCANC
COPY DISPLAY F_CATEMER
OUTPUT F_CATCANC CODTAB
OUTPUT F_DESC_CATCANC S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
END
STRING F_DESC_CATCANC 20
BEGIN
PROMPT 56 10 ""
FLAGS "D"
END
ENDPAGE
ENDMASK

View File

@ -1,157 +1,157 @@
#include "at0800.h"
#include "lf.h"
TOOLBAR "" 0 20 0 2
#include <toolbar.h>
ENDPAGE
PAGE "Tabella Medici 1/1" -1 -1 78 20
GROUPBOX DLG_NULL 77 5
BEGIN
PROMPT 1 1 ""
FLAGS "R"
END
NUMBER F_CODMED 6
BEGIN
PROMPT 2 2 "Cod. medico "
FIELD CODMED
FLAGS "U"
KEY 1
USE LF_MEDICI
INPUT CODMED F_CODMED
DISPLAY "Codice " CODMED
DISPLAY "Cognome@25" COGNOME
DISPLAY "Nome@25" NOME
OUTPUT F_CODMED CODMED
OUTPUT F_COGNOME COGNOME
OUTPUT F_NOME NOME
CHECKTYPE REQUIRED
END
STRING F_COGNOME 25
BEGIN
PROMPT 2 3 "Cognome "
FIELD COGNOME
KEY 2
USE LF_MEDICI KEY 2
INPUT COGNOME F_COGNOME
INPUT NOME F_NOME
DISPLAY "Cognome@25" COGNOME
DISPLAY "Nome@25" NOME
DISPLAY "Codice " CODMED
COPY OUTPUT F_CODMED
CHECKTYPE REQUIRED
WARNING "Inserire il cognome del medico"
END
STRING F_NOME 25
BEGIN
PROMPT 2 4 "Nome "
FIELD NOME
KEY 2
COPY ALL F_COGNOME
CHECKTYPE NORMAL
END
GROUPBOX DLG_NULL 77 5
BEGIN
PROMPT 1 6 "Indirizzo"
END
STRING F_INDIRIZZO 50
BEGIN
PROMPT 2 7 "Indirizzo "
FIELD INDIRIZZO
END
STRING F_COM 4
BEGIN
PROMPT 2 8 "Comune "
FIELD COM
FLAGS "U"
USE LF_COMUNI
INPUT STATO ""
INPUT COM F_COM
#include <comdcod.h>
OUTPUT F_COM COM
OUTPUT F_DENCOM DENCOM
OUTPUT F_PROVCOM PROVCOM
OUTPUT F_CAPCOM CAPCOM
CHECKTYPE NORMAL
WARNING "Comune assente"
END
STRING F_DENCOM 48
BEGIN
PROMPT 19 8 ""
USE LF_COMUNI KEY 2
INPUT DENCOM F_DENCOM
#include <comdden.h>
COPY OUTPUT F_COM
CHECKTYPE NORMAL
END
STRING F_LOCALITA 4
BEGIN
PROMPT 2 9 "Località "
FIELD LOCALITA
FLAGS "U"
USE LCP SELECT S7=#F_COM
INPUT CODTAB F_LOCALITA
DISPLAY "Codice" CODTAB
DISPLAY "Località@30" S0
DISPLAY "CAP@5" S6
OUTPUT F_LOCALITA CODTAB
OUTPUT F_DENLOC S0
OUTPUT F_CAPCOM S6
OUTPUT F_COM S7
CHECKTYPE NORMAL
HELP "Codice localit… postale se diversa dal comune"
END
STRING F_DENLOC 30
BEGIN
PROMPT 19 9 ""
COPY USE F_LOCALITA
INPUT S0 F_DENLOC
DISPLAY "Località@30" S0
DISPLAY "CAP@5" S6
DISPLAY "Codice" CODTAB
COPY OUTPUT F_LOCALITA
CHECKTYPE NORMAL
HELP "Localit… postale se diversa dal comune"
END
STRING F_PROVCOM 5
BEGIN
PROMPT 71 8 ""
FLAGS "D"
END
STRING F_CAPCOM 5
BEGIN
PROMPT 67 9 "CAP "
FLAGS "D"
END
GROUPBOX DLG_NULL 77 3
BEGIN
PROMPT 1 11 "Telefoni"
END
STRING F_TELAMB 15
BEGIN
PROMPT 2 12 "Ambulatorio "
FIELD TELAMB
END
STRING F_TELABI 15
BEGIN
PROMPT 40 12 "Abitazione "
FIELD TELABI
END
ENDPAGE
ENDMASK
#include "at0800.h"
#include "lf.h"
TOOLBAR "" 0 20 0 2
#include <toolbar.h>
ENDPAGE
PAGE "Medici" -1 -1 78 20
GROUPBOX DLG_NULL 77 5
BEGIN
PROMPT 1 1 ""
FLAGS "R"
END
NUMBER F_CODMED 6
BEGIN
PROMPT 2 2 "Cod. medico "
FIELD CODMED
FLAGS "U"
KEY 1
USE LF_MEDICI
INPUT CODMED F_CODMED
DISPLAY "Codice " CODMED
DISPLAY "Cognome@25" COGNOME
DISPLAY "Nome@25" NOME
OUTPUT F_CODMED CODMED
OUTPUT F_COGNOME COGNOME
OUTPUT F_NOME NOME
CHECKTYPE REQUIRED
END
STRING F_COGNOME 25
BEGIN
PROMPT 2 3 "Cognome "
FIELD COGNOME
KEY 2
USE LF_MEDICI KEY 2
INPUT COGNOME F_COGNOME
INPUT NOME F_NOME
DISPLAY "Cognome@25" COGNOME
DISPLAY "Nome@25" NOME
DISPLAY "Codice " CODMED
COPY OUTPUT F_CODMED
CHECKTYPE REQUIRED
WARNING "Inserire il cognome del medico"
END
STRING F_NOME 25
BEGIN
PROMPT 2 4 "Nome "
FIELD NOME
KEY 2
COPY ALL F_COGNOME
CHECKTYPE NORMAL
END
GROUPBOX DLG_NULL 77 5
BEGIN
PROMPT 1 6 "Indirizzo"
END
STRING F_INDIRIZZO 50
BEGIN
PROMPT 2 7 "Indirizzo "
FIELD INDIRIZZO
END
STRING F_COM 4
BEGIN
PROMPT 2 8 "Comune "
FIELD COM
FLAGS "U"
USE LF_COMUNI
INPUT STATO ""
INPUT COM F_COM
#include <comdcod.h>
OUTPUT F_COM COM
OUTPUT F_DENCOM DENCOM
OUTPUT F_PROVCOM PROVCOM
OUTPUT F_CAPCOM CAPCOM
CHECKTYPE NORMAL
WARNING "Comune assente"
END
STRING F_DENCOM 48
BEGIN
PROMPT 19 8 ""
USE LF_COMUNI KEY 2
INPUT DENCOM F_DENCOM
#include <comdden.h>
COPY OUTPUT F_COM
CHECKTYPE NORMAL
END
STRING F_LOCALITA 4
BEGIN
PROMPT 2 9 "Località "
FIELD LOCALITA
FLAGS "U"
USE LCP SELECT S7=#F_COM
INPUT CODTAB F_LOCALITA
DISPLAY "Codice" CODTAB
DISPLAY "Località@30" S0
DISPLAY "CAP@5" S6
OUTPUT F_LOCALITA CODTAB
OUTPUT F_DENLOC S0
OUTPUT F_CAPCOM S6
OUTPUT F_COM S7
CHECKTYPE NORMAL
HELP "Codice localit… postale se diversa dal comune"
END
STRING F_DENLOC 30
BEGIN
PROMPT 19 9 ""
COPY USE F_LOCALITA
INPUT S0 F_DENLOC
DISPLAY "Località@30" S0
DISPLAY "CAP@5" S6
DISPLAY "Codice" CODTAB
COPY OUTPUT F_LOCALITA
CHECKTYPE NORMAL
HELP "Localit… postale se diversa dal comune"
END
STRING F_PROVCOM 5
BEGIN
PROMPT 71 8 ""
FLAGS "D"
END
STRING F_CAPCOM 5
BEGIN
PROMPT 67 9 "CAP "
FLAGS "D"
END
GROUPBOX DLG_NULL 77 3
BEGIN
PROMPT 1 11 "Telefoni"
END
STRING F_TELAMB 15
BEGIN
PROMPT 2 12 "Ambulatorio "
FIELD TELAMB
END
STRING F_TELABI 15
BEGIN
PROMPT 40 12 "Abitazione "
FIELD TELABI
END
ENDPAGE
ENDMASK

View File

@ -297,8 +297,8 @@ bool TSospesi_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==COM");
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==DOM_COMCOM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");

View File

@ -56,12 +56,12 @@ protected:
virtual bool preprocess_page (int file, int counter);
public:
void set_one_cat(short field_id);
void set_categorie();
TAssoc_array& get_categorie() { return *_categorie; }
//void set_one_cat(short field_id);
//void set_categorie();
//TAssoc_array& get_categorie() { return *_categorie; }
void crea_intestazione();
void filtra_sezioni();
void header_sezione(const char* codsez, const char* codsot);
void header_sezione(TString codsez, TString codsot);
TMask& app_mask() { return *_msk; }
TPereta_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
@ -124,7 +124,7 @@ void TPereta_application::set_page(int file, int cnt)
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@10g#a", &_cognome_nome);
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@47g@S", FLD(LF_SOGGETTI,SOG_INDIRIZZO));
set_row(1,"@47g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR));
set_row(1,"@98g@S", FLD(LF_SOGGETTI,SOG_TELABI));
set_row(1,"@114g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
set_row(2,"@47g#a", &_dencom);
@ -139,13 +139,35 @@ bool TPereta_application::filter_func_pereta(const TRelation * rel)
bool filtrato = TRUE;
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
//filtro per categorie
TAssoc_array& categorie = TPereta_application::get_categorie();
TAssoc_array 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);
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)
{
const char* cat = sog->curr().get(SOG_CATDON);
if (categorie.is_key(cat))
TString cat = sog->curr().get(SOG_CATDON);
if (categorie.is_key((const char*) cat))
filtrato = TRUE;
else
filtrato = FALSE;
@ -169,6 +191,27 @@ bool TPereta_application::filter_func_pereta(const TRelation * rel)
return filtrato;
}
void TPereta_application::header_sezione(TString codsez, TString codsot)
{
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
return;
}
bool TPereta_application::preprocess_page(int file, int counter)
{
// contatore soggetti stampati
@ -211,27 +254,6 @@ bool TPereta_application::preprocess_page(int file, int counter)
return TRUE;
}
void TPereta_application::header_sezione(TString codsez, TString codsot)
{
const char* densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const char* densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
return;
}
bool TPereta_application::set_print(int)
{
_tipo_stampa = undefined;
@ -255,7 +277,7 @@ bool TPereta_application::set_print(int)
_dataini = _msk->get(F_DATAINI);
_datafin = _msk->get(F_DATAFIN);
filtra_sezioni();
set_categorie();
//set_categorie();
current_cursor()->set_filterfunction (filter_func_pereta);
reset_print();
crea_intestazione();
@ -265,6 +287,7 @@ bool TPereta_application::set_print(int)
return FALSE;
}
/*
void TPereta_application::set_one_cat(short field_id)
{
const char* cat = _msk->get(field_id);
@ -272,6 +295,7 @@ void TPereta_application::set_one_cat(short field_id)
_categorie->add(cat);
}
void TPereta_application::set_categorie()
{
set_one_cat(F_CAT1);
@ -281,6 +305,7 @@ void TPereta_application::set_categorie()
set_one_cat(F_CAT5);
set_one_cat(F_CAT6);
}
*/
void TPereta_application::crea_intestazione()
{
@ -324,8 +349,8 @@ bool TPereta_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==COM");
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");

View File

@ -261,7 +261,8 @@ void TEsclusi_application::crea_intestazione()
if (_tipo_stampa == elenco)
{
TString sep(132);
//TString sep(132);
TString sep(90);
sep = "ELENCO ESCLUSI";
TString tipo = _msk->get(F_TIPO);
if ((tipo.ok()) && (tipo.not_empty()))
@ -281,7 +282,7 @@ void TEsclusi_application::crea_intestazione()
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
set_header(2, "@78g%s", (const char*) sep);
sep = "";
sep.fill('-');
@ -302,8 +303,8 @@ bool TEsclusi_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==COM");
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare le denominazione della sezione nell'intestazione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");

View File

@ -1,407 +1,407 @@
#include <mask.h>
#include <form.h>
#include <printapp.h>
#include <utility.h>
#include "lf.h"
#include "soggetti.h"
#include "sezioni.h"
#include "at2.h"
#include "at2500a.h"
#define ALIAS_LCP 100
#define ALIAS_TCS 200
enum ts { undefined = 0, elenco = 1, etichette = 2 };
// definizione form per etichette
class TEti_idonei_form : public TForm
{
public:
virtual TCursor* cursor() const;
virtual TRelation* relation() const;
TPrint_section& get_body() { return section('B'); } ;
TEti_idonei_form(): TForm() {};
TEti_idonei_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {};
virtual ~TEti_idonei_form() {};
};
class TIdonei_application : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TEti_idonei_form* _form_eti;
int _cur1, _cur2, _cur3, _cur4;
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipo_stampa;
TString _codsez, _codsot;
static bool filter_func_idonei(const TRelation *);
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
public:
void crea_intestazione();
void filtra_sezioni();
void header_sezione(TString codsez, TString codsot);
TMask& app_mask() { return *_msk; }
TIdonei_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TIdonei_application& app() { return (TIdonei_application&) main_app(); }
TCursor* TEti_idonei_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_idonei_form::relation() const { return cursor()->relation(); }
void TIdonei_application::filtra_sezioni()
{
TString sezini = _msk->get(F_SEZINI);
TString sotini = _msk->get(F_SOTINI);
TString sezfin = _msk->get(F_SEZFIN);
TString sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
TRectype da(fl.curr());
TRectype a(fl.curr());
da.zero();
a.zero();
if ((sezini.not_empty()) && (sezini.ok()))
da.put(SOG_CODSEZ, sezini);
if ((sotini.not_empty()) && (sotini.ok()))
da.put(SOG_CODSOT, sotini);
if ((sezfin.not_empty()) && (sezfin.ok()))
a.put(SOG_CODSEZ, sezfin);
if ((sotfin.not_empty()) && (sotfin.ok()))
a.put(SOG_CODSOT, sotfin);
current_cursor()->setregion(da, a);
}
void TIdonei_application::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
{
case etichette:
{
TPrint_section& corpo = _form_eti->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.height(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
case elenco:
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@10g#a", &_cognome_nome);
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID)); // potremmo mettere anche datastato
set_row(1,"@58g@S", FLD(LF_SOGGETTI,SOG_IDON1));
set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_IDON2));
set_row(1,"@64g@S", FLD(LF_SOGGETTI,SOG_IDON3));
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_IDON4));
set_row(2,"@50g@S", FLD(LF_SOGGETTI,SOG_STATO));
}
break;
}
}
bool TIdonei_application::filter_func_idonei(const TRelation * rel)
{
bool filtrato = TRUE;
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
TAssoc_array categorie;
TMask& msk = app().app_mask();
TString cat = msk.get(F_CAT1);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT2);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT3);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT4);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT5);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT6);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
if (categorie.items() != 0)
{
TString catsog = sog->curr().get(SOG_CATDON);
if (categorie.is_key((const char*) catsog))
filtrato = TRUE;
else
filtrato = FALSE;
}
if (filtrato)
{
TAssoc_array idoneita;
TString idonsog = sog->curr().get(SOG_IDON1);
if (idonsog.not_empty() && idonsog.ok())
idoneita.add((const char*) idonsog);
idonsog = sog->curr().get(SOG_IDON2);
if (idonsog.not_empty() && idonsog.ok())
idoneita.add((const char*) idonsog);
idonsog = sog->curr().get(SOG_IDON3);
if (idonsog.not_empty() && idonsog.ok())
idoneita.add((const char*) idonsog);
idonsog = sog->curr().get(SOG_IDON4);
if (idonsog.not_empty() && idonsog.ok())
idoneita.add((const char*) idonsog);
if (idoneita.items() != 0)
{
TString idon = msk.get(F_IDON1);
if (idon.not_empty() && idon.ok())
if (idoneita.is_key((const char*) idon))
filtrato = TRUE;
else
filtrato = FALSE;
if (filtrato)
{
TString idon = msk.get(F_IDON2);
if (idon.not_empty() && idon.ok())
if (idoneita.is_key((const char*) idon))
filtrato = TRUE;
else
filtrato = FALSE;
}
if (filtrato)
{
TString idon = msk.get(F_IDON3);
if (idon.not_empty() && idon.ok())
if (idoneita.is_key((const char*) idon))
filtrato = TRUE;
else
filtrato = FALSE;
}
if (filtrato)
{
TString idon = msk.get(F_IDON4);
if (idon.not_empty() && idon.ok())
if (idoneita.is_key((const char*) idon))
filtrato = TRUE;
else
filtrato = FALSE;
}
}
}
return filtrato;
}
bool TIdonei_application::preprocess_page(int file, int counter)
{
// contatore soggetti stampati
// per ora non c'è
if (_tipo_stampa == elenco)
{
TString nome = current_cursor()->curr().get(SOG_COGNOME);
nome << " ";
nome << current_cursor()->curr().get(SOG_NOME);
_cognome_nome = nome;
// salto pagina se cambio sezione
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
if ((_codsez!=codsez)||(_codsot!=codsot))
{
//if (!_codsez.blank())
if (_codsez != "**")
printer().formfeed();
_codsez = codsez;
_codsot = codsot;
header_sezione(codsez, codsot);
}
}
return TRUE;
}
void TIdonei_application::header_sezione(TString codsez, TString codsot)
{
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
return;
}
bool TIdonei_application::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_ELENCO:
_tipo_stampa = elenco;
//_codsez.spaces(2);
//_codsot.spaces(2);
_codsez = "**";
_codsot = "**";
break;
case F_ETICHETTE:
_tipo_stampa = etichette;
break;
}
if (_tipo_stampa != undefined)
{
reset_files();
add_file(LF_SOGGETTI);
// filtro per sezioni selezionati
filtra_sezioni();
// filtro per tipo idoneità
TString tipoid = _msk->get(F_TIPO);
if (tipoid.not_empty() && tipoid.ok())
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)tipoid));
else
current_cursor()->setfilter("(TCS->S6 == \"I\") || (TCS->S6 == \"F\")", TRUE);
// filtro per categorie
current_cursor()->set_filterfunction(filter_func_idonei);
reset_print();
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TIdonei_application::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
sep = "ELENCO IDONEI";
TString tipo = _msk->get(F_TIPO);
if ((tipo.ok()) && (tipo.not_empty()))
{
sep << ": tipo ";
sep << tipo;
TString dtipo = _msk->get(F_D_TIPO);
sep << " ";
sep << dtipo;
}
TString idon = _msk->get(F_IDON1);
if ((idon.ok()) && (idon.not_empty()))
{
sep << " per ";
sep << idon;
}
idon = _msk->get(F_IDON2);
if ((idon.ok()) && (idon.not_empty()))
{
sep << " ";
sep << idon;
}
idon = _msk->get(F_IDON3);
if ((idon.ok()) && (idon.not_empty()))
{
sep << " ";
sep << idon;
}
idon = _msk->get(F_IDON4);
if ((idon.ok()) && (idon.not_empty()))
{
sep << " ";
sep << idon;
}
sep.center_just();
set_header(2, "@0g%s", (const char*) sep);
TString data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData ID@58gTipi idon.");
set_header(5,"@47gTipo/Esito");
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g-- -- -- --");
}
}
bool TIdonei_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==COM");
// per stampare la denominazione della sezione nell'intestazione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_msk = new TMask("at2500a");
_form_eti = new TEti_idonei_form("AT_ETSOG");
return TRUE;
}
bool TIdonei_application::user_destroy()
{
delete _msk;
delete _rel;
delete _form_eti;
return TRUE;
}
int at2500(int argc, char* argv[])
{
TIdonei_application a;
a.run(argc, argv, "Elenco idonei");
return 0;
}
#include <mask.h>
#include <form.h>
#include <printapp.h>
#include <utility.h>
#include "lf.h"
#include "soggetti.h"
#include "sezioni.h"
#include "at2.h"
#include "at2500a.h"
#define ALIAS_LCP 100
#define ALIAS_TCS 200
enum ts { undefined = 0, elenco = 1, etichette = 2 };
// definizione form per etichette
class TEti_idonei_form : public TForm
{
public:
virtual TCursor* cursor() const;
virtual TRelation* relation() const;
TPrint_section& get_body() { return section('B'); } ;
TEti_idonei_form(): TForm() {};
TEti_idonei_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {};
virtual ~TEti_idonei_form() {};
};
class TIdonei_application : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TEti_idonei_form* _form_eti;
int _cur1, _cur2, _cur3, _cur4;
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipo_stampa;
TString _codsez, _codsot;
static bool filter_func_idonei(const TRelation *);
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
public:
void crea_intestazione();
void filtra_sezioni();
void header_sezione(TString codsez, TString codsot);
TMask& app_mask() { return *_msk; }
TIdonei_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TIdonei_application& app() { return (TIdonei_application&) main_app(); }
TCursor* TEti_idonei_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_idonei_form::relation() const { return cursor()->relation(); }
void TIdonei_application::filtra_sezioni()
{
TString sezini = _msk->get(F_SEZINI);
TString sotini = _msk->get(F_SOTINI);
TString sezfin = _msk->get(F_SEZFIN);
TString sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
TRectype da(fl.curr());
TRectype a(fl.curr());
da.zero();
a.zero();
if ((sezini.not_empty()) && (sezini.ok()))
da.put(SOG_CODSEZ, sezini);
if ((sotini.not_empty()) && (sotini.ok()))
da.put(SOG_CODSOT, sotini);
if ((sezfin.not_empty()) && (sezfin.ok()))
a.put(SOG_CODSEZ, sezfin);
if ((sotfin.not_empty()) && (sotfin.ok()))
a.put(SOG_CODSOT, sotfin);
current_cursor()->setregion(da, a);
}
void TIdonei_application::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
{
case etichette:
{
TPrint_section& corpo = _form_eti->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.height(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
case elenco:
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@10g#a", &_cognome_nome);
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID)); // potremmo mettere anche datastato
set_row(1,"@58g@S", FLD(LF_SOGGETTI,SOG_IDON1));
set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_IDON2));
set_row(1,"@64g@S", FLD(LF_SOGGETTI,SOG_IDON3));
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_IDON4));
set_row(2,"@50g@S", FLD(LF_SOGGETTI,SOG_STATO));
}
break;
}
}
bool TIdonei_application::filter_func_idonei(const TRelation * rel)
{
bool filtrato = TRUE;
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
TAssoc_array categorie;
TMask& msk = app().app_mask();
TString cat = msk.get(F_CAT1);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT2);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT3);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT4);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT5);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
cat = msk.get(F_CAT6);
if (cat.not_empty() && cat.ok())
categorie.add((const char*) cat);
if (categorie.items() != 0)
{
TString catsog = sog->curr().get(SOG_CATDON);
if (categorie.is_key((const char*) catsog))
filtrato = TRUE;
else
filtrato = FALSE;
}
if (filtrato)
{
TAssoc_array idoneita;
TString idonsog = sog->curr().get(SOG_IDON1);
if (idonsog.not_empty() && idonsog.ok())
idoneita.add((const char*) idonsog);
idonsog = sog->curr().get(SOG_IDON2);
if (idonsog.not_empty() && idonsog.ok())
idoneita.add((const char*) idonsog);
idonsog = sog->curr().get(SOG_IDON3);
if (idonsog.not_empty() && idonsog.ok())
idoneita.add((const char*) idonsog);
idonsog = sog->curr().get(SOG_IDON4);
if (idonsog.not_empty() && idonsog.ok())
idoneita.add((const char*) idonsog);
if (idoneita.items() != 0)
{
TString idon = msk.get(F_IDON1);
if (idon.not_empty() && idon.ok())
if (idoneita.is_key((const char*) idon))
filtrato = TRUE;
else
filtrato = FALSE;
if (filtrato)
{
TString idon = msk.get(F_IDON2);
if (idon.not_empty() && idon.ok())
if (idoneita.is_key((const char*) idon))
filtrato = TRUE;
else
filtrato = FALSE;
}
if (filtrato)
{
TString idon = msk.get(F_IDON3);
if (idon.not_empty() && idon.ok())
if (idoneita.is_key((const char*) idon))
filtrato = TRUE;
else
filtrato = FALSE;
}
if (filtrato)
{
TString idon = msk.get(F_IDON4);
if (idon.not_empty() && idon.ok())
if (idoneita.is_key((const char*) idon))
filtrato = TRUE;
else
filtrato = FALSE;
}
}
}
return filtrato;
}
bool TIdonei_application::preprocess_page(int file, int counter)
{
// contatore soggetti stampati
// per ora non c'è
if (_tipo_stampa == elenco)
{
TString nome = current_cursor()->curr().get(SOG_COGNOME);
nome << " ";
nome << current_cursor()->curr().get(SOG_NOME);
_cognome_nome = nome;
// salto pagina se cambio sezione
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
if ((_codsez!=codsez)||(_codsot!=codsot))
{
//if (!_codsez.blank())
if (_codsez != "**")
printer().formfeed();
_codsez = codsez;
_codsot = codsot;
header_sezione(codsez, codsot);
}
}
return TRUE;
}
void TIdonei_application::header_sezione(TString codsez, TString codsot)
{
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
return;
}
bool TIdonei_application::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_ELENCO:
_tipo_stampa = elenco;
//_codsez.spaces(2);
//_codsot.spaces(2);
_codsez = "**";
_codsot = "**";
break;
case F_ETICHETTE:
_tipo_stampa = etichette;
break;
}
if (_tipo_stampa != undefined)
{
reset_files();
add_file(LF_SOGGETTI);
// filtro per sezioni selezionati
filtra_sezioni();
// filtro per tipo idoneità
TString tipoid = _msk->get(F_TIPO);
if (tipoid.not_empty() && tipoid.ok())
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)tipoid));
else
current_cursor()->setfilter("(TCS->S6 == \"I\") || (TCS->S6 == \"F\")", TRUE);
// filtro per categorie
current_cursor()->set_filterfunction(filter_func_idonei);
reset_print();
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TIdonei_application::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
sep = "ELENCO IDONEI";
TString tipo = _msk->get(F_TIPO);
if ((tipo.ok()) && (tipo.not_empty()))
{
sep << ": tipo ";
sep << tipo;
TString dtipo = _msk->get(F_D_TIPO);
sep << " ";
sep << dtipo;
}
TString idon = _msk->get(F_IDON1);
if ((idon.ok()) && (idon.not_empty()))
{
sep << " per ";
sep << idon;
}
idon = _msk->get(F_IDON2);
if ((idon.ok()) && (idon.not_empty()))
{
sep << " ";
sep << idon;
}
idon = _msk->get(F_IDON3);
if ((idon.ok()) && (idon.not_empty()))
{
sep << " ";
sep << idon;
}
idon = _msk->get(F_IDON4);
if ((idon.ok()) && (idon.not_empty()))
{
sep << " ";
sep << idon;
}
sep.center_just();
set_header(2, "@0g%s", (const char*) sep);
TString data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData ID@58gTipi idon.");
set_header(5,"@47gTipo/Esito");
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g-- -- -- --");
}
}
bool TIdonei_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_rel->add("LCP", "CODTAB==DOM_COLOC",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare la denominazione della sezione nell'intestazione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_msk = new TMask("at2500a");
_form_eti = new TEti_idonei_form("AT_ETSOG");
return TRUE;
}
bool TIdonei_application::user_destroy()
{
delete _msk;
delete _rel;
delete _form_eti;
return TRUE;
}
int at2500(int argc, char* argv[])
{
TIdonei_application a;
a.run(argc, argv, "Elenco idonei");
return 0;
}

View File

@ -1,355 +1,355 @@
#include <mask.h>
#include <form.h>
#include <printapp.h>
#include <utility.h>
#include "lf.h"
#include "soggetti.h"
#include "sezioni.h"
#include "at2.h"
#include "at2600a.h"
#define ALIAS_LCP 100
//#define ALIAS_TCS 200
#define ISCRITTI 'I'
enum ts { undefined = 0, elenco = 1, etichette = 2 };
// definizione form per etichette
class TEti_iscritti_form : public TForm
{
public:
virtual TCursor* cursor() const;
virtual TRelation* relation() const;
TPrint_section& get_body() { return section('B'); } ;
TEti_iscritti_form(): TForm() {};
TEti_iscritti_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {};
virtual ~TEti_iscritti_form() {};
};
class TIscritti_application : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TEti_iscritti_form* _form_eti;
int _cur1, _cur2, _cur3, _cur4;
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipo_stampa;
TString _codsez, _codsot;
char _tipo_iscdim; // iscritti o dimessi
TDate _dataini, _datafin;
static bool filter_func_iscritti(const TRelation *);
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
public:
void crea_intestazione();
void filtra_sezioni();
void header_sezione(TString codsez, TString codsot);
TMask& app_mask() { return *_msk; }
TIscritti_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TIscritti_application& app() { return (TIscritti_application&) main_app(); }
TCursor* TEti_iscritti_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_iscritti_form::relation() const { return cursor()->relation(); }
void TIscritti_application::filtra_sezioni()
{
TString sezini = _msk->get(F_SEZINI);
TString sotini = _msk->get(F_SOTINI);
TString sezfin = _msk->get(F_SEZFIN);
TString sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
TRectype da(fl.curr());
TRectype a(fl.curr());
da.zero();
a.zero();
if ((sezini.not_empty()) && (sezini.ok()))
da.put(SOG_CODSEZ, sezini);
if ((sotini.not_empty()) && (sotini.ok()))
da.put(SOG_CODSOT, sotini);
if ((sezfin.not_empty()) && (sezfin.ok()))
a.put(SOG_CODSEZ, sezfin);
if ((sotfin.not_empty()) && (sotfin.ok()))
a.put(SOG_CODSOT, sotfin);
current_cursor()->setregion(da, a);
}
void TIscritti_application::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
{
case etichette:
{
TPrint_section& corpo = _form_eti->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.height(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
case elenco:
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@10g#a", &_cognome_nome);
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAISC));
set_row(1,"@58g@ld", FLD(LF_SOGGETTI,SOG_DATADIM));
}
break;
}
}
bool TIscritti_application::filter_func_iscritti(const TRelation * rel)
{
bool filtrato = TRUE;
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
TAssoc_array 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);
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)
{
TString cat = sog->curr().get(SOG_CATDON);
if (categorie.is_key((const char*) cat))
filtrato = TRUE;
else
filtrato = FALSE;
}
if (filtrato)
{
TRectype from (sog->curr());
TRectype to (sog->curr());
from.zero();
to.zero();
if (app()._tipo_iscdim == ISCRITTI)
{
from.put(SOG_DATAISC, app()._dataini);
to.put(SOG_DATAISC, app()._datafin);
if ((sog->curr() >= from) && (sog->curr() <= to))
filtrato = TRUE;
else
filtrato = FALSE;
}
else
{
from.put(SOG_DATADIM, app()._dataini);
to.put(SOG_DATADIM, app()._datafin);
if ((sog->curr() >= from) && (sog->curr() <= to))
filtrato = TRUE;
else
filtrato = FALSE;
}
}
return filtrato;
}
bool TIscritti_application::preprocess_page(int file, int counter)
{
// contatore soggetti stampati
// per ora non c'è
if (_tipo_stampa == elenco)
{
TString nome = current_cursor()->curr().get(SOG_COGNOME);
nome << " ";
nome << current_cursor()->curr().get(SOG_NOME);
_cognome_nome = nome;
// salto pagina se cambio sezione
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
if ((_codsez!=codsez)||(_codsot!=codsot))
{
//if (!_codsez.blank())
if (_codsez != "**")
printer().formfeed();
_codsez = codsez;
_codsot = codsot;
header_sezione(codsez, codsot);
}
}
return TRUE;
}
void TIscritti_application::header_sezione(TString codsez, TString codsot)
{
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
return;
}
bool TIscritti_application::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_ELENCO:
_tipo_stampa = elenco;
//_codsez.spaces(2);
//_codsot.spaces(2);
_codsez = "**";
_codsot = "**";
break;
case F_ETICHETTE:
_tipo_stampa = etichette;
break;
}
if (_tipo_stampa != undefined)
{
reset_files();
add_file(LF_SOGGETTI);
_tipo_iscdim = _msk->get(F_TIPO)[0];
_dataini = _msk->get(F_DATAINI);
_datafin = _msk->get(F_DATAFIN);
// filtro per sezioni selezionati
filtra_sezioni();
// filtro per categorie
current_cursor()->set_filterfunction(filter_func_iscritti);
reset_print();
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TIscritti_application::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
sep = "ELENCO ";
if (_tipo_iscdim == ISCRITTI)
sep << "ISCRITTI";
else
sep << "DIMESSI";
if (_dataini.ok())
{
sep << " dal ";
sep << _dataini.string();
}
if (_datafin.ok())
{
sep << " al ";
sep << _datafin.string();
}
sep.center_just();
set_header(2, "@0g%s", (const char*) sep);
TString data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData isc.@58gData dim.");
set_header(5,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g----------");
}
}
bool TIscritti_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
//_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==COM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_msk = new TMask("at2600a");
_form_eti = new TEti_iscritti_form("AT_ETSOG");
return TRUE;
}
bool TIscritti_application::user_destroy()
{
delete _msk;
delete _rel;
delete _form_eti;
return TRUE;
}
int at2600(int argc, char* argv[])
{
TIscritti_application a;
a.run(argc, argv, "Elenco iscritti/dimessi");
return 0;
}
#include <mask.h>
#include <form.h>
#include <printapp.h>
#include <utility.h>
#include "lf.h"
#include "soggetti.h"
#include "sezioni.h"
#include "at2.h"
#include "at2600a.h"
#define ALIAS_LCP 100
//#define ALIAS_TCS 200
#define ISCRITTI 'I'
enum ts { undefined = 0, elenco = 1, etichette = 2 };
// definizione form per etichette
class TEti_iscritti_form : public TForm
{
public:
virtual TCursor* cursor() const;
virtual TRelation* relation() const;
TPrint_section& get_body() { return section('B'); } ;
TEti_iscritti_form(): TForm() {};
TEti_iscritti_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {};
virtual ~TEti_iscritti_form() {};
};
class TIscritti_application : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TEti_iscritti_form* _form_eti;
int _cur1, _cur2, _cur3, _cur4;
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipo_stampa;
TString _codsez, _codsot;
char _tipo_iscdim; // iscritti o dimessi
TDate _dataini, _datafin;
static bool filter_func_iscritti(const TRelation *);
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
public:
void crea_intestazione();
void filtra_sezioni();
void header_sezione(TString codsez, TString codsot);
TMask& app_mask() { return *_msk; }
TIscritti_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TIscritti_application& app() { return (TIscritti_application&) main_app(); }
TCursor* TEti_iscritti_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_iscritti_form::relation() const { return cursor()->relation(); }
void TIscritti_application::filtra_sezioni()
{
TString sezini = _msk->get(F_SEZINI);
TString sotini = _msk->get(F_SOTINI);
TString sezfin = _msk->get(F_SEZFIN);
TString sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
TRectype da(fl.curr());
TRectype a(fl.curr());
da.zero();
a.zero();
if ((sezini.not_empty()) && (sezini.ok()))
da.put(SOG_CODSEZ, sezini);
if ((sotini.not_empty()) && (sotini.ok()))
da.put(SOG_CODSOT, sotini);
if ((sezfin.not_empty()) && (sezfin.ok()))
a.put(SOG_CODSEZ, sezfin);
if ((sotfin.not_empty()) && (sotfin.ok()))
a.put(SOG_CODSOT, sotfin);
current_cursor()->setregion(da, a);
}
void TIscritti_application::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
{
case etichette:
{
TPrint_section& corpo = _form_eti->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.height(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
case elenco:
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@10g#a", &_cognome_nome);
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAISC));
set_row(1,"@58g@ld", FLD(LF_SOGGETTI,SOG_DATADIM));
}
break;
}
}
bool TIscritti_application::filter_func_iscritti(const TRelation * rel)
{
bool filtrato = TRUE;
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
TAssoc_array 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);
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)
{
TString cat = sog->curr().get(SOG_CATDON);
if (categorie.is_key((const char*) cat))
filtrato = TRUE;
else
filtrato = FALSE;
}
if (filtrato)
{
TRectype from (sog->curr());
TRectype to (sog->curr());
from.zero();
to.zero();
if (app()._tipo_iscdim == ISCRITTI)
{
from.put(SOG_DATAISC, app()._dataini);
to.put(SOG_DATAISC, app()._datafin);
if ((sog->curr() >= from) && (sog->curr() <= to))
filtrato = TRUE;
else
filtrato = FALSE;
}
else
{
from.put(SOG_DATADIM, app()._dataini);
to.put(SOG_DATADIM, app()._datafin);
if ((sog->curr() >= from) && (sog->curr() <= to))
filtrato = TRUE;
else
filtrato = FALSE;
}
}
return filtrato;
}
bool TIscritti_application::preprocess_page(int file, int counter)
{
// contatore soggetti stampati
// per ora non c'è
if (_tipo_stampa == elenco)
{
TString nome = current_cursor()->curr().get(SOG_COGNOME);
nome << " ";
nome << current_cursor()->curr().get(SOG_NOME);
_cognome_nome = nome;
// salto pagina se cambio sezione
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
if ((_codsez!=codsez)||(_codsot!=codsot))
{
//if (!_codsez.blank())
if (_codsez != "**")
printer().formfeed();
_codsez = codsez;
_codsot = codsot;
header_sezione(codsez, codsot);
}
}
return TRUE;
}
void TIscritti_application::header_sezione(TString codsez, TString codsot)
{
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
return;
}
bool TIscritti_application::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_ELENCO:
_tipo_stampa = elenco;
//_codsez.spaces(2);
//_codsot.spaces(2);
_codsez = "**";
_codsot = "**";
break;
case F_ETICHETTE:
_tipo_stampa = etichette;
break;
}
if (_tipo_stampa != undefined)
{
reset_files();
add_file(LF_SOGGETTI);
_tipo_iscdim = _msk->get(F_TIPO)[0];
_dataini = _msk->get(F_DATAINI);
_datafin = _msk->get(F_DATAFIN);
// filtro per sezioni selezionati
filtra_sezioni();
// filtro per categorie
current_cursor()->set_filterfunction(filter_func_iscritti);
reset_print();
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TIscritti_application::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
sep = "ELENCO ";
if (_tipo_iscdim == ISCRITTI)
sep << "ISCRITTI";
else
sep << "DIMESSI";
if (_dataini.ok())
{
sep << " dal ";
sep << _dataini.string();
}
if (_datafin.ok())
{
sep << " al ";
sep << _datafin.string();
}
sep.center_just();
set_header(2, "@0g%s", (const char*) sep);
TString data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData isc.@58gData dim.");
set_header(5,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g----------");
}
}
bool TIscritti_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
//_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_msk = new TMask("at2600a");
_form_eti = new TEti_iscritti_form("AT_ETSOG");
return TRUE;
}
bool TIscritti_application::user_destroy()
{
delete _msk;
delete _rel;
delete _form_eti;
return TRUE;
}
int at2600(int argc, char* argv[])
{
TIscritti_application a;
a.run(argc, argv, "Elenco iscritti/dimessi");
return 0;
}

View File

@ -1,458 +1,458 @@
#include <mask.h>
#include <msksheet.h>
#include <form.h>
#include <printapp.h>
#include "lf.h"
#include "soggetti.h"
#include "sezioni.h"
#include "at3.h"
#include "at3100a.h"
#define ALIAS_TABCTD 100 // alias tabella categorie donatori
#define ALIAS_TABTCS 200 // alias tabella tipi/esiti controlli sanitari
#define ALIAS_TABLCP 300 // alias tabella località postali
#define STATO_IDONEO 'I' // IDONEITA'
#define STATO_FINESO 'F' // FINE SOSPENSIONE
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 };
// definizione form per etichette e cartoline
class TConv_form : public TForm
{
public:
virtual TCursor* cursor() const;
virtual TRelation* relation() const;
TPrint_section& get_body() { return section('B'); } ;
TConv_form(): TForm() {};
TConv_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {};
virtual ~TConv_form() {};
};
class TConv_application : public TPrintapp
{
static bool filter_func_conv(const TRelation *);
TRelation* _rel;
TMask* _msk;
TConv_form* _form_eti; // per etichette
TConv_form* _form_car; // per cartoline
TAssoc_array* _asezioni; // array per controllare che non venga convocata
// 2 volte la stessa sezione/sottogruppo
int _cur1, _cur2, _cur3, _cur4;
TDate _data_stampa;
int _sez_corrente;
ts _tipo_stampa;
bool _intesta;
// completare con tutti i dati selezionabili
TString _codsez, _codsot;
TDate _dataconv;
long _intmin, _intmax;
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual void print();
virtual bool preprocess_page (int file, int counter);
virtual TAssoc_array& get_array_sez() { return *_asezioni; }
static bool check_sez_sheet(const char* codice);
static bool convocazioni_notify(TSheet_field& s, int r, KEY k);
static void add_rows_convocazioni(TSheet_field& s, int count = 10, int start = 1);
public:
void crea_intestazione();
void filtra_sezione();
void header_sezione();
TConv_application() : _data_stampa(TODAY) {}
};
HIDDEN inline TConv_application& app() { return (TConv_application&) main_app(); }
TCursor* TConv_form::cursor() const { return app().current_cursor(); }
TRelation* TConv_form::relation() const { return cursor()->relation(); }
void TConv_application::add_rows_convocazioni(TSheet_field& s, int count, int start)
{
if (start == 1)
s.destroy();
for (int r=start; r<start+count; r++)
TToken_string& row = s.row(r-1);
}
void TConv_application::set_page(int file, int cnt)
{
switch (_tipo_stampa)
{
case elenco:
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@13g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@39g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@50g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSSI));
set_row(1,"@61g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSAF));
set_row(1,"@72g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
set_row(1,"@83g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID));
set_row(1,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON1));
set_row(1,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON2));
set_row(2,"@13g@S", FLD(LF_SOGGETTI,SOG_NOME));
set_row(2,"@53g@pn", FLD(LF_SOGGETTI,SOG_INTSI,"###"));
set_row(2,"@64g@pn", FLD(LF_SOGGETTI,SOG_INTAF,"###"));
set_row(2,"@76g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
set_row(2,"@87g@S", FLD(LF_SOGGETTI,SOG_TIPOULTID));
set_row(2,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON3));
set_row(2,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON4));
}
break;
case etichette:
{
TPrint_section& corpo = _form_eti->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.items(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,"%s",riga.row());
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
case cartoline:
{
TPrint_section& corpo = _form_car->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.items(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,"%s",riga.row());
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
}
}
bool TConv_application::filter_func_conv (const TRelation * rel)
{
TLocalisamfile& sog = rel->lfile(LF_SOGGETTI);
TDate dataprossi = sog.curr().get_date(SOG_DATAPROSSI);
const char stato = rel->curr(-ALIAS_TABTCS).get_char("S6");
const bool dimesso = rel->curr(-ALIAS_TABCTD).get_char("B0");
//TDate dataultconv = sog.curr().get_date(SOG_DATAULTCONV);
if (dataprossi.ok())
{
// intervallo tra data convocazione e data calcolata per pross. si
long intconvsi = app()._dataconv - dataprossi;
// intervallo tra data convocazione e data ultima convocazione
//long intultconvsi = app()._data - dataultconv;
if ((intconvsi >= 0) && (intconvsi < app()._intmax) && ((stato == STATO_IDONEO) || (stato == STATO_FINESO)) && (dimesso != 'X'))
return TRUE;
else
return FALSE;
}
else
// non ha la data di prossima donazione SI
return FALSE;
}
bool TConv_application::preprocess_page(int file, int counter)
{
if ((_tipo_stampa == elenco) && (!_intesta))
{
_intesta = TRUE;
header_sezione();
}
// contatore soggetti stampati
return TRUE;
}
void TConv_application::print()
{
_intesta = FALSE;
filtra_sezione();
TPrint_application::print();
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
_sez_corrente++;
if (_sez_corrente <= s.items())
repeat_print();
return;
}
void TConv_application::filtra_sezione()
{
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
TToken_string& row = s.row(_sez_corrente-1);
_codsez = row.get(0);
_codsot = row.get();
_dataconv = row.get();
// deve diventare un membro
TString _giorno = row.get();
_intmin = row.get_int();
_intmax = row.get_int();
// deve diventare un membro
TString _tipoconv = row.get();
select_cursor(_cur4);
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
TRectype da(fl.curr());
TRectype a(fl.curr());
da.zero();
a.zero('Z');
if ((_codsez.not_empty()) && (_codsez.ok()))
{
da.put(SOG_CODSEZ, _codsez);
a.put(SOG_CODSEZ, _codsez);
}
if ((_codsot.not_empty()) && (_codsot.ok()))
{
da.put(SOG_CODSOT, _codsot);
a.put(SOG_CODSOT, _codsot);
}
current_cursor()->freeze(FALSE);
current_cursor()->setregion(da, a);
}
bool TConv_application::set_print(int)
{
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
if (s.items()==0)
add_rows_convocazioni(s,8);
_asezioni->destroy();
for (int r=0; r < s.items(); r++)
{
TToken_string& row = s.row(r);
TString codice = row.get(0);
TString codsot = row.get();
codice << codsot;
if (codice.not_empty())
_asezioni->add(codice);
}
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_ELENCO:
_tipo_stampa = elenco;
break;
case F_ETICHETTE:
_tipo_stampa = etichette;
break;
case F_CARTOLINE:
_tipo_stampa = cartoline;
break;
case K_ESC:
_msk->reset();
}
if (_tipo_stampa != undefined)
{
reset_files();
add_file(LF_SOGGETTI);
select_cursor(_cur4);
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
for (int r=s.items()-1; r>=s.first_empty(); r--)
{
TToken_string& row = s.row(r);
_codsez = row.get(0);
_codsot = row.get();
if (_codsez.empty() || (!_codsez.ok()))
s.destroy(r);
}
// filtro su non esclusi, idonei e categorie non dimessi
// questo filtro non funziona perchè non funziona il riconoscimento dell'alias
// nelle espressioni; sarebbe molto bello averlo a disposizione!
//current_cursor()->setfilter("((ESCLUSO == \"\") && (-100->B0!=\"X\") && ((-200->S6 == \"I\") || (-200->S6 == \"F\")))", TRUE);
// filtro su non esclusi
current_cursor()->setfilter("(ESCLUSO == \"\")", TRUE);
// filtro su data e altri filtri che non posso mettere nella setfilter
current_cursor()->set_filterfunction (filter_func_conv, TRUE);
reset_print();
_sez_corrente = 1;
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TConv_application::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(5,"@0gCod.@10gC.@13gCognome@39gNato il@50gData pr.SI@61gData pr.AF@72gData/Tipo@83gData/Tipo@94gIdon.");
set_header(6,"@13gNome@50gInterv. SI@61gInterv. AF@72gult. don.@83gult. idon.@94gper");
set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g----------@61g----------@72g----------@83g----------@94g-----");
}
}
void TConv_application::header_sezione()
{
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << _codsez;
intestazione << "/";
intestazione << _codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
intestazione = "ELENCO CONVOCATI PER IL ";
intestazione << _dataconv.string();
intestazione.center_just();
set_header(2, "@0g%s", (const char*) intestazione);
TString data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
intestazione = "";
intestazione << "Pag. @#";
set_header(2, "@120g%s", (const char*) intestazione);
return;
}
bool TConv_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO", 1, 0, ALIAS_TABTCS); // per verificare che sia IDONEO
_rel->add("CTD", "CODTAB==CATDON", 1, 0, ALIAS_TABCTD); // per verificare che sia DONATORE NON DIMESSO
_rel->add("LCP", "CODTAB==LOCALITA", 1, 0, ALIAS_TABLCP); // per verificare che sia DONATORE NON DIMESSO
_rel->add(LF_COMUNI, "COM==COM");
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_msk = new TMask("at3100a");
TSheet_field& sc = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
sc.set_notify(convocazioni_notify);
_form_eti = new TConv_form("AT_ETSOG");
_form_car = new TConv_form("AT_CARTO");
_asezioni = new TAssoc_array();
return TRUE;
}
bool TConv_application::user_destroy()
{
delete _msk;
delete _rel;
delete _form_eti;
delete _form_car;
delete _asezioni;
return TRUE;
}
bool TConv_application::check_sez_sheet(const char* codice)
{
TAssoc_array& array_sez = app().get_array_sez();
if (array_sez.is_key(codice))
return FALSE;
else
{
array_sez.add(codice);
return TRUE;
}
}
bool TConv_application::convocazioni_notify(TSheet_field& s, int r, KEY k)
{
bool ok = TRUE;
switch (k)
{
case K_TAB:
// entrata riga
{
TToken_string& row = s.row(r);
TString codice = row.get(0);
TString codsot = row.get();
codice << codsot;
if (codice.not_empty())
{
TAssoc_array& array_sez = app().get_array_sez();
if (array_sez.is_key(codice))
array_sez.remove(codice);
}
if ((r == s.items()-1) && (r == s.first_empty()))
{
add_rows_convocazioni(s,8,r+1);
s.select(r);
}
}
break;
case K_CTRL+K_TAB:
// uscita riga
{
TToken_string& row = s.row(r);
TString codice = row.get(0);
TString codsot = row.get();
codice << codsot;
if (codice.not_empty())
{
ok = check_sez_sheet(codice);
if (!ok)
return s.error_box("Sezione già convocata");
}
if ((r == s.items()-1) && (r == s.first_empty()))
{
add_rows_convocazioni(s,8,r+1);
s.select(r);
}
}
break;
}
return ok;
}
int at3100(int argc, char* argv[])
{
TConv_application a;
a.run(argc, argv, "Convocazioni");
return 0;
}
#include <mask.h>
#include <msksheet.h>
#include <form.h>
#include <printapp.h>
#include "lf.h"
#include "soggetti.h"
#include "sezioni.h"
#include "at3.h"
#include "at3100a.h"
#define ALIAS_TABCTD 100 // alias tabella categorie donatori
#define ALIAS_TABTCS 200 // alias tabella tipi/esiti controlli sanitari
#define ALIAS_TABLCP 300 // alias tabella località postali
#define STATO_IDONEO 'I' // IDONEITA'
#define STATO_FINESO 'F' // FINE SOSPENSIONE
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 };
// definizione form per etichette e cartoline
class TConv_form : public TForm
{
public:
virtual TCursor* cursor() const;
virtual TRelation* relation() const;
TPrint_section& get_body() { return section('B'); } ;
TConv_form(): TForm() {};
TConv_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {};
virtual ~TConv_form() {};
};
class TConv_application : public TPrintapp
{
static bool filter_func_conv(const TRelation *);
TRelation* _rel;
TMask* _msk;
TConv_form* _form_eti; // per etichette
TConv_form* _form_car; // per cartoline
TAssoc_array* _asezioni; // array per controllare che non venga convocata
// 2 volte la stessa sezione/sottogruppo
int _cur1, _cur2, _cur3, _cur4;
TDate _data_stampa;
int _sez_corrente;
ts _tipo_stampa;
bool _intesta;
// completare con tutti i dati selezionabili
TString _codsez, _codsot;
TDate _dataconv;
long _intmin, _intmax;
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual void print();
virtual bool preprocess_page (int file, int counter);
virtual TAssoc_array& get_array_sez() { return *_asezioni; }
static bool check_sez_sheet(const char* codice);
static bool convocazioni_notify(TSheet_field& s, int r, KEY k);
static void add_rows_convocazioni(TSheet_field& s, int count = 10, int start = 1);
public:
void crea_intestazione();
void filtra_sezione();
void header_sezione();
TConv_application() : _data_stampa(TODAY) {}
};
HIDDEN inline TConv_application& app() { return (TConv_application&) main_app(); }
TCursor* TConv_form::cursor() const { return app().current_cursor(); }
TRelation* TConv_form::relation() const { return cursor()->relation(); }
void TConv_application::add_rows_convocazioni(TSheet_field& s, int count, int start)
{
if (start == 1)
s.destroy();
for (int r=start; r<start+count; r++)
TToken_string& row = s.row(r-1);
}
void TConv_application::set_page(int file, int cnt)
{
switch (_tipo_stampa)
{
case elenco:
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@13g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@39g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@50g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSSI));
set_row(1,"@61g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSAF));
set_row(1,"@72g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
set_row(1,"@83g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID));
set_row(1,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON1));
set_row(1,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON2));
set_row(2,"@13g@S", FLD(LF_SOGGETTI,SOG_NOME));
set_row(2,"@53g@pn", FLD(LF_SOGGETTI,SOG_INTSI,"###"));
set_row(2,"@64g@pn", FLD(LF_SOGGETTI,SOG_INTAF,"###"));
set_row(2,"@76g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
set_row(2,"@87g@S", FLD(LF_SOGGETTI,SOG_TIPOULTID));
set_row(2,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON3));
set_row(2,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON4));
}
break;
case etichette:
{
TPrint_section& corpo = _form_eti->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.items(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,"%s",riga.row());
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
case cartoline:
{
TPrint_section& corpo = _form_car->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.items(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,"%s",riga.row());
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
}
}
bool TConv_application::filter_func_conv (const TRelation * rel)
{
TLocalisamfile& sog = rel->lfile(LF_SOGGETTI);
TDate dataprossi = sog.curr().get_date(SOG_DATAPROSSI);
const char stato = rel->curr(-ALIAS_TABTCS).get_char("S6");
const bool dimesso = rel->curr(-ALIAS_TABCTD).get_char("B0");
//TDate dataultconv = sog.curr().get_date(SOG_DATAULTCONV);
if (dataprossi.ok())
{
// intervallo tra data convocazione e data calcolata per pross. si
long intconvsi = app()._dataconv - dataprossi;
// intervallo tra data convocazione e data ultima convocazione
//long intultconvsi = app()._data - dataultconv;
if ((intconvsi >= 0) && (intconvsi < app()._intmax) && ((stato == STATO_IDONEO) || (stato == STATO_FINESO)) && (dimesso != 'X'))
return TRUE;
else
return FALSE;
}
else
// non ha la data di prossima donazione SI
return FALSE;
}
bool TConv_application::preprocess_page(int file, int counter)
{
if ((_tipo_stampa == elenco) && (!_intesta))
{
_intesta = TRUE;
header_sezione();
}
// contatore soggetti stampati
return TRUE;
}
void TConv_application::print()
{
_intesta = FALSE;
filtra_sezione();
TPrint_application::print();
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
_sez_corrente++;
if (_sez_corrente <= s.items())
repeat_print();
return;
}
void TConv_application::filtra_sezione()
{
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
TToken_string& row = s.row(_sez_corrente-1);
_codsez = row.get(0);
_codsot = row.get();
_dataconv = row.get();
// deve diventare un membro
TString _giorno = row.get();
_intmin = row.get_int();
_intmax = row.get_int();
// deve diventare un membro
TString _tipoconv = row.get();
select_cursor(_cur4);
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
TRectype da(fl.curr());
TRectype a(fl.curr());
da.zero();
a.zero('Z');
if ((_codsez.not_empty()) && (_codsez.ok()))
{
da.put(SOG_CODSEZ, _codsez);
a.put(SOG_CODSEZ, _codsez);
}
if ((_codsot.not_empty()) && (_codsot.ok()))
{
da.put(SOG_CODSOT, _codsot);
a.put(SOG_CODSOT, _codsot);
}
current_cursor()->freeze(FALSE);
current_cursor()->setregion(da, a);
}
bool TConv_application::set_print(int)
{
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
if (s.items()==0)
add_rows_convocazioni(s,8);
_asezioni->destroy();
for (int r=0; r < s.items(); r++)
{
TToken_string& row = s.row(r);
TString codice = row.get(0);
TString codsot = row.get();
codice << codsot;
if (codice.not_empty())
_asezioni->add(codice);
}
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_ELENCO:
_tipo_stampa = elenco;
break;
case F_ETICHETTE:
_tipo_stampa = etichette;
break;
case F_CARTOLINE:
_tipo_stampa = cartoline;
break;
case K_ESC:
_msk->reset();
}
if (_tipo_stampa != undefined)
{
reset_files();
add_file(LF_SOGGETTI);
select_cursor(_cur4);
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
for (int r=s.items()-1; r>=s.first_empty(); r--)
{
TToken_string& row = s.row(r);
_codsez = row.get(0);
_codsot = row.get();
if (_codsez.empty() || (!_codsez.ok()))
s.destroy(r);
}
// filtro su non esclusi, idonei e categorie non dimessi
// questo filtro non funziona perchè non funziona il riconoscimento dell'alias
// nelle espressioni; sarebbe molto bello averlo a disposizione!
//current_cursor()->setfilter("((ESCLUSO == \"\") && (-100->B0!=\"X\") && ((-200->S6 == \"I\") || (-200->S6 == \"F\")))", TRUE);
// filtro su non esclusi
current_cursor()->setfilter("(ESCLUSO == \"\")", TRUE);
// filtro su data e altri filtri che non posso mettere nella setfilter
current_cursor()->set_filterfunction (filter_func_conv, TRUE);
reset_print();
_sez_corrente = 1;
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TConv_application::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(5,"@0gCod.@10gC.@13gCognome@39gNato il@50gData pr.SI@61gData pr.AF@72gData/Tipo@83gData/Tipo@94gIdon.");
set_header(6,"@13gNome@50gInterv. SI@61gInterv. AF@72gult. don.@83gult. idon.@94gper");
set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g----------@61g----------@72g----------@83g----------@94g-----");
}
}
void TConv_application::header_sezione()
{
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << _codsez;
intestazione << "/";
intestazione << _codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
intestazione = "ELENCO CONVOCATI PER IL ";
intestazione << _dataconv.string();
intestazione.center_just();
set_header(2, "@0g%s", (const char*) intestazione);
TString data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
intestazione = "";
intestazione << "Pag. @#";
set_header(2, "@120g%s", (const char*) intestazione);
return;
}
bool TConv_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO", 1, 0, ALIAS_TABTCS); // per verificare che sia IDONEO
_rel->add("CTD", "CODTAB==CATDON", 1, 0, ALIAS_TABCTD); // per verificare che sia DONATORE NON DIMESSO
_rel->add("LCP", "CODTAB==DOM_CODLOC", 1, 0, ALIAS_TABLCP); // per verificare che sia DONATORE NON DIMESSO
_rel->add(LF_COMUNI, "COM==DOMC_CODCOM");
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_msk = new TMask("at3100a");
TSheet_field& sc = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
sc.set_notify(convocazioni_notify);
_form_eti = new TConv_form("AT_ETSOG");
_form_car = new TConv_form("AT_CARTO");
_asezioni = new TAssoc_array();
return TRUE;
}
bool TConv_application::user_destroy()
{
delete _msk;
delete _rel;
delete _form_eti;
delete _form_car;
delete _asezioni;
return TRUE;
}
bool TConv_application::check_sez_sheet(const char* codice)
{
TAssoc_array& array_sez = app().get_array_sez();
if (array_sez.is_key(codice))
return FALSE;
else
{
array_sez.add(codice);
return TRUE;
}
}
bool TConv_application::convocazioni_notify(TSheet_field& s, int r, KEY k)
{
bool ok = TRUE;
switch (k)
{
case K_TAB:
// entrata riga
{
TToken_string& row = s.row(r);
TString codice = row.get(0);
TString codsot = row.get();
codice << codsot;
if (codice.not_empty())
{
TAssoc_array& array_sez = app().get_array_sez();
if (array_sez.is_key(codice))
array_sez.remove(codice);
}
if ((r == s.items()-1) && (r == s.first_empty()))
{
add_rows_convocazioni(s,8,r+1);
s.select(r);
}
}
break;
case K_CTRL+K_TAB:
// uscita riga
{
TToken_string& row = s.row(r);
TString codice = row.get(0);
TString codsot = row.get();
codice << codsot;
if (codice.not_empty())
{
ok = check_sez_sheet(codice);
if (!ok)
return s.error_box("Sezione già convocata");
}
if ((r == s.items()-1) && (r == s.first_empty()))
{
add_rows_convocazioni(s,8,r+1);
s.select(r);
}
}
break;
}
return ok;
}
int at3100(int argc, char* argv[])
{
TConv_application a;
a.run(argc, argv, "Convocazioni");
return 0;
}

View File

@ -1,218 +1,218 @@
#include <mask.h>
#include <form.h>
#include <printapp.h>
#include "lf.h"
#include "soggetti.h"
#include "sezioni.h"
#include <comuni.h>
#include "at3.h"
#include "at3200a.h"
#define ALIAS_COMRES 100
#define ALIAS_COMNAS 200
enum ts { undefined = 0, tessere = 1, pagine = 2 };
// definizione form per pagine anagrafiche
class TTessere_form : public TForm
{
public:
virtual TCursor* cursor() const;
virtual TRelation* relation() const;
TPrint_section& get_body() { return section('B'); } ;
TTessere_form(): TForm() {};
TTessere_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {};
virtual ~TTessere_form() {};
};
class TTessere_application : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TTessere_form* _form_pag;
int _cur1, _cur2, _cur3, _cur4;
TDate _data_stampa;
ts _tipo_stampa;
TString _riepilogodon;
static bool filter_func_tessere(const TRelation *);
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
public:
void crea_intestazione();
TMask& app_mask() { return *_msk; }
TTessere_application() : _data_stampa(TODAY), _riepilogodon(50) {}
};
HIDDEN inline TTessere_application& app() { return (TTessere_application&) main_app(); }
TCursor* TTessere_form::cursor() const { return app().current_cursor(); }
TRelation* TTessere_form::relation() const { return cursor()->relation(); }
void TTessere_application::set_page(int file, int cnt)
{
// costruzione pagine
switch (_tipo_stampa)
{
case pagine:
{
TPrint_section& corpo = _form_pag->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.items(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,"%s",riga.row());
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
case tessere:
{
TString data_stampa = _data_stampa.string();
set_row(3, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSEZ));
set_row(4, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSOT));
set_row(9,"@33g%s@1j@pn", "Cod. prov.",FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
set_row(12,"@37g@10ls", FLD(LF_SOGGETTI,SOG_TESSAVIS));
set_row(14,"@45g%10s", (const char*) data_stampa);
set_row(16,"@8g@ls@1j@ls", FLD(LF_SOGGETTI,SOG_COGNOME), FLD(LF_SOGGETTI,SOG_NOME));
set_row(18,"@8g@ls@1j@2s", FLD(-ALIAS_COMNAS,COM_DENCOM),FLD(-ALIAS_COMNAS,COM_PROVCOM));
set_row(18,"@45g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(20,"@10g@ls@1j@2s",FLD(-ALIAS_COMRES,COM_DENCOM),FLD(-ALIAS_COMRES,COM_PROVCOM));
set_row(20,"@45g@15ls", FLD(LF_SOGGETTI,SOG_TELABI));
set_row(22,"@2g@50ls", FLD(LF_SOGGETTI,SOG_INDIRIZZO));
set_row(24,"@10g@16ls", FLD(LF_SOGGETTI,SOG_CF));
set_row(28,"@4g@4ls", FLD(LF_SOGGETTI,SOG_GRUPPOAB0));
set_row(28,"@17g@3ls", FLD(LF_SOGGETTI,SOG_RHANTID));
set_row(28,"@30g@6ls", FLD(LF_SOGGETTI,SOG_FENOTIPORH));
set_row(28,"@48g@3ls", FLD(LF_SOGGETTI,SOG_KELL));
set_row(28,"@58g@3ls", FLD(LF_SOGGETTI,SOG_DU));
set_row(32,"@4g@20ls", FLD(LF_SOGGETTI,SOG_DOCID));
set_row(41,"@4g#t", &_riepilogodon);
set_row(72,"");
}
break;
}
}
bool TTessere_application::preprocess_page(int file, int counter)
{
// contatore soggetti stampati
// per ora non c'è
int totdon = current_cursor()->curr(LF_SOGGETTI).get_int(SOG_TOTDON);
TDate dataultima = current_cursor()->curr(LF_SOGGETTI).get(SOG_DATAULTDON);
_riepilogodon = "";
if (totdon != 0)
{
_riepilogodon = "Donazioni effettuate fino al ";
_riepilogodon << dataultima.string();
_riepilogodon << " n.ro ";
_riepilogodon << totdon;
}
return TRUE;
}
bool TTessere_application::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_TESSERE:
_tipo_stampa = tessere;
break;
case F_PAGINE:
_tipo_stampa = pagine;
break;
}
if (_tipo_stampa != undefined)
{
reset_files();
add_file(LF_SOGGETTI);
reset_print();
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TTessere_application::crea_intestazione()
{
TString sep(132);
TString data_stampa;
reset_header();
if (_tipo_stampa == pagine)
{
sep.fill('-');
set_header(1, (const char *) sep);
sep = "";
sep << "Pag. @#";
sep.right_just(132);
set_header(2,(const char*) sep);
set_header(2,"@0gSTAMPA PAGINE ANAGRAFICHE@64gDATA");
data_stampa = _data_stampa.string();
set_header(2,"@69g%10s", (const char*) data_stampa);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
}
}
bool TTessere_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS);
_rel->add(LF_COMUNI, "COM==COM",1,0,ALIAS_COMRES);
_rel->add("LCP", "CODTAB==LOCALITA");
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_msk = new TMask("at3200a");
_form_pag = new TTessere_form("AT_PAGIN"); // dovrà esserci PAGINE
return TRUE;
}
bool TTessere_application::user_destroy()
{
delete _msk;
delete _rel;
delete _form_pag;
return TRUE;
}
int at3200(int argc, char* argv[])
{
TTessere_application a;
a.run(argc, argv, "Stampa tessere e pagine");
return 0;
}
#include <mask.h>
#include <form.h>
#include <printapp.h>
#include "lf.h"
#include "soggetti.h"
#include "sezioni.h"
#include <comuni.h>
#include "at3.h"
#include "at3200a.h"
#define ALIAS_COMRES 100
#define ALIAS_COMNAS 200
enum ts { undefined = 0, tessere = 1, pagine = 2 };
// definizione form per pagine anagrafiche
class TTessere_form : public TForm
{
public:
virtual TCursor* cursor() const;
virtual TRelation* relation() const;
TPrint_section& get_body() { return section('B'); } ;
TTessere_form(): TForm() {};
TTessere_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {};
virtual ~TTessere_form() {};
};
class TTessere_application : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TTessere_form* _form_pag;
int _cur1, _cur2, _cur3, _cur4;
TDate _data_stampa;
ts _tipo_stampa;
TString _riepilogodon;
static bool filter_func_tessere(const TRelation *);
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
public:
void crea_intestazione();
TMask& app_mask() { return *_msk; }
TTessere_application() : _data_stampa(TODAY), _riepilogodon(50) {}
};
HIDDEN inline TTessere_application& app() { return (TTessere_application&) main_app(); }
TCursor* TTessere_form::cursor() const { return app().current_cursor(); }
TRelation* TTessere_form::relation() const { return cursor()->relation(); }
void TTessere_application::set_page(int file, int cnt)
{
// costruzione pagine
switch (_tipo_stampa)
{
case pagine:
{
TPrint_section& corpo = _form_pag->get_body();
corpo.reset();
corpo.update();
for (int i = 0; i < corpo.items(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,"%s",riga.row());
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
}
break;
case tessere:
{
TString data_stampa = _data_stampa.string();
set_row(3, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSEZ));
set_row(4, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSOT));
set_row(9,"@33g%s@1j@pn", "Cod. prov.",FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
set_row(12,"@37g@10ls", FLD(LF_SOGGETTI,SOG_TESSAVIS));
set_row(14,"@45g%10s", (const char*) data_stampa);
set_row(16,"@8g@ls@1j@ls", FLD(LF_SOGGETTI,SOG_COGNOME), FLD(LF_SOGGETTI,SOG_NOME));
set_row(18,"@8g@ls@1j@2s", FLD(-ALIAS_COMNAS,COM_DENCOM),FLD(-ALIAS_COMNAS,COM_PROVCOM));
set_row(18,"@45g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(20,"@10g@ls@1j@2s",FLD(-ALIAS_COMRES,COM_DENCOM),FLD(-ALIAS_COMRES,COM_PROVCOM));
set_row(20,"@45g@15ls", FLD(LF_SOGGETTI,SOG_TELABI));
set_row(22,"@2g@50ls", FLD(LF_SOGGETTI,SOG_INDIRIZZO));
set_row(24,"@10g@16ls", FLD(LF_SOGGETTI,SOG_CF));
set_row(28,"@4g@4ls", FLD(LF_SOGGETTI,SOG_GRUPPOAB0));
set_row(28,"@17g@3ls", FLD(LF_SOGGETTI,SOG_RHANTID));
set_row(28,"@30g@6ls", FLD(LF_SOGGETTI,SOG_FENOTIPORH));
set_row(28,"@48g@3ls", FLD(LF_SOGGETTI,SOG_KELL));
set_row(28,"@58g@3ls", FLD(LF_SOGGETTI,SOG_DU));
set_row(32,"@4g@20ls", FLD(LF_SOGGETTI,SOG_DOCID));
set_row(41,"@4g#t", &_riepilogodon);
set_row(72,"");
}
break;
}
}
bool TTessere_application::preprocess_page(int file, int counter)
{
// contatore soggetti stampati
// per ora non c'è
int totdon = current_cursor()->curr(LF_SOGGETTI).get_int(SOG_TOTDON);
TDate dataultima = current_cursor()->curr(LF_SOGGETTI).get(SOG_DATAULTDON);
_riepilogodon = "";
if (totdon != 0)
{
_riepilogodon = "Donazioni effettuate fino al ";
_riepilogodon << dataultima.string();
_riepilogodon << " n.ro ";
_riepilogodon << totdon;
}
return TRUE;
}
bool TTessere_application::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_TESSERE:
_tipo_stampa = tessere;
break;
case F_PAGINE:
_tipo_stampa = pagine;
break;
}
if (_tipo_stampa != undefined)
{
reset_files();
add_file(LF_SOGGETTI);
reset_print();
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TTessere_application::crea_intestazione()
{
TString sep(132);
TString data_stampa;
reset_header();
if (_tipo_stampa == pagine)
{
sep.fill('-');
set_header(1, (const char *) sep);
sep = "";
sep << "Pag. @#";
sep.right_just(132);
set_header(2,(const char*) sep);
set_header(2,"@0gSTAMPA PAGINE ANAGRAFICHE@64gDATA");
data_stampa = _data_stampa.string();
set_header(2,"@69g%10s", (const char*) data_stampa);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
}
}
bool TTessere_application::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMRES);
_rel->add("LCP", "CODTAB==DOM_CODLOC");
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_msk = new TMask("at3200a");
_form_pag = new TTessere_form("AT_PAGIN"); // dovrà esserci PAGINE
return TRUE;
}
bool TTessere_application::user_destroy()
{
delete _msk;
delete _rel;
delete _form_pag;
return TRUE;
}
int at3200(int argc, char* argv[])
{
TTessere_application a;
a.run(argc, argv, "Stampa tessere e pagine");
return 0;
}

6
at/sesso.h Executable file
View File

@ -0,0 +1,6 @@
// listbox per sesso
ITEM "0|Sconosciuto"
ITEM "1|Maschio"
ITEM "2|Femmina"
ITEM "9|Non specif."

View File

@ -1,69 +1,75 @@
// definizione campi dell'archivio SOGGETTI
#define SOG_CODSEZ "CODSEZ"
#define SOG_CODSOT "CODSOT"
#define SOG_CODICE "CODICE"
#define SOG_COGNOME "COGNOME"
#define SOG_NOME "NOME"
#define SOG_DATANASC "DATANASC"
#define SOG_COMNASC "COMNASC"
#define SOG_SESSO "SESSO"
#define SOG_CATDON "CATDON"
#define SOG_DATAISC "DATAISC"
#define SOG_DATADIM "DATADIM"
#define SOG_CATNOND1 "CATNOND1"
#define SOG_CATNOND2 "CATNOND2"
#define SOG_INDIRIZZO "INDIRIZZO"
#define SOG_COM "COM"
#define SOG_TELABI "TELABI"
#define SOG_TELLAV "TELLAV"
#define SOG_TELALT "TELALT"
#define SOG_CONDOCC "CONDOCC"
#define SOG_POSPROF "POSPROF"
#define SOG_RAMOATT "RAMOATT"
#define SOG_PROFESS "PROFESS"
#define SOG_TITSTUD "TITSTUD"
#define SOG_LUOGOLAV "LUOGOLAV"
#define SOG_TESSAVIS "TESSAVIS"
#define SOG_TESSSSN "TESSSSN"
#define SOG_CODCT "CODCT"
#define SOG_CODCL "CODCL"
#define SOG_DOCID "DOCID"
#define SOG_CF "CF"
#define SOG_CODMED "CODMED"
#define SOG_TITINDIR "TITINDIR"
#define SOG_LOCALITA "LOCALITA"
#define SOG_CAPCOM "CAPCOM"
#define SOG_MODCONV "MODCONV"
#define SOG_GIOPREDON "GIOPREDON"
#define SOG_GIOPRECON "GIOPRECON"
#define SOG_ESCLUSO "ESCLUSO"
#define SOG_TERMESCL "TERMESCL"
#define SOG_MOTESCL "MOTESCL"
#define SOG_STATO "STATO"
#define SOG_DATASTATO "DATASTATO"
#define SOG_DATAULTID "DATAULTID"
#define SOG_TIPOULTID "TIPOULTID"
#define SOG_IDON1 "IDON1"
#define SOG_IDON2 "IDON2"
#define SOG_IDON3 "IDON3"
#define SOG_IDON4 "IDON4"
#define SOG_INTSI "INTSI"
#define SOG_INTAF "INTAF"
#define SOG_TOTDON "TOTDON"
#define SOG_DATAULTDON "DATAULTDON"
#define SOG_TIPOULTDON "TIPOULTDON"
#define SOG_DATAULTSI "DATAULTSI"
#define SOG_DATAULTAF "DATAULTAF"
#define SOG_TOTDONSI "TOTDONSI"
#define SOG_TOTDONAF "TOTDONAF"
#define SOG_DATAPROSSI "DATAPROSSI"
#define SOG_DATAPROSAF "DATAPROSAF"
#define SOG_GRUPPOAB0 "GRUPPOAB0"
#define SOG_RHANTID "RHANTID"
#define SOG_KELL "KELL"
#define SOG_FENOTIPORH "FENOTIPORH"
#define SOG_DU "DU"
#define SOG_DATAULTAGG "DATAULTAGG"
#define SOG_UTENULTAGG "UTENULTAGG"
#define SOG_DATAULTCAR "DATAULTCAR"
// definizione campi dell'archivio SOGGETTI
#define SOG_CODSEZ "CODSEZ"
#define SOG_CODSOT "CODSOT"
#define SOG_CODICE "CODICE"
#define SOG_COGNOME "COGNOME"
#define SOG_NOME "NOME"
#define SOG_DATANASC "DATANASC"
#define SOG_COMNASC "COMNASC"
#define SOG_SESSO "SESSO"
#define SOG_CATDON "CATDON"
#define SOG_DATAISC "DATAISC"
#define SOG_DATADIM "DATADIM"
#define SOG_CATNOND1 "CATNOND1"
#define SOG_CATNOND2 "CATNOND2"
#define SOG_TESSAVIS "TESSAVIS"
#define SOG_TESSSSN "TESSSSN"
#define SOG_CODCT "CODCT"
#define SOG_CODCL "CODCL"
#define SOG_DOCID "DOCID"
#define SOG_CF "CF"
#define SOG_DOM_INDIR "DOM_INDIR"
#define SOG_DOM_STRADA "DOM_STRADA"
#define SOG_DOM_DISTRI "DOM_DISTRI"
#define SOG_DOM_CODCOM "DOM_CODCOM"
#define SOG_DOM_CODLOC "DOM_CODLOC"
#define SOG_RES_INDIR "RES_INDIR"
#define SOG_RES_CODCOM "RES_CODCOM"
#define SOG_RES_CODLOC "RES_CODLOC"
#define SOG_TELABI "TELABI"
#define SOG_TELLAV "TELLAV"
#define SOG_TELALT "TELALT"
#define SOG_TITINDIR "TITINDIR"
#define SOG_ESCLUSO "ESCLUSO"
#define SOG_TERMESCL "TERMESCL"
#define SOG_MOTESCL "MOTESCL"
#define SOG_STATO "STATO"
#define SOG_DATASTATO "DATASTATO"
#define SOG_DATAULTID "DATAULTID"
#define SOG_TIPOULTID "TIPOULTID"
#define SOG_IDON1 "IDON1"
#define SOG_IDON2 "IDON2"
#define SOG_IDON3 "IDON3"
#define SOG_IDON4 "IDON4"
#define SOG_INTSI "INTSI"
#define SOG_INTAF "INTAF"
#define SOG_TOTDON "TOTDON"
#define SOG_DATAULTDON "DATAULTDON"
#define SOG_TIPOULTDON "TIPOULTDON"
#define SOG_DATAULTSI "DATAULTSI"
#define SOG_DATAULTAF "DATAULTAF"
#define SOG_TOTDONSI "TOTDONSI"
#define SOG_TOTDONAF "TOTDONAF"
#define SOG_DATAPROSSI "DATAPROSSI"
#define SOG_DATAPROSAF "DATAPROSAF"
#define SOG_GRUPPOAB0 "GRUPPOAB0"
#define SOG_RHANTID "RHANTID"
#define SOG_KELL "KELL"
#define SOG_FENOTIPORH "FENOTIPORH"
#define SOG_DU "DU"
#define SOG_PUNTORACC "PUNTORACC"
#define SOG_CODMED "CODMED"
#define SOG_MODCONV "MODCONV"
#define SOG_GIOPREDON "GIOPREDON"
#define SOG_GIOPRECON "GIOPRECON"
#define SOG_NUMCONV "NUMCONV"
#define SOG_DATACONV "DATACONV"
#define SOG_DATAULTAGG "DATAULTAGG"
#define SOG_UTENULTAGG "UTENULTAGG"
#define SOG_CONDOCC "CONDOCC"
#define SOG_POSPROF "POSPROF"
#define SOG_RAMOATT "RAMOATT"
#define SOG_TITSTUD "TITSTUD"