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_COGNOME 102
#define F_NOME 103 #define F_NOME 103
#define F_DATANASC 104 #define F_DATANASC 104
#define F_CODSEZ 105 #define F_TESSAVIS 105
#define F_DENSEZ 106 #define F_CODSEZ 106
#define F_CODSOT 107 #define F_DENSEZ 107
#define F_DENSOT 108 #define F_CODSOT 108
#define F_CATDON 109 #define F_DENSOT 109
#define F_DESC_CATDON 110 #define F_CATDON 110
#define F_DATAISC 111 #define F_DESC_CATDON 111
#define F_DATADIM 112 #define F_DATAISC 112
#define F_COMNASC 113 #define F_DATADIM 113
#define F_DENCOMNASC 114 #define F_DOM_INDIR 114
#define F_PROVCOMNASC 115 #define F_DOM_CODCOM 115
#define F_INDIRIZZO 116 #define F_DOM_DENCOM 116
#define F_COM 117 #define F_DOM_CAPCOM 117
#define F_DENCOM 118 #define F_DOM_PROVCOM 118
#define F_CAPCOM 119 #define F_DOM_CODLOC 119
#define F_PROVCOM 120 #define F_DOM_DENLOC 120
#define F_LOCALITA 121 #define F_DOM_STRADA 121
#define F_DENLOC 122 #define F_DOM_DISTRI 122
#define F_TELABI 123 #define F_RES_INDIR 123
#define F_TELLAV 124 #define F_RES_CODCOM 124
#define F_TELALT 125 #define F_RES_DENCOM 125
#define F_SESSO 126 #define F_RES_CAPCOM 126
#define F_DATAULTAGG 127 #define F_RES_PROVCOM 127
#define F_UTENULTAGG 128 #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 // pagina 2
#define F_CATNOND1 201 #define F_CATNOND1 201
#define F_DESC_CATNOND1 202 #define F_DESC_CATNOND1 202
#define F_CATNOND2 203 #define F_CATNOND2 203
#define F_DESC_CATNOND2 204 #define F_DESC_CATNOND2 204
#define F_TITINDIR 205 #define F_CODCL 205
#define F_TESSAVIS 206 #define F_CODCT 206
#define F_CODCT 207 #define F_TESSSSN 207
#define F_CODCL 208 #define F_TITINDIR 208
#define F_TESSSSN 209 #define F_CODMED 209
#define F_DOCID 210 #define F_COGNMED 210
#define F_CF 211 #define F_NOMMED 211
#define F_CONDOCC 212 #define F_GRUPPOAB0 212
#define F_POSPROF 213 #define F_RHANTID 213
#define F_RAMOATT 214 #define F_KELL 214
#define F_TITSTUD 215 #define F_FENOTIPORH 215
#define F_PROFESS 216 #define F_DU 216
#define F_DESC_PROF 217 #define F_MODCONV 217
#define F_LUOGOLAV 218 #define F_PUNTORACC 218
#define F_DESC_LUOGO 219 #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 // pagina 3
#define F_STATO 301 #define F_STATO 301
@ -78,23 +103,23 @@
#define F_DATAULTAF 323 #define F_DATAULTAF 323
#define F_TOTDONSI 324 #define F_TOTDONSI 324
#define F_TOTDONAF 325 #define F_TOTDONAF 325
#define F_DATACONV 326
#define F_NUMCONV 327
// pagina 4
// pagina 4 #define F_CONDOCC 401
#define F_GRUPPOAB0 401 #define F_POSPROF 402
#define F_RHANTID 402 #define F_RAMOATT 403
#define F_KELL 403 #define F_TITSTUD 404
#define F_FENOTIPORH 404 #define F_PROFESS 405
#define F_DU 405 #define F_DESC_PROFESS 406
#define F_MODCONV 406 #define F_LUOGOLAV 407
#define F_GIOPREDON 407 #define F_DESC_LUOGOLAV 408
#define F_GIOPRECON 408
#define F_ESCLUSO 409 #define F_ESCLUSO 409
#define F_TERMESCL 410 #define F_TERMESCL 410
#define F_MOTESCL 411 #define F_MOTESCL 411
#define F_CODMED 412 #define F_UTENULTAGG 412
#define F_COGNMED 413 #define F_DATAULTAGG 413
#define F_NOMMED 414
// pagina 5 // pagina 5
#define F_DONAZIONI 501 #define F_DONAZIONI 501
@ -119,7 +144,7 @@
#define F_D_HB 107 #define F_D_HB 107
#define F_D_SGPT 108 #define F_D_SGPT 108
#define F_D_PROTIDEMIA 109 #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_TIPODON 211
#define F_D_DESC_LUOGODON 212 #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); bool check_sog_sheet(const char* codsog);
static bool nome_handler(TMask_field& f, KEY k); static bool nome_handler(TMask_field& f, KEY k);
static bool codice_handler(TMask_field& f, KEY k);
static bool soggetti_notify(TSheet_field& s, int r, KEY k); static bool soggetti_notify(TSheet_field& s, int r, KEY k);
void add_rows_soggetti(TSheet_field& s, int count = 10, int start = 0); void add_rows_soggetti(TSheet_field& s, int count = 10, int start = 0);
static bool ins_controlli_handler(TMask_field& f, KEY k); static bool ins_controlli_handler(TMask_field& f, KEY k);
@ -98,7 +97,6 @@ bool TDonaz_app::create()
ss.set_notify(soggetti_notify); ss.set_notify(soggetti_notify);
ss.sheet_mask().set_handler(F_S_NOME,nome_handler); ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
ss.sheet_mask().set_handler(F_S_CODICE,codice_handler);
dispatch_e_menu(BAR_ITEM(1)); dispatch_e_menu(BAR_ITEM(1));
@ -431,10 +429,7 @@ bool TDonaz_app::check_sog_sheet(const char* codsog)
if (array_sogg.is_key(codsog)) if (array_sogg.is_key(codsog))
return FALSE; return FALSE;
else else
{
array_sogg.add(codsog);
return TRUE; return TRUE;
}
} }
bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k) 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: case K_CTRL+K_DEL:
// avvenuta cancellazione riga // avvenuta cancellazione riga
break;
case K_SPACE:
// inizio modifica riga
break;
case K_TAB: 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())) if ((r == s.items()-1) && (r == s.first_empty()))
{ {
app().add_rows_soggetti(s,10,r+1); 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; break;
case K_ENTER:
// uscita da riga modificata
case K_CTRL+K_TAB: case K_CTRL+K_TAB:
// uscita riga // 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); app().add_rows_soggetti(s,10,r+1);
s.select(r); s.select(r);
@ -477,26 +491,6 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
return ok; return ok;
} }
bool TDonaz_app::codice_handler(TMask_field& f, KEY k)
{
bool 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 TDonaz_app::nome_handler(TMask_field& f, KEY k)
{ {
bool ok = TRUE; bool ok = TRUE;

View File

@ -1,27 +1,41 @@
// definizione campi della maschera at0200a.msk // definizione campi della maschera at0200a.msk
// INSERIMENTO VELOCE DONAZIONI // INSERIMENTO VELOCE DONAZIONI
// dati fissi // dati fissi
#define F_DATADON 101 #define F_DATADON 101
#define F_TIPODON 102 #define F_TIPODON 102
#define F_LUOGODON 103 #define F_LUOGODON 103
#define F_DESC_TIPODON 104 #define F_DESC_TIPODON 104
#define F_DESC_LUOGODON 105 #define F_DESC_LUOGODON 105
#define F_INS_CONTROLLI 106 #define F_INS_CONTROLLI 106
// spreadsheet // spreadsheet
#define F_SOGGETTI 107 #define F_SOGGETTI 107
// pagina soggetti // pagina soggetti
#define F_S_CODICE 101 #define F_S_CODICE 101
#define F_S_COGNOME 102 #define F_S_COGNOME 102
#define F_S_NOME 103 #define F_S_NOME 103
#define F_S_TIPOCON 104 #define F_S_TIPOCON 104
#define F_S_DATANASC 105 #define F_S_DATANASC 105
#define F_S_CODSEZ 106 #define F_S_CODSEZ 106
#define F_S_CODSOT 107 #define F_S_CODSOT 107
#define F_S_CATDON 108 #define F_S_CATDON 108
#define F_S_TESSERA 109 #define F_S_TESSERA 109
#define F_S_DENSEZ 201 #define F_S_DENSEZ 201
#define F_S_DENSOT 202 #define F_S_DENSOT 202
#define F_S_DESC_TIPOCON 203 #define F_S_DESC_TIPOCON 203
#define F_S_DESC_CATDON 204 #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 DISPLAY "Descrizione@30" S0
OUTPUT F_TIPODON CODTAB OUTPUT F_TIPODON CODTAB
OUTPUT F_DESC_TIPODON S0 OUTPUT F_DESC_TIPODON S0
//VALIDATE NOT_EMPTY_FUNC VALIDATE NOT_EMPTY_FUNC
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
WARNING "Codice non presente" WARNING "Codice non presente"
HELP "Tipo donazione" HELP "Tipo donazione"
@ -126,10 +126,15 @@ ENDMASK
PAGE "Soggetto " -1 -1 78 20 PAGE "Soggetto " -1 -1 78 20
GROUPBOX DLG_NULL 77 5
BEGIN
PROMPT 1 0 ""
FLAGS "R"
END
NUMBER F_S_CODICE 6 NUMBER F_S_CODICE 6
BEGIN BEGIN
PROMPT 2 1 "Codice " PROMPT 2 1 "Codice "
FIELD LF_SOGGETTI->CODICE
FLAGS "RG" FLAGS "RG"
USE LF_SOGGETTI KEY 1 USE LF_SOGGETTI KEY 1
INPUT CODICE F_S_CODICE INPUT CODICE F_S_CODICE
@ -148,6 +153,7 @@ BEGIN
OUTPUT F_S_CODSEZ CODSEZ OUTPUT F_S_CODSEZ CODSEZ
OUTPUT F_S_CODSOT CODSOT OUTPUT F_S_CODSOT CODSOT
OUTPUT F_S_CATDON CATDON OUTPUT F_S_CATDON CATDON
OUTPUT F_S_TESSAVIS TESSAVIS
CHECKTYPE NORMAL CHECKTYPE NORMAL
ADD RUN at0 -0 ADD RUN at0 -0
END END
@ -155,7 +161,6 @@ END
STRING F_S_COGNOME 25 STRING F_S_COGNOME 25
BEGIN BEGIN
PROMPT 2 2 "Cognome e nome " PROMPT 2 2 "Cognome e nome "
FIELD LF_SOGGETTI->COGNOME
USE LF_SOGGETTI KEY 2 USE LF_SOGGETTI KEY 2
INPUT COGNOME F_S_COGNOME INPUT COGNOME F_S_COGNOME
INPUT NOME F_S_NOME INPUT NOME F_S_NOME
@ -176,18 +181,21 @@ END
STRING F_S_NOME 25 STRING F_S_NOME 25
BEGIN BEGIN
PROMPT 46 2 "" PROMPT 46 2 ""
FIELD LF_SOGGETTI->NOME
COPY ALL F_S_COGNOME COPY ALL F_S_COGNOME
COPY OUTPUT F_S_CODICE COPY OUTPUT F_S_CODICE
//CHECKTYPE NORMAL
CHECKTYPE SEARCH CHECKTYPE SEARCH
HELP "Nome del soggetto" HELP "Nome del soggetto"
ADD RUN at0 -0 ADD RUN at0 -0
END END
GROUPBOX DLG_NULL 77 9
BEGIN
PROMPT 1 9 "Dati del controllo sanitario effettuato"
END
STRING F_S_TIPOCON 2 STRING F_S_TIPOCON 2
BEGIN BEGIN
PROMPT 2 5 "Tipo controllo " PROMPT 2 10 "Tipo controllo "
FLAGS "U" FLAGS "U"
USE TCS SELECT S6=="N" USE TCS SELECT S6=="N"
INPUT CODTAB F_S_TIPOCON INPUT CODTAB F_S_TIPOCON
@ -202,27 +210,29 @@ END
DATE F_S_DATANASC DATE F_S_DATANASC
BEGIN BEGIN
PROMPT 2 3 "Nato il " PROMPT 2 3 "Nato il "
FIELD LF_SOGGETTI->DATANASC
FLAGS "D" FLAGS "D"
END END
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 5 "Dati associativi"
END
STRING F_S_CODSEZ 2 STRING F_S_CODSEZ 2
BEGIN BEGIN
PROMPT 2 7 "Sez. " PROMPT 2 6 "Sez. "
FIELD LF_SOGGETTI->CODSEZ
FLAGS "D" FLAGS "D"
END END
STRING F_S_DENSEZ 25 STRING F_S_DENSEZ 25
BEGIN BEGIN
PROMPT 13 7 "" PROMPT 12 6 ""
FLAGS "D" FLAGS "D"
END END
STRING F_S_CODSOT 2 STRING F_S_CODSOT 2
BEGIN BEGIN
PROMPT 43 7 "Sot. " PROMPT 40 6 "Sot. "
FIELD LF_SOGGETTI->CODSOT
FLAGS "D" FLAGS "D"
USE LF_SEZIONI USE LF_SEZIONI
INPUT CODSEZ F_S_CODSEZ INPUT CODSEZ F_S_CODSEZ
@ -234,14 +244,13 @@ END
STRING F_S_DENSOT 25 STRING F_S_DENSOT 25
BEGIN BEGIN
PROMPT 54 7 "" PROMPT 50 6 ""
FLAGS "D" FLAGS "D"
END END
STRING F_S_CATDON 2 STRING F_S_CATDON 2
BEGIN BEGIN
PROMPT 2 8 "Cat. " PROMPT 2 7 "Cat. "
FIELD LF_SOGGETTI->CATDON
FLAGS "D" FLAGS "D"
USE CTD USE CTD
INPUT CODTAB F_S_CATDON INPUT CODTAB F_S_CATDON
@ -249,22 +258,155 @@ BEGIN
CHECKTYPE NORMAL CHECKTYPE NORMAL
END END
STRING F_S_TESSERA 10 STRING F_S_TESSAVIS 10
BEGIN BEGIN
PROMPT 43 8 "Tessera AVIS " PROMPT 52 7 "Tessera AVIS "
FIELD LF_SOGGETTI->TESSAVIS
FLAGS "D" FLAGS "D"
END END
STRING F_S_DESC_TIPOCON 25 STRING F_S_DESC_TIPOCON 25
BEGIN BEGIN
PROMPT 35 5 "" PROMPT 23 10 ""
FLAGS "D" FLAGS "D"
END END
STRING F_S_DESC_CATDON 22 STRING F_S_DESC_CATDON 25
BEGIN 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" FLAGS "D"
END END

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,218 +1,218 @@
#include <mask.h> #include <mask.h>
#include <form.h> #include <form.h>
#include <printapp.h> #include <printapp.h>
#include "lf.h" #include "lf.h"
#include "soggetti.h" #include "soggetti.h"
#include "sezioni.h" #include "sezioni.h"
#include <comuni.h> #include <comuni.h>
#include "at3.h" #include "at3.h"
#include "at3200a.h" #include "at3200a.h"
#define ALIAS_COMRES 100 #define ALIAS_COMRES 100
#define ALIAS_COMNAS 200 #define ALIAS_COMNAS 200
enum ts { undefined = 0, tessere = 1, pagine = 2 }; enum ts { undefined = 0, tessere = 1, pagine = 2 };
// definizione form per pagine anagrafiche // definizione form per pagine anagrafiche
class TTessere_form : public TForm class TTessere_form : public TForm
{ {
public: public:
virtual TCursor* cursor() const; virtual TCursor* cursor() const;
virtual TRelation* relation() const; virtual TRelation* relation() const;
TPrint_section& get_body() { return section('B'); } ; TPrint_section& get_body() { return section('B'); } ;
TTessere_form(): TForm() {}; TTessere_form(): TForm() {};
TTessere_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "") TTessere_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {}; : TForm(form,code,editlevel,desc) {};
virtual ~TTessere_form() {}; virtual ~TTessere_form() {};
}; };
class TTessere_application : public TPrintapp class TTessere_application : public TPrintapp
{ {
TRelation* _rel; TRelation* _rel;
TMask* _msk; TMask* _msk;
TTessere_form* _form_pag; TTessere_form* _form_pag;
int _cur1, _cur2, _cur3, _cur4; int _cur1, _cur2, _cur3, _cur4;
TDate _data_stampa; TDate _data_stampa;
ts _tipo_stampa; ts _tipo_stampa;
TString _riepilogodon; TString _riepilogodon;
static bool filter_func_tessere(const TRelation *); static bool filter_func_tessere(const TRelation *);
protected: protected:
virtual bool user_create(); virtual bool user_create();
virtual bool user_destroy(); virtual bool user_destroy();
virtual bool set_print(int m); virtual bool set_print(int m);
virtual void set_page(int file, int cnt); virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter); virtual bool preprocess_page(int file, int counter);
public: public:
void crea_intestazione(); void crea_intestazione();
TMask& app_mask() { return *_msk; } TMask& app_mask() { return *_msk; }
TTessere_application() : _data_stampa(TODAY), _riepilogodon(50) {} TTessere_application() : _data_stampa(TODAY), _riepilogodon(50) {}
}; };
HIDDEN inline TTessere_application& app() { return (TTessere_application&) main_app(); } HIDDEN inline TTessere_application& app() { return (TTessere_application&) main_app(); }
TCursor* TTessere_form::cursor() const { return app().current_cursor(); } TCursor* TTessere_form::cursor() const { return app().current_cursor(); }
TRelation* TTessere_form::relation() const { return cursor()->relation(); } TRelation* TTessere_form::relation() const { return cursor()->relation(); }
void TTessere_application::set_page(int file, int cnt) void TTessere_application::set_page(int file, int cnt)
{ {
// costruzione pagine // costruzione pagine
switch (_tipo_stampa) switch (_tipo_stampa)
{ {
case pagine: case pagine:
{ {
TPrint_section& corpo = _form_pag->get_body(); TPrint_section& corpo = _form_pag->get_body();
corpo.reset(); corpo.reset();
corpo.update(); corpo.update();
for (int i = 0; i < corpo.items(); i++) for (int i = 0; i < corpo.items(); i++)
{ {
TPrintrow& riga = corpo.row(i); TPrintrow& riga = corpo.row(i);
set_row(i+1,"%s",riga.row()); set_row(i+1,"%s",riga.row());
} }
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta // altrimenti stampa sempre la stessa etichetta
} }
break; break;
case tessere: case tessere:
{ {
TString data_stampa = _data_stampa.string(); TString data_stampa = _data_stampa.string();
set_row(3, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSEZ)); set_row(3, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSEZ));
set_row(4, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSOT)); 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(9,"@33g%s@1j@pn", "Cod. prov.",FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
set_row(12,"@37g@10ls", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(12,"@37g@10ls", FLD(LF_SOGGETTI,SOG_TESSAVIS));
set_row(14,"@45g%10s", (const char*) data_stampa); 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(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,"@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(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,"@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(20,"@45g@15ls", FLD(LF_SOGGETTI,SOG_TELABI));
set_row(22,"@2g@50ls", FLD(LF_SOGGETTI,SOG_INDIRIZZO)); set_row(22,"@2g@50ls", FLD(LF_SOGGETTI,SOG_INDIRIZZO));
set_row(24,"@10g@16ls", FLD(LF_SOGGETTI,SOG_CF)); set_row(24,"@10g@16ls", FLD(LF_SOGGETTI,SOG_CF));
set_row(28,"@4g@4ls", FLD(LF_SOGGETTI,SOG_GRUPPOAB0)); set_row(28,"@4g@4ls", FLD(LF_SOGGETTI,SOG_GRUPPOAB0));
set_row(28,"@17g@3ls", FLD(LF_SOGGETTI,SOG_RHANTID)); set_row(28,"@17g@3ls", FLD(LF_SOGGETTI,SOG_RHANTID));
set_row(28,"@30g@6ls", FLD(LF_SOGGETTI,SOG_FENOTIPORH)); set_row(28,"@30g@6ls", FLD(LF_SOGGETTI,SOG_FENOTIPORH));
set_row(28,"@48g@3ls", FLD(LF_SOGGETTI,SOG_KELL)); set_row(28,"@48g@3ls", FLD(LF_SOGGETTI,SOG_KELL));
set_row(28,"@58g@3ls", FLD(LF_SOGGETTI,SOG_DU)); set_row(28,"@58g@3ls", FLD(LF_SOGGETTI,SOG_DU));
set_row(32,"@4g@20ls", FLD(LF_SOGGETTI,SOG_DOCID)); set_row(32,"@4g@20ls", FLD(LF_SOGGETTI,SOG_DOCID));
set_row(41,"@4g#t", &_riepilogodon); set_row(41,"@4g#t", &_riepilogodon);
set_row(72,""); set_row(72,"");
} }
break; break;
} }
} }
bool TTessere_application::preprocess_page(int file, int counter) bool TTessere_application::preprocess_page(int file, int counter)
{ {
// contatore soggetti stampati // contatore soggetti stampati
// per ora non c'è // per ora non c'è
int totdon = current_cursor()->curr(LF_SOGGETTI).get_int(SOG_TOTDON); int totdon = current_cursor()->curr(LF_SOGGETTI).get_int(SOG_TOTDON);
TDate dataultima = current_cursor()->curr(LF_SOGGETTI).get(SOG_DATAULTDON); TDate dataultima = current_cursor()->curr(LF_SOGGETTI).get(SOG_DATAULTDON);
_riepilogodon = ""; _riepilogodon = "";
if (totdon != 0) if (totdon != 0)
{ {
_riepilogodon = "Donazioni effettuate fino al "; _riepilogodon = "Donazioni effettuate fino al ";
_riepilogodon << dataultima.string(); _riepilogodon << dataultima.string();
_riepilogodon << " n.ro "; _riepilogodon << " n.ro ";
_riepilogodon << totdon; _riepilogodon << totdon;
} }
return TRUE; return TRUE;
} }
bool TTessere_application::set_print(int m) bool TTessere_application::set_print(int m)
{ {
_tipo_stampa = undefined; _tipo_stampa = undefined;
KEY tasto; KEY tasto;
tasto = _msk->run(); tasto = _msk->run();
switch (tasto) switch (tasto)
{ {
case F_TESSERE: case F_TESSERE:
_tipo_stampa = tessere; _tipo_stampa = tessere;
break; break;
case F_PAGINE: case F_PAGINE:
_tipo_stampa = pagine; _tipo_stampa = pagine;
break; break;
} }
if (_tipo_stampa != undefined) if (_tipo_stampa != undefined)
{ {
reset_files(); reset_files();
add_file(LF_SOGGETTI); add_file(LF_SOGGETTI);
reset_print(); reset_print();
crea_intestazione(); crea_intestazione();
return TRUE; return TRUE;
} }
else else
return FALSE; return FALSE;
} }
void TTessere_application::crea_intestazione() void TTessere_application::crea_intestazione()
{ {
TString sep(132); TString sep(132);
TString data_stampa; TString data_stampa;
reset_header(); reset_header();
if (_tipo_stampa == pagine) if (_tipo_stampa == pagine)
{ {
sep.fill('-'); sep.fill('-');
set_header(1, (const char *) sep); set_header(1, (const char *) sep);
sep = ""; sep = "";
sep << "Pag. @#"; sep << "Pag. @#";
sep.right_just(132); sep.right_just(132);
set_header(2,(const char*) sep); set_header(2,(const char*) sep);
set_header(2,"@0gSTAMPA PAGINE ANAGRAFICHE@64gDATA"); set_header(2,"@0gSTAMPA PAGINE ANAGRAFICHE@64gDATA");
data_stampa = _data_stampa.string(); data_stampa = _data_stampa.string();
set_header(2,"@69g%10s", (const char*) data_stampa); set_header(2,"@69g%10s", (const char*) data_stampa);
sep = ""; sep = "";
sep.fill('-'); sep.fill('-');
set_header(3, (const char *) sep); set_header(3, (const char *) sep);
} }
} }
bool TTessere_application::user_create() bool TTessere_application::user_create()
{ {
_rel = new TRelation(LF_SOGGETTI); _rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS); _rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS);
_rel->add(LF_COMUNI, "COM==COM",1,0,ALIAS_COMRES); _rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMRES);
_rel->add("LCP", "CODTAB==LOCALITA"); _rel->add("LCP", "CODTAB==DOM_CODLOC");
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome _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 _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 _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_msk = new TMask("at3200a"); _msk = new TMask("at3200a");
_form_pag = new TTessere_form("AT_PAGIN"); // dovrà esserci PAGINE _form_pag = new TTessere_form("AT_PAGIN"); // dovrà esserci PAGINE
return TRUE; return TRUE;
} }
bool TTessere_application::user_destroy() bool TTessere_application::user_destroy()
{ {
delete _msk; delete _msk;
delete _rel; delete _rel;
delete _form_pag; delete _form_pag;
return TRUE; return TRUE;
} }
int at3200(int argc, char* argv[]) int at3200(int argc, char* argv[])
{ {
TTessere_application a; TTessere_application a;
a.run(argc, argv, "Stampa tessere e pagine"); a.run(argc, argv, "Stampa tessere e pagine");
return 0; 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 // definizione campi dell'archivio SOGGETTI
#define SOG_CODSEZ "CODSEZ" #define SOG_CODSEZ "CODSEZ"
#define SOG_CODSOT "CODSOT" #define SOG_CODSOT "CODSOT"
#define SOG_CODICE "CODICE" #define SOG_CODICE "CODICE"
#define SOG_COGNOME "COGNOME" #define SOG_COGNOME "COGNOME"
#define SOG_NOME "NOME" #define SOG_NOME "NOME"
#define SOG_DATANASC "DATANASC" #define SOG_DATANASC "DATANASC"
#define SOG_COMNASC "COMNASC" #define SOG_COMNASC "COMNASC"
#define SOG_SESSO "SESSO" #define SOG_SESSO "SESSO"
#define SOG_CATDON "CATDON" #define SOG_CATDON "CATDON"
#define SOG_DATAISC "DATAISC" #define SOG_DATAISC "DATAISC"
#define SOG_DATADIM "DATADIM" #define SOG_DATADIM "DATADIM"
#define SOG_CATNOND1 "CATNOND1" #define SOG_CATNOND1 "CATNOND1"
#define SOG_CATNOND2 "CATNOND2" #define SOG_CATNOND2 "CATNOND2"
#define SOG_INDIRIZZO "INDIRIZZO" #define SOG_TESSAVIS "TESSAVIS"
#define SOG_COM "COM" #define SOG_TESSSSN "TESSSSN"
#define SOG_TELABI "TELABI" #define SOG_CODCT "CODCT"
#define SOG_TELLAV "TELLAV" #define SOG_CODCL "CODCL"
#define SOG_TELALT "TELALT" #define SOG_DOCID "DOCID"
#define SOG_CONDOCC "CONDOCC" #define SOG_CF "CF"
#define SOG_POSPROF "POSPROF"
#define SOG_RAMOATT "RAMOATT" #define SOG_DOM_INDIR "DOM_INDIR"
#define SOG_PROFESS "PROFESS" #define SOG_DOM_STRADA "DOM_STRADA"
#define SOG_TITSTUD "TITSTUD" #define SOG_DOM_DISTRI "DOM_DISTRI"
#define SOG_LUOGOLAV "LUOGOLAV" #define SOG_DOM_CODCOM "DOM_CODCOM"
#define SOG_TESSAVIS "TESSAVIS" #define SOG_DOM_CODLOC "DOM_CODLOC"
#define SOG_TESSSSN "TESSSSN" #define SOG_RES_INDIR "RES_INDIR"
#define SOG_CODCT "CODCT" #define SOG_RES_CODCOM "RES_CODCOM"
#define SOG_CODCL "CODCL" #define SOG_RES_CODLOC "RES_CODLOC"
#define SOG_DOCID "DOCID"
#define SOG_CF "CF" #define SOG_TELABI "TELABI"
#define SOG_CODMED "CODMED" #define SOG_TELLAV "TELLAV"
#define SOG_TITINDIR "TITINDIR" #define SOG_TELALT "TELALT"
#define SOG_LOCALITA "LOCALITA" #define SOG_TITINDIR "TITINDIR"
#define SOG_CAPCOM "CAPCOM" #define SOG_ESCLUSO "ESCLUSO"
#define SOG_MODCONV "MODCONV" #define SOG_TERMESCL "TERMESCL"
#define SOG_GIOPREDON "GIOPREDON" #define SOG_MOTESCL "MOTESCL"
#define SOG_GIOPRECON "GIOPRECON" #define SOG_STATO "STATO"
#define SOG_ESCLUSO "ESCLUSO" #define SOG_DATASTATO "DATASTATO"
#define SOG_TERMESCL "TERMESCL" #define SOG_DATAULTID "DATAULTID"
#define SOG_MOTESCL "MOTESCL" #define SOG_TIPOULTID "TIPOULTID"
#define SOG_STATO "STATO" #define SOG_IDON1 "IDON1"
#define SOG_DATASTATO "DATASTATO" #define SOG_IDON2 "IDON2"
#define SOG_DATAULTID "DATAULTID" #define SOG_IDON3 "IDON3"
#define SOG_TIPOULTID "TIPOULTID" #define SOG_IDON4 "IDON4"
#define SOG_IDON1 "IDON1" #define SOG_INTSI "INTSI"
#define SOG_IDON2 "IDON2" #define SOG_INTAF "INTAF"
#define SOG_IDON3 "IDON3" #define SOG_TOTDON "TOTDON"
#define SOG_IDON4 "IDON4" #define SOG_DATAULTDON "DATAULTDON"
#define SOG_INTSI "INTSI" #define SOG_TIPOULTDON "TIPOULTDON"
#define SOG_INTAF "INTAF" #define SOG_DATAULTSI "DATAULTSI"
#define SOG_TOTDON "TOTDON" #define SOG_DATAULTAF "DATAULTAF"
#define SOG_DATAULTDON "DATAULTDON" #define SOG_TOTDONSI "TOTDONSI"
#define SOG_TIPOULTDON "TIPOULTDON" #define SOG_TOTDONAF "TOTDONAF"
#define SOG_DATAULTSI "DATAULTSI" #define SOG_DATAPROSSI "DATAPROSSI"
#define SOG_DATAULTAF "DATAULTAF" #define SOG_DATAPROSAF "DATAPROSAF"
#define SOG_TOTDONSI "TOTDONSI" #define SOG_GRUPPOAB0 "GRUPPOAB0"
#define SOG_TOTDONAF "TOTDONAF" #define SOG_RHANTID "RHANTID"
#define SOG_DATAPROSSI "DATAPROSSI" #define SOG_KELL "KELL"
#define SOG_DATAPROSAF "DATAPROSAF" #define SOG_FENOTIPORH "FENOTIPORH"
#define SOG_GRUPPOAB0 "GRUPPOAB0" #define SOG_DU "DU"
#define SOG_RHANTID "RHANTID" #define SOG_PUNTORACC "PUNTORACC"
#define SOG_KELL "KELL" #define SOG_CODMED "CODMED"
#define SOG_FENOTIPORH "FENOTIPORH" #define SOG_MODCONV "MODCONV"
#define SOG_DU "DU" #define SOG_GIOPREDON "GIOPREDON"
#define SOG_DATAULTAGG "DATAULTAGG" #define SOG_GIOPRECON "GIOPRECON"
#define SOG_UTENULTAGG "UTENULTAGG" #define SOG_NUMCONV "NUMCONV"
#define SOG_DATAULTCAR "DATAULTCAR" #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"