Patch level : at

Files correlati     : at2.ex at2900a.msk
Ricompilazione Demo : [ ]
Commento            : aggiunto ordinamento (per BZ) e scelta sesso (per BO)


git-svn-id: svn://10.65.10.50/trunk@10612 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2002-11-06 11:00:09 +00:00
parent e2ab75d3a5
commit 664bbb24bb
3 changed files with 37 additions and 9 deletions

View File

@ -55,7 +55,7 @@ class TFrequenza : public TPrintapp
int _etlarghezza, _etcolonne;
bool _stampa80, _ctrltotale;
int _contatore, _totale;
char _condizione;
char _condizione, _sesso;
protected:
virtual bool user_create();
@ -170,12 +170,18 @@ bool TFrequenza::filter_func_freq(const TRelation* rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
// filtro per sesso
if (app()._sesso != 'I')
filtrato = (sog.get(SOG_SESSO)[0] == app()._sesso);
// filtro per categorie
TAssoc_array& categorie = app()._categorie;
if (categorie.items() != 0)
if (filtrato)
{
const TString16 cat = sog.get(SOG_CATDON);
filtrato = categorie.is_key((const char*) cat);
TAssoc_array& categorie = app()._categorie;
if (categorie.items() != 0)
{
const TString16 cat = sog.get(SOG_CATDON);
filtrato = categorie.is_key((const char*) cat);
}
}
// filtro per numero donazioni nel periodo
if (filtrato)
@ -452,6 +458,19 @@ bool TFrequenza::set_print(int m)
_categorie.add((const char*) catqui);
if (catses.not_empty())
_categorie.add((const char*) catses);
_sesso = _msk->get(F_SESSO)[0];
const char ordina = _msk->get(F_ORDINA)[0];
TString256 chiave = "";
switch (ordina)
{
case 'A':
chiave << "90->CODSEZ|90->CODSOT|UPPER(90->COGNOME)|UPPER(90->NOME)";
break;
case 'C':
chiave << "90->DOM_CAP|UPPER(90->COGNOME)|UPPER(90->NOME)";
break;
}
((TSorted_cursor*) current_cursor())->change_order(chiave);
current_cursor()->set_filterfunction (filter_func_freq);
reset_print();
printer().footerlen(0);
@ -538,7 +557,7 @@ bool TFrequenza::user_create()
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPDOM);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur = add_cursor(new TCursor(_rel, "", 3));
add_cursor(new TSorted_cursor(_rel, "", "", 3));
_msk = new TMask("at2900a");
_file = new TExternisamfile("$file");
_donaz = new TLocalisamfile(LF_DONAZ);

View File

@ -38,7 +38,8 @@
#define F_TIPODON5 313
#define F_D_TIPODON5 314
#define F_ORDINA 351
#define F_SESSO 351
#define F_ORDINA 352
#define F_ELENCO 401
#define F_ETICHETTE 402

View File

@ -270,7 +270,7 @@ BEGIN
FLAGS "D"
END
GROUPBOX DLG_NULL 77 8
GROUPBOX DLG_NULL 77 11
BEGIN
PROMPT 1 10 "Opzioni di elaborazione"
END
@ -394,9 +394,17 @@ BEGIN
FLAGS "D"
END
LISTBOX F_SESSO 12
BEGIN
PROMPT 2 17 "Sesso "
ITEM "I|Indifferente"
ITEM "1|Maschi"
ITEM "2|Femmine"
END
LISTBOX F_ORDINA 10
BEGIN
PROMPT 2 17 "Ordinamento per sez./sott. e "
PROMPT 2 18 "Ordinamento per sez./sott. e "
ITEM "A|Alfabetico"
ITEM "C|Cap"
END