modifiche per adeguare i tracciati alle richieste della commissione informatica nazionale

git-svn-id: svn://10.65.10.50/trunk@3988 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1996-12-10 08:48:49 +00:00
parent 364e3b63f6
commit aa008393bc
11 changed files with 628 additions and 658 deletions

View File

@ -43,7 +43,7 @@ class TSospesi_application : public TPrintapp
ts _tipo_stampa; ts _tipo_stampa;
TString16 _codsez, _codsot; TString16 _codsez, _codsot;
static bool filter_func_sospesi(const TRelation *); static bool filter_func_sospesi(const TRelation* rel);
protected: protected:
virtual bool user_create(); virtual bool user_create();
@ -129,11 +129,9 @@ void TSospesi_application::set_page(int file, int cnt)
bool TSospesi_application::filter_func_sospesi(const TRelation* rel) bool TSospesi_application::filter_func_sospesi(const TRelation* rel)
{ {
bool filtrato = TRUE; bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile(); TLocalisamfile& sog = rel->lfile();
// filtro per categorie
TAssoc_array categorie = app()._categorie; TAssoc_array categorie = app()._categorie;
if (categorie.items() != 0) if (categorie.items() != 0)
{ {

View File

@ -31,7 +31,7 @@ public:
class TPereta_application : public TPrintapp class TPereta_application : public TPrintapp
{ {
static bool filter_func_pereta(const TRelation *); static bool filter_func_pereta(const TRelation* rel);
TRelation* _rel; TRelation* _rel;
TMask* _msk; TMask* _msk;
@ -135,8 +135,7 @@ bool TPereta_application::filter_func_pereta(const TRelation* rel)
{ {
bool filtrato = TRUE; bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile(); TLocalisamfile& sog = rel->lfile();
// filtro per categorie
// fiiltro per categorie
TAssoc_array categorie = app()._categorie; TAssoc_array categorie = app()._categorie;
if (categorie.items() != 0) if (categorie.items() != 0)
{ {

View File

@ -31,7 +31,7 @@ public:
class TEsclusi_application : public TPrintapp class TEsclusi_application : public TPrintapp
{ {
static bool filter_func_esclusi(const TRelation *); static bool filter_func_esclusi(const TRelation* rel);
TRelation* _rel; TRelation* _rel;
TMask* _msk; TMask* _msk;
@ -127,8 +127,7 @@ void TEsclusi_application::set_page(int file, int cnt)
bool TEsclusi_application::filter_func_esclusi(const TRelation * rel) bool TEsclusi_application::filter_func_esclusi(const TRelation * rel)
{ {
bool filtrato = TRUE; bool filtrato = TRUE;
TLocalisamfile sog = rel->lfile(); TLocalisamfile& sog = rel->lfile();
//filtro per categorie //filtro per categorie
TAssoc_array categorie = app()._categorie; TAssoc_array categorie = app()._categorie;
if (categorie.items() != 0) if (categorie.items() != 0)

View File

@ -1,241 +1,241 @@
#include <mask.h> #include <mask.h>
#include <printapp.h> #include <printapp.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
#include <lffiles.h> #include <lffiles.h>
#include "lf.h" #include "lf.h"
#include "soggetti.h" #include "soggetti.h"
#include "benem.h" #include "benem.h"
#include "at2.h" #include "at2.h"
#include "at2400a.h" #include "at2400a.h"
class TBenem_application : public TPrintapp class TBenem_application : public TPrintapp
{ {
static bool filter_func_benem(const TRelation *); static bool filter_func_benem(const TRelation* rel);
TRelation* _rel; TRelation* _rel;
TMask* _msk; TMask* _msk;
TLocalisamfile* _benem; TLocalisamfile* _benem;
TRecord_array* _sbenemerenze; TRecord_array* _sbenemerenze;
int _cur1, _cur2, _cur3, _cur4; int _cur1, _cur2, _cur3, _cur4;
TDate _data_stampa; TDate _data_stampa;
TString _codsez, _codsot; TString _codsez, _codsot;
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();
TMask& app_mask() { return *_msk; } TMask& app_mask() { return *_msk; }
TBenem_application() : _data_stampa(TODAY) {} TBenem_application() : _data_stampa(TODAY) {}
}; };
HIDDEN inline TBenem_application& app() { return (TBenem_application&) main_app(); } HIDDEN inline TBenem_application& app() { return (TBenem_application&) main_app(); }
void TBenem_application::filtra_sezioni() void TBenem_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 TBenem_application::set_page(int file, int cnt) void TBenem_application::set_page(int file, int cnt)
{ {
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@S", FLD(LF_SOGGETTI,SOG_TOTDON)); set_row(1,"@50g@S", FLD(LF_SOGGETTI,SOG_TOTDON));
set_row(2,"@13g@S", FLD(LF_SOGGETTI,SOG_NOME)); set_row(2,"@13g@S", FLD(LF_SOGGETTI,SOG_NOME));
set_row(2,"@50g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); set_row(2,"@50g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
} }
bool TBenem_application::filter_func_benem(const TRelation* rel) bool TBenem_application::filter_func_benem(const TRelation* rel)
{ {
bool filtrato = TRUE; bool filtrato = TRUE;
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI)); TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
//filtro per categorie //filtro per 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);
TAssoc_array categorie; TAssoc_array categorie;
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;
} }
return filtrato; return filtrato;
} }
bool TBenem_application::preprocess_page(int file, int counter) bool TBenem_application::preprocess_page(int file, int counter)
{ {
// contatore soggetti stampati // contatore soggetti stampati
// per ora non c'è // per ora non c'è
// 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;
} }
return TRUE; return TRUE;
} }
int get_donbene(TString tipo) int get_donbene(TString tipo)
{ {
int donbene = 0; int donbene = 0;
TTable bnz("BNZ"); TTable bnz("BNZ");
bnz.put("CODTAB",tipo); bnz.put("CODTAB",tipo);
if (bnz.read() == NOERR) if (bnz.read() == NOERR)
donbene = bnz.get_int("I0"); donbene = bnz.get_int("I0");
return donbene; return donbene;
} }
bool TBenem_application::set_print(int) bool TBenem_application::set_print(int)
{ {
KEY tasto; KEY tasto;
tasto = _msk->run(); tasto = _msk->run();
if (tasto == F_ELENCO) if (tasto == F_ELENCO)
{ {
//_codsez.spaces(2); //_codsez.spaces(2);
//_codsot.spaces(2); //_codsot.spaces(2);
_codsez = "**"; _codsez = "**";
_codsot = "**"; _codsot = "**";
reset_files(); reset_files();
add_file(LF_SOGGETTI); add_file(LF_SOGGETTI);
TString tipoben = _msk->get(F_TIPOBEN); TString tipoben = _msk->get(F_TIPOBEN);
filtra_sezioni(); filtra_sezioni();
int donbene = get_donbene(tipoben); int donbene = get_donbene(tipoben);
if (tipoben.not_empty() && tipoben.ok()) if (tipoben.not_empty() && tipoben.ok())
current_cursor()->setfilter(format("TOTDON >= \"%i\"",donbene)); current_cursor()->setfilter(format("TOTDON >= \"%i\"",donbene));
else else
current_cursor()->setfilter(format("TOTDON >= \"%i\"",donbene)); current_cursor()->setfilter(format("TOTDON >= \"%i\"",donbene));
// current_cursor()->setfilter("ESCLUSO != \"\""); // current_cursor()->setfilter("ESCLUSO != \"\"");
current_cursor()->set_filterfunction(filter_func_benem); current_cursor()->set_filterfunction(filter_func_benem);
crea_intestazione(); crea_intestazione();
return TRUE; return TRUE;
} }
else else
return FALSE; return FALSE;
} }
void TBenem_application::crea_intestazione() void TBenem_application::crea_intestazione()
{ {
TString sep(132); TString sep(132);
TString data_stampa; TString data_stampa;
reset_header(); reset_header();
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,"@0gELENCO SOGGETTI CHE DEVONO RICEVERE LA BENEMERENZA xx@104gDATA"); set_header(2,"@0gELENCO SOGGETTI CHE DEVONO RICEVERE LA BENEMERENZA xx@104gDATA");
data_stampa = _data_stampa.string(); data_stampa = _data_stampa.string();
set_header(2,"@109g%10s", (const char*) data_stampa); set_header(2,"@109g%10s", (const char*) data_stampa);
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 esc."); set_header(5,"@0gCod.@10gC.@13gCognome@39gNato il@50gData esc.");
set_header(6,"@13gNome@50gTipo esc."); set_header(6,"@13gNome@50gTipo esc.");
set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g--------"); set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g--------");
} }
bool TBenem_application::user_create() bool TBenem_application::user_create()
{ {
_rel = new TRelation(LF_SOGGETTI); _rel = new TRelation(LF_SOGGETTI);
//_rel->add(LF_BENEM, "CODICE==CODICE"); //_rel->add(LF_BENEM, "CODICE==CODICE");
_benem = new TLocalisamfile(LF_BENEM); _benem = new TLocalisamfile(LF_BENEM);
_sbenemerenze = new TRecord_array(LF_BENEM,BEN_PROGBEN); _sbenemerenze = new TRecord_array(LF_BENEM,BEN_PROGBEN);
_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("at2400a"); _msk = new TMask("at2400a");
return TRUE; return TRUE;
} }
bool TBenem_application::user_destroy() bool TBenem_application::user_destroy()
{ {
delete _msk; delete _msk;
delete _rel; delete _rel;
delete _benem; delete _benem;
delete _sbenemerenze; delete _sbenemerenze;
return TRUE; return TRUE;
} }
int at2400(int argc, char* argv[]) int at2400(int argc, char* argv[])
{ {
TBenem_application a; TBenem_application a;
a.run(argc, argv, "Elenco premiati"); a.run(argc, argv, "Elenco premiati");
return 0; return 0;
} }

View File

@ -130,13 +130,15 @@ void TIdonei_application::set_page(int file, int cnt)
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(); TLocalisamfile& sog = rel->lfile();
// filtro per categorie
TAssoc_array categorie = app()._categorie; TAssoc_array categorie = app()._categorie;
if (categorie.items() != 0) if (categorie.items() != 0)
{ {
TString16 catsog = sog.get(SOG_CATDON); TString16 catsog = sog.get(SOG_CATDON);
filtrato = categorie.is_key((const char*) catsog); filtrato = categorie.is_key((const char*) catsog);
} }
// filtro per idoneità
if (filtrato) if (filtrato)
{ {
TAssoc_array idoneita; TAssoc_array idoneita;

View File

@ -126,13 +126,15 @@ void TIscritti_application::set_page(int file, int cnt)
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(); TLocalisamfile& sog = rel->lfile();
// filtro per categorie
TAssoc_array categorie = app()._categorie; TAssoc_array categorie = app()._categorie;
if (categorie.items() != 0) if (categorie.items() != 0)
{ {
TString16 cat = sog.get(SOG_CATDON); TString16 cat = sog.get(SOG_CATDON);
filtrato = categorie.is_key((const char*) cat); filtrato = categorie.is_key((const char*) cat);
} }
// filtrp per date iscrizione/dimissione
if (filtrato) if (filtrato)
{ {
if (app()._tipo_iscdim == ISCRITTI) if (app()._tipo_iscdim == ISCRITTI)

View File

@ -16,8 +16,8 @@
#define STATO_IDONEO 'I' // IDONEITA' #define STATO_IDONEO 'I' // IDONEITA'
#define STATO_FINESO 'F' // FINE SOSPENSIONE #define STATO_FINESO 'F' // FINE SOSPENSIONE
// tpi di stampa
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 }; //tipi di stampe 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
@ -35,7 +35,7 @@ public:
class TConv_application : public TPrintapp class TConv_application : public TPrintapp
{ {
static bool filter_func_conv(const TRelation *); static bool filter_func_conv(const TRelation* rel);
TRelation* _rel; TRelation* _rel;
TMask* _msk; TMask* _msk;
@ -147,15 +147,12 @@ void TConv_application::set_page(int file, int cnt)
} }
} }
bool TConv_application::filter_func_conv (const TRelation * rel) bool TConv_application::filter_func_conv (const TRelation* rel)
{ {
TLocalisamfile& sog = rel->lfile(); TLocalisamfile& sog = rel->lfile();
TDate dataprossi = sog.get_date(SOG_DATAPROSSI); TDate dataprossi = sog.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())
{ {
@ -163,7 +160,6 @@ bool TConv_application::filter_func_conv (const TRelation * rel)
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

View File

@ -40,7 +40,7 @@ class TTessere_application : public TPrintapp
ts _tipo_stampa; ts _tipo_stampa;
TString _riepilogodon; TString _riepilogodon;
static bool filter_func_tessere(const TRelation *); static bool filter_func_tessere(const TRelation* rel);
protected: protected:
virtual bool user_create(); virtual bool user_create();

View File

@ -31,7 +31,7 @@ public:
class TUrgenze_application : public TPrintapp class TUrgenze_application : public TPrintapp
{ {
static bool filter_func_urgenze(const TRelation *); static bool filter_func_urgenze(const TRelation* rel);
TRelation* _rel; TRelation* _rel;
TMask* _msk; TMask* _msk;
@ -130,12 +130,10 @@ void TUrgenze_application::set_page(int file, int cnt)
} }
} }
bool TUrgenze_application::filter_func_urgenze(const TRelation * rel) bool TUrgenze_application::filter_func_urgenze(const TRelation* rel)
{ {
bool filtrato = TRUE; bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile(); TLocalisamfile& sog = rel->lfile();
//filtro per categorie //filtro per categorie
TAssoc_array& categorie = app()._categorie; TAssoc_array& categorie = app()._categorie;
if (categorie.items() != 0) if (categorie.items() != 0)
@ -154,12 +152,10 @@ bool TUrgenze_application::filter_func_urgenze(const TRelation * rel)
{ {
long giorni_sez = rel->lfile(LF_SEZIONI).get_long(SEZ_INTMINCONV); long giorni_sez = rel->lfile(LF_SEZIONI).get_long(SEZ_INTMINCONV);
long giorni = (giorni_sez > app()._giorni) ? giorni_sez : app()._giorni; long giorni = (giorni_sez > app()._giorni) ? giorni_sez : app()._giorni;
TRectype from = sog.curr();
from.zero();
TDate data(TODAY); TDate data(TODAY);
data = data - (const long) giorni; data = data - (const long) giorni;
from.put(SOG_DATAULTDON, data); TDate dataultdon = sog.get(SOG_DATAULTDON);
filtrato = (sog.curr()<= from); filtrato = (dataultdon <= data);
} }
return filtrato; return filtrato;
} }
@ -196,7 +192,6 @@ bool TUrgenze_application::preprocess_page(int file, int counter)
TString16 codsot = current_cursor()->curr().get(SOG_CODSOT); TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);
if ((_codsez!=codsez)||(_codsot!=codsot)) if ((_codsez!=codsez)||(_codsot!=codsot))
{ {
//if (!_codsez.blank())
if (_codsez != "**") if (_codsez != "**")
printer().formfeed(); printer().formfeed();
_codsez = codsez; _codsez = codsez;
@ -237,8 +232,6 @@ bool TUrgenze_application::set_print(int)
{ {
case F_ELENCO: case F_ELENCO:
_tipo_stampa = elenco; _tipo_stampa = elenco;
//_codsez.spaces(2);
//_codsot.spaces(2);
_codsez = "**"; _codsez = "**";
_codsot = "**"; _codsot = "**";
break; break;
@ -251,7 +244,6 @@ bool TUrgenze_application::set_print(int)
reset_files(); reset_files();
add_file(LF_SOGGETTI); add_file(LF_SOGGETTI);
filtra_sezioni(); filtra_sezioni();
// filtro per categorie // filtro per categorie
TString16 catpri = _msk->get(F_CAT1); TString16 catpri = _msk->get(F_CAT1);
TString16 catsec = _msk->get(F_CAT2); TString16 catsec = _msk->get(F_CAT2);
@ -271,7 +263,6 @@ bool TUrgenze_application::set_print(int)
_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);
// filtro per tipizzazione // filtro per tipizzazione
_sangue->zero(); _sangue->zero();
TString16 gruppoab0 = _msk->get(F_GRUPPOAB0); TString16 gruppoab0 = _msk->get(F_GRUPPOAB0);
@ -289,9 +280,7 @@ bool TUrgenze_application::set_print(int)
_sangue->put(SOG_FENOTIPORH, fenotiporh); _sangue->put(SOG_FENOTIPORH, fenotiporh);
if ((du.ok()) && (du.not_empty())) if ((du.ok()) && (du.not_empty()))
_sangue->put(SOG_DU, du); _sangue->put(SOG_DU, du);
_giorni = _msk->get_long(F_GIORNI);
long giorni = _msk->get_long(F_GIORNI);
// filtra solo idonei // filtra solo idonei
current_cursor()->setfilter("TCS->S6 == \"I\"", TRUE); current_cursor()->setfilter("TCS->S6 == \"I\"", TRUE);
// filtra per categorie, tipizzazione e data donazione // filtra per categorie, tipizzazione e data donazione

View File

@ -31,7 +31,7 @@ public:
class TModificati_application : public TPrintapp class TModificati_application : public TPrintapp
{ {
static bool filter_func_modificati(const TRelation *); static bool filter_func_modificati(const TRelation* rel);
TRelation* _rel; TRelation* _rel;
TMask* _msk; TMask* _msk;
@ -126,12 +126,10 @@ void TModificati_application::set_page(int file, int cnt)
} }
} }
bool TModificati_application::filter_func_modificati(const TRelation * rel) bool TModificati_application::filter_func_modificati(const TRelation* rel)
{ {
bool filtrato = TRUE; bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
TLocalisamfile sog = rel->lfile();
//filtro per categorie //filtro per categorie
TAssoc_array& categorie = app()._categorie; TAssoc_array& categorie = app()._categorie;
if (categorie.items() != 0) if (categorie.items() != 0)
@ -257,7 +255,7 @@ bool TModificati_application::set_print(int)
if (catses.not_empty() && catses.ok()) if (catses.not_empty() && catses.ok())
_categorie.add((const char*) catses); _categorie.add((const char*) catses);
current_cursor()->set_filterfunction (filter_func_modificati); current_cursor()->set_filterfunction(filter_func_modificati);
reset_print(); reset_print();
crea_intestazione(); crea_intestazione();
return TRUE; return TRUE;

View File

@ -1,373 +1,360 @@
#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 "at3.h" #include "at3.h"
#include "at3500a.h" #include "at3500a.h"
#define ALIAS_LCP 100 #define ALIAS_LCP 100
#define ALIAS_TCS 200 #define ALIAS_TCS 200
#define IDON_SI "SI" #define IDON_SI "SI"
#define IDON_AF "AF" #define IDON_AF "AF"
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 }; enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 };
// definizione form per etichette // definizione form per etichette
class TScadenze_form : public TForm class TScadenze_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'); } ;
TScadenze_form(): TForm() {}; TScadenze_form(): TForm() {};
TScadenze_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "") TScadenze_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
: TForm(form,code,editlevel,desc) {}; : TForm(form,code,editlevel,desc) {};
virtual ~TScadenze_form() {}; virtual ~TScadenze_form() {};
}; };
class TScadenze_application : public TPrintapp class TScadenze_application : public TPrintapp
{ {
TRelation* _rel; TRelation* _rel;
TMask* _msk; TMask* _msk;
TScadenze_form* _form_eti; TScadenze_form* _form_eti;
TAssoc_array _categorie;
int _cur1, _cur2, _cur3, _cur4;
TParagraph_string _cognome_nome; int _cur1, _cur2, _cur3, _cur4;
TDate _data_stampa; TParagraph_string _cognome_nome;
TDate _dataini, _datafin; TDate _data_stampa;
TString _procdon; TDate _dataini, _datafin;
ts _tipo_stampa; TString16 _procdon;
TString _codsez, _codsot; ts _tipo_stampa;
TString16 _codsez, _codsot;
static bool filter_func_scadenze(const TRelation *);
static bool filter_func_scadenze(const TRelation* rel);
protected:
virtual bool user_create(); protected:
virtual bool user_destroy(); virtual bool user_create();
virtual bool set_print(int m); virtual bool user_destroy();
virtual void set_page(int file, int cnt); virtual bool set_print(int m);
virtual bool preprocess_page(int file, int counter); virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
public:
void crea_intestazione(); public:
void filtra_sezioni(); void crea_intestazione();
void header_sezione(TString codsez, TString codsot); void filtra_sezioni();
TMask& app_mask() { return *_msk; } void header_sezione(TString16 codsez, TString16 codsot);
TScadenze_application() : _data_stampa(TODAY), _cognome_nome("",25) {} TMask& app_mask() { return *_msk; }
}; TScadenze_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TScadenze_application& app() { return (TScadenze_application&) main_app(); }
HIDDEN inline TScadenze_application& app() { return (TScadenze_application&) main_app(); }
TCursor* TScadenze_form::cursor() const { return app().current_cursor(); }
TCursor* TScadenze_form::cursor() const { return app().current_cursor(); }
TRelation* TScadenze_form::relation() const { return cursor()->relation(); }
TRelation* TScadenze_form::relation() const { return cursor()->relation(); }
void TScadenze_application::filtra_sezioni()
{ void TScadenze_application::filtra_sezioni()
TString sezini = _msk->get(F_SEZINI); {
TString sotini = _msk->get(F_SOTINI); TString16 sezini = _msk->get(F_SEZINI);
TString sezfin = _msk->get(F_SEZFIN); TString16 sotini = _msk->get(F_SOTINI);
TString sotfin = _msk->get(F_SOTFIN); TString16 sezfin = _msk->get(F_SEZFIN);
select_cursor(_cur4); TString16 sotfin = _msk->get(F_SOTFIN);
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI); select_cursor(_cur4);
TRectype da(fl.curr()); TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
TRectype a(fl.curr()); TRectype da(fl.curr());
da.zero(); TRectype a(fl.curr());
a.zero(); da.zero();
if ((sezini.not_empty()) && (sezini.ok())) a.zero();
da.put(SOG_CODSEZ, sezini); if ((sezini.not_empty()) && (sezini.ok()))
if ((sotini.not_empty()) && (sotini.ok())) da.put(SOG_CODSEZ, sezini);
da.put(SOG_CODSOT, sotini); if ((sotini.not_empty()) && (sotini.ok()))
if ((sezfin.not_empty()) && (sezfin.ok())) da.put(SOG_CODSOT, sotini);
a.put(SOG_CODSEZ, sezfin); if ((sezfin.not_empty()) && (sezfin.ok()))
if ((sotfin.not_empty()) && (sotfin.ok())) a.put(SOG_CODSEZ, sezfin);
a.put(SOG_CODSOT, sotfin); if ((sotfin.not_empty()) && (sotfin.ok()))
current_cursor()->setregion(da, a); a.put(SOG_CODSOT, sotfin);
} current_cursor()->setregion(da, a);
}
void TScadenze_application::set_page(int file, int cnt)
{ void TScadenze_application::set_page(int file, int cnt)
// costruzione etichette {
switch (_tipo_stampa) // costruzione etichette
{ switch (_tipo_stampa)
case etichette: {
{ case etichette:
TPrint_section& corpo = _form_eti->get_body(); {
corpo.reset(); TPrint_section& corpo = _form_eti->get_body();
corpo.update(); corpo.reset();
for (int i = 0; i < corpo.height(); i++) corpo.update();
{ for (int i = 0; i < corpo.height(); i++)
TPrintrow& riga = corpo.row(i); {
set_row(i+1,riga); TPrintrow& riga = corpo.row(i);
} set_row(i+1,riga);
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage }
// altrimenti stampa sempre la stessa etichetta force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
} // altrimenti stampa sempre la stessa etichetta
break; }
case elenco: break;
{ case elenco:
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######")); {
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON)); set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
set_row(1,"@10g#a", &_cognome_nome); set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); set_row(1,"@10g#a", &_cognome_nome);
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID)); // potremmo mettere anche datastato set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@58g@S", FLD(LF_SOGGETTI,SOG_IDON1)); set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID)); // potremmo mettere anche datastato
set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_IDON2)); set_row(1,"@58g@S", FLD(LF_SOGGETTI,SOG_IDON1));
set_row(1,"@64g@S", FLD(LF_SOGGETTI,SOG_IDON3)); set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_IDON2));
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_IDON4)); set_row(1,"@64g@S", FLD(LF_SOGGETTI,SOG_IDON3));
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_IDON4));
set_row(2,"@50g@S", FLD(LF_SOGGETTI,SOG_STATO));
} set_row(2,"@50g@S", FLD(LF_SOGGETTI,SOG_STATO));
break; }
} break;
} }
}
bool TScadenze_application::filter_func_scadenze(const TRelation * rel)
{ bool TScadenze_application::filter_func_scadenze(const TRelation* rel)
{
bool filtrato = TRUE; bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI)); // filtro per categorie
TAssoc_array categorie = app()._categorie;
TAssoc_array categorie; if (categorie.items() != 0)
{
TMask& msk = app().app_mask(); TString16 cat = sog.get(SOG_CATDON);
filtrato = categorie.is_key((const char*) cat);
TString cat = msk.get(F_CAT1); }
if (cat.not_empty() && cat.ok()) // filtro per data di prossima donazione
categorie.add((const char*) cat); if (filtrato)
cat = msk.get(F_CAT2); {
if (cat.not_empty() && cat.ok()) TRectype from = sog->curr();
categorie.add((const char*) cat); TRectype to = sog->curr();
cat = msk.get(F_CAT3); from.zero();
if (cat.not_empty() && cat.ok()) to.zero();
categorie.add((const char*) cat); if (app()._dataini.ok())
cat = msk.get(F_CAT4); {
if (cat.not_empty() && cat.ok()) if (app()._procdon == IDON_SI)
categorie.add((const char*) cat); from.put(SOG_DATAPROSSI, app()._dataini);
cat = msk.get(F_CAT5); else
if (cat.not_empty() && cat.ok()) from.put(SOG_DATAPROSAF, app()._dataini);
categorie.add((const char*) cat); }
cat = msk.get(F_CAT6); if (app()._datafin.ok())
if (cat.not_empty() && cat.ok()) {
categorie.add((const char*) cat); if (app()._procdon == IDON_SI)
to.put(SOG_DATAPROSSI, app()._datafin);
if (categorie.items() != 0) else
{ to.put(SOG_DATAPROSAF, app()._datafin);
TString catsog = sog->curr().get(SOG_CATDON); }
if (categorie.is_key((const char*) catsog)) filtrato = (sog->curr() >= from) && (sog->curr() <= to);
filtrato = TRUE; }
else return filtrato;
filtrato = FALSE; }
}
if (filtrato) bool TScadenze_application::preprocess_page(int file, int counter)
{ {
// filtro per età // contatore soggetti stampati
TRectype from (sog->curr()); // per ora non c'è
TRectype to (sog->curr()); if (_tipo_stampa == elenco)
from.zero(); {
to.zero(); TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
if (app()._dataini.ok()) nome << " ";
{ nome << current_cursor()->curr().get(SOG_NOME);
if (app()._procdon == IDON_SI) _cognome_nome = nome;
from.put(SOG_DATAPROSSI, app()._dataini);
else // salto pagina se cambio sezione
from.put(SOG_DATAPROSAF, app()._dataini); TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
} TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);
if (app()._datafin.ok()) if ((_codsez!=codsez)||(_codsot!=codsot))
{ {
if (app()._procdon == IDON_SI) if (_codsez != "**")
to.put(SOG_DATAPROSSI, app()._datafin); printer().formfeed();
else _codsez = codsez;
to.put(SOG_DATAPROSAF, app()._datafin); _codsot = codsot;
} header_sezione(codsez, codsot);
if ((sog->curr() >= from) && (sog->curr() <= to)) }
filtrato = TRUE; }
else return TRUE;
filtrato = FALSE; }
} void TScadenze_application::header_sezione(TString16 codsez, TString16 codsot)
return filtrato; {
} TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
bool TScadenze_application::preprocess_page(int file, int counter) TString256 intestazione(132);
{ intestazione = "Sezione: ";
// contatore soggetti stampati intestazione << codsez;
// per ora non c'è intestazione << "/";
if (_tipo_stampa == elenco) intestazione << codsot;
{ intestazione << " ";
TString nome = current_cursor()->curr().get(SOG_COGNOME); intestazione << densez;
nome << " "; if ((densot.ok())&& (densot.not_empty()))
nome << current_cursor()->curr().get(SOG_NOME); {
_cognome_nome = nome; intestazione << "/";
intestazione << densot;
// salto pagina se cambio sezione }
TString codsez = current_cursor()->curr().get(SOG_CODSEZ); intestazione.center_just();
TString codsot = current_cursor()->curr().get(SOG_CODSOT); set_header(1,"@0g%s", (const char*) intestazione);
if ((_codsez!=codsez)||(_codsot!=codsot)) return;
{ }
if (_codsez != "**")
printer().formfeed(); bool TScadenze_application::set_print(int m)
_codsez = codsez; {
_codsot = codsot; _tipo_stampa = undefined;
header_sezione(codsez, codsot); KEY tasto;
} tasto = _msk->run();
} switch (tasto)
return TRUE; {
} case F_ELENCO:
_tipo_stampa = elenco;
void TScadenze_application::header_sezione(TString codsez, TString codsot) _codsez = "**";
{ _codsot = "**";
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); break;
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); case F_ETICHETTE:
TString intestazione(132); _tipo_stampa = etichette;
intestazione = "Sezione: "; case F_CARTOLINE:
intestazione << codsez; _tipo_stampa = cartoline;
intestazione << "/"; break;
intestazione << codsot; }
intestazione << " "; if (_tipo_stampa != undefined)
intestazione << densez; {
if ((densot.ok())&& (densot.not_empty())) reset_files();
{ add_file(LF_SOGGETTI);
intestazione << "/"; _dataini = _msk->get(F_DATAINI);
intestazione << densot; _datafin = _msk->get(F_DATAFIN);
} _procdon = _msk->get(F_PROCDON1);
intestazione.center_just(); // filtro per sezioni selezionati
set_header(1,"@0g%s", (const char*) intestazione); filtra_sezioni();
return; // filtro per categorie
} TString16 catpri = _msk->get(F_CAT1);
TString16 catsec = _msk->get(F_CAT2);
bool TScadenze_application::set_print(int m) TString16 catter = _msk->get(F_CAT3);
{ TString16 catqua = _msk->get(F_CAT4);
_tipo_stampa = undefined; TString16 catqui = _msk->get(F_CAT5);
KEY tasto; TString16 catses = _msk->get(F_CAT6);
tasto = _msk->run(); if (catpri.not_empty() && catpri.ok())
switch (tasto) _categorie.add((const char*) catpri);
{ if (catsec.not_empty() && catsec.ok())
case F_ELENCO: _categorie.add((const char*) catsec);
_tipo_stampa = elenco; if (catter.not_empty() && catter.ok())
_codsez = "**"; _categorie.add((const char*) catter);
_codsot = "**"; if (catqua.not_empty() && catqua.ok())
break; _categorie.add((const char*) catqua);
case F_ETICHETTE: if (catqui.not_empty() && catqui.ok())
_tipo_stampa = etichette; _categorie.add((const char*) catqui);
case F_CARTOLINE: if (catses.not_empty() && catses.ok())
_tipo_stampa = cartoline; _categorie.add((const char*) catses);
break; // filtro per idoneo e non escluso
} current_cursor()->setfilter("((TCS->S6 == \"I\" ) || (TCS->S6 == \"F\")) && (ESCLUSO == \"\")", TRUE);
if (_tipo_stampa != undefined)
{ // filtro per procedura di donazione (controllo che abbia la data)
reset_files(); /* questo filtro è nella filter_function
add_file(LF_SOGGETTI); TString16 procdon = _msk->get(F_PROCDON1);
_dataini = _msk->get(F_DATAINI); if (procdon == IDON_SI)
_datafin = _msk->get(F_DATAFIN); current_cursor()->setfilter("(DATAPROSSI == \"\")", TRUE);
_procdon = _msk->get(F_PROCDON1); else
current_cursor()->setfilter("(DATAPROSAF == \"\")", TRUE);
// filtro per sezioni selezionati */
filtra_sezioni(); // filtro per categorie
current_cursor()->set_filterfunction(filter_func_scadenze);
// filtro per idoneo e non escluso reset_print();
current_cursor()->setfilter("((TCS->S6 == \"I\" ) || (TCS->S6 == \"F\")) && (ESCLUSO == \"\")", TRUE); crea_intestazione();
return TRUE;
// filtro per procedura di donazione (controllo che abbia la data) }
/* questo filtro è nella filter_function else
TString procdon = _msk->get(F_PROCDON1); return FALSE;
if (procdon == IDON_SI) }
current_cursor()->setfilter("(DATAPROSSI == \"\")", TRUE);
else void TScadenze_application::crea_intestazione()
current_cursor()->setfilter("(DATAPROSAF == \"\")", TRUE); {
*/ reset_header();
// filtro per categorie
current_cursor()->set_filterfunction(filter_func_scadenze); if (_tipo_stampa == elenco)
reset_print(); {
crea_intestazione(); TString256 sep(132);
return TRUE; sep = "SCADENZE DI DONAZIONE ";
} TString16 procdon = _msk->get(F_PROCDON1);
else sep << procdon ;
return FALSE; TDate data = _msk->get(F_DATAINI);
} if (data.ok())
{
void TScadenze_application::crea_intestazione() sep << " dal ";
{ sep << data.string();
reset_header(); }
data = _msk->get(F_DATAFIN);
if (_tipo_stampa == elenco) if (data.ok())
{ {
TString sep(132); sep << " al ";
sep = "SCADENZE DI DONAZIONE "; sep << data.string();
TString procdon = _msk->get(F_PROCDON1); }
sep << procdon ; sep.center_just();
TDate data = _msk->get(F_DATAINI); set_header(2, "@0g%s", (const char*) sep);
if (data.ok()) TString16 data_stampa = _data_stampa.string();
{ set_header(2,"@0g%10s", (const char*) data_stampa);
sep << " dal "; sep = "";
sep << data.string(); sep << "Pag. @#";
} set_header(2, "@120g%s", (const char*) sep);
data = _msk->get(F_DATAFIN);
if (data.ok()) sep = "";
{ sep.fill('-');
sep << " al "; set_header(3, (const char *) sep);
sep << data.string();
} set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData ID@58gTipi idon.");
sep.center_just(); set_header(5,"@47gTipo/Esito");
set_header(2, "@0g%s", (const char*) sep); set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g-- -- -- --");
TString data_stampa = _data_stampa.string(); }
set_header(2,"@0g%10s", (const char*) data_stampa); }
sep = "";
sep << "Pag. @#"; bool TScadenze_application::user_create()
set_header(2, "@120g%s", (const char*) sep); {
_rel = new TRelation(LF_SOGGETTI);
sep = ""; _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
sep.fill('-'); _rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
set_header(3, (const char *) sep); _rel->add(LF_COMUNI, "COM==COM");
// per stampare la denominazione della sezione nell'intestazione
set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData ID@58gTipi idon."); _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
set_header(5,"@47gTipo/Esito");
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g-- -- -- --"); _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
} _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
} _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
bool TScadenze_application::user_create()
{ _msk = new TMask("at3500a");
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); _form_eti = new TScadenze_form("AT_ETSOG");
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==COM"); return TRUE;
// per stampare la denominazione della sezione nell'intestazione }
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
bool TScadenze_application::user_destroy()
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice {
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome delete _msk;
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice delete _rel;
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome delete _form_eti;
return TRUE;
_msk = new TMask("at3500a"); }
_form_eti = new TScadenze_form("AT_ETSOG"); int at3500(int argc, char* argv[])
{
return TRUE;
} TScadenze_application a;
bool TScadenze_application::user_destroy() a.run(argc, argv, "Scadenze di donazione");
{
delete _msk; return 0;
delete _rel; }
delete _form_eti;
return TRUE;
}
int at3500(int argc, char* argv[])
{
TScadenze_application a;
a.run(argc, argv, "Scadenze di donazione");
return 0;
}