Patch level : 1.7 at
Files correlati : at8.exe Ricompilazione Demo : [ ] Commento : sistemato programma di aggiornamrnto da appoggio / non si pianta più git-svn-id: svn://10.65.10.50/trunk@11648 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
af5040fae0
commit
43b40040a5
@ -102,23 +102,42 @@ bool TReconstruction::destroy()
|
|||||||
return TApplication::destroy();
|
return TApplication::destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int compare_date(const TObject** o1, const TObject** o2)
|
||||||
|
{
|
||||||
|
const TRectype& s1 = *((TRectype*)*o1);
|
||||||
|
const TRectype& s2 = *((TRectype*)*o2);
|
||||||
|
|
||||||
|
const TDate d1(s1.get(IDO_DATAIDO));
|
||||||
|
const TDate d2(s2.get(IDO_DATAIDO));
|
||||||
|
|
||||||
|
int d=0;
|
||||||
|
if (d1>d2) d=+1;
|
||||||
|
else
|
||||||
|
if (d1<d2) d=-1;
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
bool TReconstruction::menu(MENU_TAG m)
|
bool TReconstruction::menu(MENU_TAG m)
|
||||||
{
|
{
|
||||||
KEY tasto = _msk->run();
|
KEY tasto = _msk->run();
|
||||||
if (tasto == K_ENTER)
|
if (tasto == K_ENTER)
|
||||||
{
|
{
|
||||||
|
TLocalisamfile rconvoc(LF_RCONVOC);
|
||||||
_rel->lfile().setkey(1);
|
_rel->lfile().setkey(1);
|
||||||
bool modificato = FALSE;
|
bool modificato = FALSE;
|
||||||
TDate oggi(TODAY);
|
TDate oggi(TODAY);
|
||||||
TRectype recsog = _rel->curr();
|
TRectype recsog = _rel->curr();
|
||||||
TExternisamfile* f = new TExternisamfile("$appoggio");
|
TExternisamfile f("$appoggio");
|
||||||
TProgind *pi;
|
//TExternisamfile f = new TExternisamfile("$appoggio");
|
||||||
pi = new TProgind(f->eod(),"Aggiornamento situazione soggetti da appoggio", FALSE, TRUE, 10);
|
//TProgind *pi;
|
||||||
pi->setstatus(1);
|
//pi = new TProgind(f->eod(),"Aggiornamento situazione soggetti da appoggio", FALSE, TRUE, 10);
|
||||||
for(f->first(); !f->eof(); f->next())
|
TProgind pi(f.eod(),"Aggiornamento situazione soggetti da appoggio", TRUE, TRUE, 10);
|
||||||
|
pi.setstatus(1);
|
||||||
|
for(f.first(); !f.eof(); f.next())
|
||||||
{
|
{
|
||||||
pi->addstatus(1);
|
pi.addstatus(1);
|
||||||
const long codsog = f->get_long("CODICE");
|
if (pi.iscancelled()) break;
|
||||||
|
const long codsog = f.get_long("CODICE");
|
||||||
recsog.zero();
|
recsog.zero();
|
||||||
recsog.put(SOG_CODICE, codsog);
|
recsog.put(SOG_CODICE, codsog);
|
||||||
if (recsog.read(_rel->lfile())==NOERR)
|
if (recsog.read(_rel->lfile())==NOERR)
|
||||||
@ -135,6 +154,8 @@ bool TReconstruction::menu(MENU_TAG m)
|
|||||||
TRectype* key = new TRectype(LF_IDONEITA);
|
TRectype* key = new TRectype(LF_IDONEITA);
|
||||||
key->put(IDO_CODICE, recsog.get(SOG_CODICE));
|
key->put(IDO_CODICE, recsog.get(SOG_CODICE));
|
||||||
_sidoneita->read(key);
|
_sidoneita->read(key);
|
||||||
|
_sidoneita->sort(compare_date);
|
||||||
|
_sidoneita->rewrite();
|
||||||
TRectype* keyc = new TRectype(LF_CONTSAN);
|
TRectype* keyc = new TRectype(LF_CONTSAN);
|
||||||
keyc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
keyc->put(CON_CODICE, recsog.get(SOG_CODICE));
|
||||||
_scontrolli->read(keyc);
|
_scontrolli->read(keyc);
|
||||||
@ -143,7 +164,6 @@ bool TReconstruction::menu(MENU_TAG m)
|
|||||||
con_reord(recsog,_scontrolli,_sidoneita);
|
con_reord(recsog,_scontrolli,_sidoneita);
|
||||||
recsog.rewrite(_rel->lfile());
|
recsog.rewrite(_rel->lfile());
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
TTable ctd("CTD");
|
TTable ctd("CTD");
|
||||||
TString16 catdon = recsog.get(SOG_CATDON);
|
TString16 catdon = recsog.get(SOG_CATDON);
|
||||||
const int totdon = recsog.get_int(SOG_TOTDON);
|
const int totdon = recsog.get_int(SOG_TOTDON);
|
||||||
@ -162,13 +182,13 @@ bool TReconstruction::menu(MENU_TAG m)
|
|||||||
recsog.put(SOG_CATDON, _catfin1);
|
recsog.put(SOG_CATDON, _catfin1);
|
||||||
catdon = _catfin1;
|
catdon = _catfin1;
|
||||||
}
|
}
|
||||||
if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || dimissione))
|
const bool tstampata = recsog.get_bool(SOG_T_STAMPATA);
|
||||||
|
if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || tstampata))
|
||||||
{
|
{
|
||||||
recsog.put(SOG_CATDON, _catfin2);
|
recsog.put(SOG_CATDON, _catfin2);
|
||||||
catdon = _catfin2;
|
catdon = _catfin2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
TDate dataiscsog = recsog.get_date(SOG_DATAISC);
|
TDate dataiscsog = recsog.get_date(SOG_DATAISC);
|
||||||
if (!dataiscsog.ok() && _dataisc)
|
if (!dataiscsog.ok() && _dataisc)
|
||||||
{
|
{
|
||||||
@ -186,7 +206,6 @@ bool TReconstruction::menu(MENU_TAG m)
|
|||||||
const TString16 statosi = recsog.get(SOG_STATOSI);
|
const TString16 statosi = recsog.get(SOG_STATOSI);
|
||||||
if ((stato == 'S') || (statosi == SOSPENSIONE) || (dataprossi > dataconv) || !dataprossi.ok())
|
if ((stato == 'S') || (statosi == SOSPENSIONE) || (dataprossi > dataconv) || !dataprossi.ok())
|
||||||
{
|
{
|
||||||
TLocalisamfile rconvoc(LF_RCONVOC);
|
|
||||||
rconvoc.setkey(3);
|
rconvoc.setkey(3);
|
||||||
rconvoc.zero();
|
rconvoc.zero();
|
||||||
rconvoc.put(RCV_CODICE, recsog.get(SOG_CODICE));
|
rconvoc.put(RCV_CODICE, recsog.get(SOG_CODICE));
|
||||||
@ -203,14 +222,14 @@ bool TReconstruction::menu(MENU_TAG m)
|
|||||||
recsog.put(SOG_NUMCONV,numzero);
|
recsog.put(SOG_NUMCONV,numzero);
|
||||||
}
|
}
|
||||||
recsog.put(SOG_DATAULTAGG, oggi);
|
recsog.put(SOG_DATAULTAGG, oggi);
|
||||||
recsog.put(SOG_UTENULTAGG, "WINSIT");
|
//recsog.put(SOG_UTENULTAGG, "WINSIT");
|
||||||
//recsog.put(SOG_UTENULTAGG, "CONV");
|
recsog.put(SOG_UTENULTAGG, "CONV");
|
||||||
recsog.rewrite(_rel->lfile());
|
recsog.rewrite(_rel->lfile());
|
||||||
}
|
}
|
||||||
f->remove();
|
f.remove();
|
||||||
}
|
}
|
||||||
delete pi;
|
//delete pi;
|
||||||
delete f;
|
//delete f;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user