Patch level : 1.7 at
Files correlati : at9.exe Ricompilazione Demo : [ ] Commento : agginto programma Estrazione archivi per aggiornamento git-svn-id: svn://10.65.10.50/trunk@11649 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
43b40040a5
commit
e8bf975476
@ -13,7 +13,9 @@ int main(int argc,char** argv)
|
||||
switch (r)
|
||||
{
|
||||
case 0:
|
||||
rt = at9100(argc,argv) ; break;
|
||||
rt = at9100(argc,argv) ; break; // statistica soggetti sospesi
|
||||
case 1:
|
||||
rt = at9200(argc,argv) ; break; // crea aggiornamento per provinciale
|
||||
default:
|
||||
error_box(usage, argv[0]) ; break;
|
||||
}
|
||||
|
1
at/at9.h
1
at/at9.h
@ -2,6 +2,7 @@
|
||||
#define __AT9_H
|
||||
|
||||
int at9100(int argc, char* argv[]);
|
||||
int at9200(int argc, char* argv[]);
|
||||
|
||||
#endif // __AT9_H
|
||||
|
||||
|
204
at/at9200.cpp
Executable file
204
at/at9200.cpp
Executable file
@ -0,0 +1,204 @@
|
||||
#include <applicat.h>
|
||||
#include <filetext.h>
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <progind.h>
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
#include <printer.h>
|
||||
#include <recarray.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "at9.h"
|
||||
#include "at9200a.h"
|
||||
|
||||
#include "soggetti.h"
|
||||
#include "donaz.h"
|
||||
#include "contsan.h"
|
||||
#include "idoneita.h"
|
||||
#include "benem.h"
|
||||
#include "storico.h"
|
||||
|
||||
|
||||
|
||||
class TCom2prov: public TSkeleton_application
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
TConfig* _configfile;
|
||||
|
||||
protected:
|
||||
virtual bool create(void);
|
||||
virtual void main_loop();
|
||||
virtual bool destroy(void) ;
|
||||
void transfer();
|
||||
|
||||
public:
|
||||
const TMask& msk() const { return *_msk; }
|
||||
TCom2prov() {}
|
||||
virtual ~TCom2prov() {}
|
||||
};
|
||||
|
||||
// restituisce un riferimento all' applicazione
|
||||
inline TCom2prov& app() { return (TCom2prov&) main_app();}
|
||||
|
||||
// creazione dell'applicazione
|
||||
bool TCom2prov::create()
|
||||
{
|
||||
_msk = new TMask("at9200a");
|
||||
_configfile = new TConfig("at9200a.ini");
|
||||
return TSkeleton_application::create();
|
||||
}
|
||||
|
||||
// distruzione dell'applicazione
|
||||
bool TCom2prov::destroy()
|
||||
{
|
||||
delete _configfile;
|
||||
delete _msk;
|
||||
return TSkeleton_application::destroy();
|
||||
}
|
||||
|
||||
// carica la maschera
|
||||
void TCom2prov::main_loop()
|
||||
{
|
||||
_msk->set(F_PERCORSO,_configfile->get("PERCORSO", "ARCHIVIO"));
|
||||
_msk->set(F_DATA,_configfile->get("DATA", "ARCHIVIO"));
|
||||
KEY key = _msk->run();
|
||||
if (key == K_ENTER)
|
||||
{
|
||||
transfer();
|
||||
_configfile->set("PERCORSO", _msk->get(F_PERCORSO), "ARCHIVIO");
|
||||
TDate oggi(TODAY);
|
||||
_configfile->set("DATA", oggi, "ARCHIVIO");
|
||||
}
|
||||
}
|
||||
|
||||
// trasferimento dati da file CT su programma avis
|
||||
void TCom2prov::transfer()
|
||||
{
|
||||
bool anagrafica = _msk->get_bool(F_ANAGRAFICA);
|
||||
const bool donazioni = _msk->get_bool(F_DONAZIONI);
|
||||
const bool controlli = _msk->get_bool(F_CONTROLLI);
|
||||
const bool benemerenze = _msk->get_bool(F_BENEMERENZE);
|
||||
const bool storico = _msk->get_bool(F_STORICO);
|
||||
TString80 percorso = _msk->get(F_PERCORSO);
|
||||
percorso.insert("%");
|
||||
TString80 nomesog = percorso;
|
||||
nomesog << "SOGGETTI";
|
||||
TString80 nomedon = percorso;
|
||||
nomedon << "DONAZ";
|
||||
TString80 nomecon = percorso;
|
||||
nomecon << "CONTSAN";
|
||||
TString80 nomeido = percorso;
|
||||
nomeido << "IDONEITA";
|
||||
TString80 nomeben = percorso;
|
||||
nomeben << "BENEM";
|
||||
TString80 nomesto = percorso;
|
||||
nomesto << "STORICO";
|
||||
|
||||
TIsamtempfile filecon(LF_CONTSAN, (const char*) nomecon);
|
||||
TIsamtempfile filesog(LF_SOGGETTI, (const char *) nomesog);
|
||||
TIsamtempfile filedon(LF_DONAZ, (const char* ) nomedon);
|
||||
TIsamtempfile fileido(LF_IDONEITA, (const char*) nomeido);
|
||||
TIsamtempfile fileben(LF_BENEM, (const char*) nomeben);
|
||||
TIsamtempfile filesto(LF_STORICO, (const char*) nomesto);
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
if (donazioni)
|
||||
{
|
||||
_rel->add(LF_DONAZ, "CODICE==CODICE");
|
||||
}
|
||||
if (controlli)
|
||||
{
|
||||
_rel->add(LF_CONTSAN, "CODICE==CODICE");
|
||||
_rel->add(LF_IDONEITA, "CODICE==CODICE");
|
||||
}
|
||||
if (benemerenze)
|
||||
_rel->add(LF_BENEM, "CODICE==CODICE");
|
||||
if (storico)
|
||||
_rel->add(LF_STORICO, "CODICE==CODICE");
|
||||
anagrafica = (anagrafica || donazioni || controlli || benemerenze || storico);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
da.zero();
|
||||
const TString16 codsez = _msk->get(F_SEZINI);
|
||||
const TString16 codsot = _msk->get(F_SOTINI);
|
||||
if (codsez.not_empty())
|
||||
da.put(SOG_CODSEZ, codsez);
|
||||
if (codsot.not_empty())
|
||||
da.put(SOG_CODSOT, codsot);
|
||||
|
||||
TString80 filtro = "";
|
||||
const TDate data = _msk->get_date(F_DATA);
|
||||
if (data.ok())
|
||||
filtro << "(ANSI(" << SOG_DATAULTAGG << ")>=\"" << data.string(ANSI) << "\")";
|
||||
TCursor cursore(_rel, filtro, 3, &da, &da);
|
||||
long records = cursore.items();
|
||||
TProgind pi(records,"Estrazione dati", TRUE, TRUE);
|
||||
pi.setstatus(1);
|
||||
for (cursore = 0; cursore.pos() < records; ++(cursore))
|
||||
{
|
||||
const long codsog = cursore.curr().get_long(SOG_CODICE);
|
||||
pi.addstatus(1);
|
||||
if (pi.iscancelled()) break;
|
||||
if (anagrafica)
|
||||
filesog.write(cursore.curr());
|
||||
if (donazioni)
|
||||
{
|
||||
bool continua = TRUE;
|
||||
while (continua)
|
||||
{
|
||||
const long codice = cursore.curr(LF_DONAZ).get_long(DON_CODICE);
|
||||
if (codice == codsog)
|
||||
filedon.write(cursore.curr(LF_DONAZ));
|
||||
continua = cursore.next_match(LF_DONAZ, "CODICE");
|
||||
}
|
||||
}
|
||||
if (controlli)
|
||||
{
|
||||
bool continua = TRUE;
|
||||
while (continua)
|
||||
{
|
||||
const long codice = cursore.curr(LF_CONTSAN).get_long(CON_CODICE);
|
||||
if (codice == codsog)
|
||||
filecon.write(cursore.curr(LF_CONTSAN));
|
||||
continua = cursore.next_match(LF_CONTSAN, "CODICE");
|
||||
}
|
||||
continua = TRUE;
|
||||
while (continua)
|
||||
{
|
||||
const long codice = cursore.curr(LF_IDONEITA).get_long(IDO_CODICE);
|
||||
if (codice == codsog)
|
||||
fileido.write(cursore.curr(LF_IDONEITA));
|
||||
continua = cursore.next_match(LF_IDONEITA, "CODICE");
|
||||
}
|
||||
}
|
||||
if (benemerenze)
|
||||
{
|
||||
bool continua = TRUE;
|
||||
while (continua)
|
||||
{
|
||||
const long codice = cursore.curr(LF_BENEM).get_long(BEN_CODICE);
|
||||
if (codice == codsog)
|
||||
fileben.write(cursore.curr(LF_BENEM));
|
||||
continua = cursore.next_match(LF_BENEM, "CODICE");
|
||||
}
|
||||
}
|
||||
if (storico)
|
||||
{
|
||||
bool continua = TRUE;
|
||||
while (continua)
|
||||
{
|
||||
const long codice = cursore.curr(LF_STORICO).get_long(STO_CODICE);
|
||||
if (codice == codsog)
|
||||
filesto.write(cursore.curr(LF_STORICO));
|
||||
continua = cursore.next_match(LF_STORICO, "CODICE");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int at9200(int argc, char* argv[])
|
||||
{
|
||||
TCom2prov a;
|
||||
a.run(argc, argv, "Estrazione archivi per aggiornamento");
|
||||
return 0;
|
||||
}
|
14
at/at9200a.h
Executable file
14
at/at9200a.h
Executable file
@ -0,0 +1,14 @@
|
||||
// crea archivi poer aggiornamento provinciale
|
||||
// definizione campi per maschera di selezione
|
||||
|
||||
#define F_ANAGRAFICA 101
|
||||
#define F_DONAZIONI 102
|
||||
#define F_CONTROLLI 103
|
||||
#define F_BENEMERENZE 104
|
||||
#define F_STORICO 105
|
||||
#define F_DATA 106
|
||||
#define F_PERCORSO 107
|
||||
#define F_SEZINI 108
|
||||
#define F_D_SEZINI 109
|
||||
#define F_SOTINI 110
|
||||
#define F_D_SOTINI 111
|
113
at/at9200a.uml
Executable file
113
at/at9200a.uml
Executable file
@ -0,0 +1,113 @@
|
||||
#include "at9200a.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Estrazione archivi per aggiornamento" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 13
|
||||
BEGIN
|
||||
PROMPT 1 1 "Opzioni di trasferimento"
|
||||
END
|
||||
|
||||
BOOLEAN F_ANAGRAFICA
|
||||
BEGIN
|
||||
PROMPT 2 2 "Dati anagrafici"
|
||||
END
|
||||
|
||||
BOOLEAN F_DONAZIONI
|
||||
BEGIN
|
||||
PROMPT 2 3 "Donazioni"
|
||||
END
|
||||
|
||||
BOOLEAN F_CONTROLLI
|
||||
BEGIN
|
||||
PROMPT 2 4 "Controlli sanitari e idoneita'"
|
||||
END
|
||||
|
||||
BOOLEAN F_BENEMERENZE
|
||||
BEGIN
|
||||
PROMPT 2 5 "Benemerenze"
|
||||
END
|
||||
|
||||
BOOLEAN F_STORICO
|
||||
BEGIN
|
||||
PROMPT 2 6 "Storico"
|
||||
END
|
||||
|
||||
DATE F_DATA
|
||||
BEGIN
|
||||
PROMPT 2 8 "Modifiche a partire dal "
|
||||
END
|
||||
|
||||
STRING F_PERCORSO 50
|
||||
BEGIN
|
||||
PROMPT 2 9 "Percorso "
|
||||
END
|
||||
|
||||
STRING F_SEZINI 2
|
||||
BEGIN
|
||||
PROMPT 2 11 "Sezione "
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_SEZINI
|
||||
INPUT CODSOT F_SOTINI
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_SEZINI CODSEZ
|
||||
OUTPUT F_D_SEZINI DENSEZ
|
||||
OUTPUT F_SOTINI CODSOT
|
||||
OUTPUT F_D_SOTINI DENSOT
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sezione da cui partire"
|
||||
END
|
||||
|
||||
STRING F_D_SEZINI 25
|
||||
BEGIN
|
||||
PROMPT 16 11 ""
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
COPY OUTPUT F_SEZINI
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sezione da cui partire"
|
||||
END
|
||||
|
||||
STRING F_SOTINI 2
|
||||
BEGIN
|
||||
PROMPT 2 12 "Sottog. "
|
||||
COPY ALL F_SEZINI
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo da cui partire"
|
||||
END
|
||||
|
||||
STRING F_D_SOTINI 25
|
||||
BEGIN
|
||||
PROMPT 16 12 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_D_SEZINI
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
INPUT DENSOT F_D_SOTINI
|
||||
COPY DISPLAY F_D_SEZINI
|
||||
COPY OUTPUT F_D_SEZINI
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo da cui partire"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
Loading…
x
Reference in New Issue
Block a user