Patch level : at
Files correlati : at0.exe Ricompilazione Demo : [ ] Commento : aggiunto programma per cambio intervalli (fatto per lesignano PR) git-svn-id: svn://10.65.10.50/trunk@11276 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5673fcf583
commit
1fdbca03ee
@ -4,7 +4,7 @@
|
||||
|
||||
#include "at0.h"
|
||||
|
||||
#define usage "Error - usage : %s -{0|1|2|3|4|5|6|7}"
|
||||
#define usage "Error - usage : %s -{0|1|2|3|4|5|6|7|8}"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
@ -28,6 +28,8 @@ int main(int argc,char** argv)
|
||||
rt = at0700(argc,argv) ; break;
|
||||
case 7:
|
||||
rt = at0800(argc,argv) ; break;
|
||||
case 8:
|
||||
rt = at0900(argc,argv) ; break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; break;
|
||||
}
|
||||
|
1
at/at0.h
1
at/at0.h
@ -9,6 +9,7 @@ int at0500(int argc, char* argv[]); // parametri di sezione
|
||||
int at0600(int argc, char* argv[]); // chiusura periodica
|
||||
int at0700(int argc, char* argv[]); // sblocco sospesi
|
||||
int at0800(int argc, char* argv[]); // sblocco esclusi
|
||||
int at0900(int argc, char* argv[]); // cambio intervallo per Lesignano PR
|
||||
|
||||
#endif // __AT0_H
|
||||
|
||||
|
152
at/at0900.cpp
Executable file
152
at/at0900.cpp
Executable file
@ -0,0 +1,152 @@
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
#include <tabutil.h>
|
||||
#include <recarray.h>
|
||||
#include <utility.h>
|
||||
#include <lffiles.h>
|
||||
|
||||
#include "at0.h"
|
||||
#include "atlib.h"
|
||||
|
||||
// nomi dei campi
|
||||
#include "soggetti.h"
|
||||
#include "contsan.h"
|
||||
#include "idoneita.h"
|
||||
|
||||
class TIntSI : public TPrintapp
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
int _cur;
|
||||
TLocalisamfile* _contsan;
|
||||
TRecord_array* _scontrolli;
|
||||
TLocalisamfile* _idoneita;
|
||||
TRecord_array* _sidoneita;
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual bool set_print(int m);
|
||||
virtual void set_page(int file, int cnt);
|
||||
virtual bool preprocess_page(int file, int counter);
|
||||
|
||||
public:
|
||||
TIntSI() {}
|
||||
};
|
||||
|
||||
HIDDEN inline TIntSI& app() { return (TIntSI&) main_app(); }
|
||||
|
||||
bool TIntSI::preprocess_page(int file, int counter)
|
||||
{
|
||||
TDate oggi(TODAY);
|
||||
bool rewrite = FALSE;
|
||||
TRectype& recsog = current_cursor()->curr();
|
||||
const int intsi = recsog.get_int(SOG_INTSI);
|
||||
if (intsi == 110 || intsi == 120)
|
||||
{
|
||||
recsog.put(SOG_INTSI, 100);
|
||||
const long codice = recsog.get_long(SOG_CODICE);
|
||||
TRectype* keyc = new TRectype(LF_CONTSAN);
|
||||
keyc->put(CON_CODICE, codice);
|
||||
int err = _scontrolli->read(keyc);
|
||||
TRectype* keyi = new TRectype(LF_IDONEITA);
|
||||
keyi->put(IDO_CODICE, codice);
|
||||
int erri = _sidoneita->read(keyi);
|
||||
if ((err == NOERR || erri == NOERR) && (_scontrolli->rows() > 0 || _sidoneita->rows() > 0))
|
||||
{
|
||||
for (int c=1; c<=_scontrolli->rows(); c++)
|
||||
{
|
||||
TRectype& riga = _scontrolli->row(c, TRUE);
|
||||
int intsi = riga.get_int(CON_INTSI);
|
||||
if (intsi == 110 || intsi == 120)
|
||||
riga.put(CON_INTSI, 100);
|
||||
}
|
||||
/*
|
||||
for (int r=1; r<=_sidoneita->rows(); r++)
|
||||
{
|
||||
TRectype& riga = _sidoneita->row(r, TRUE);
|
||||
const TString16 tipoido = riga.get(IDO_TIPOIDO);
|
||||
if (tipoido == "SI")
|
||||
{
|
||||
int intsi = riga.get_int(IDO_INTERVALLO);
|
||||
if (intsi == 110 || intsi == 120)
|
||||
riga.put(IDO_INTERVALLO, 100);
|
||||
}
|
||||
}
|
||||
*/
|
||||
_scontrolli->rewrite();
|
||||
//_sidoneita->rewrite();
|
||||
con_reord(recsog,_scontrolli, _sidoneita);
|
||||
rewrite = TRUE;
|
||||
}
|
||||
}
|
||||
if (rewrite)
|
||||
{
|
||||
recsog.put(SOG_UTENULTAGG, "PRASSI");
|
||||
recsog.put(SOG_DATAULTAGG, oggi);
|
||||
current_cursor()->file().rewrite();
|
||||
}
|
||||
return rewrite;
|
||||
}
|
||||
|
||||
void TIntSI::set_page(int file, int cnt)
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
|
||||
//set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
|
||||
//set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_NOME));
|
||||
}
|
||||
|
||||
bool TIntSI::set_print(int)
|
||||
{
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
da.zero();
|
||||
a.zero();
|
||||
TString16 codsez = "19";
|
||||
da.put(SOG_CODSEZ, codsez);
|
||||
a.put(SOG_CODSEZ, codsez);
|
||||
current_cursor()->setregion(da,a);
|
||||
current_cursor()->setfilter(format("SESSO == '1'"));
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
reset_print();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool TIntSI::user_create()
|
||||
{
|
||||
_msk = new TMask("at0900a");
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_contsan = new TLocalisamfile(LF_CONTSAN);
|
||||
_scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON);
|
||||
_idoneita = new TLocalisamfile(LF_IDONEITA);
|
||||
_sidoneita = new TRecord_array(LF_IDONEITA,IDO_PROGIDO);
|
||||
_cur = add_cursor(new TCursor(_rel, "", 3));
|
||||
long items = _rel->lfile().items();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TIntSI::user_destroy()
|
||||
{
|
||||
delete _sidoneita;
|
||||
delete _idoneita;
|
||||
delete _scontrolli;
|
||||
delete _contsan;
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at0900(int argc, char* argv[])
|
||||
{
|
||||
TIntSI a;
|
||||
a.run(argc, argv, "Cambio intervalli SI per Lesignano");
|
||||
return 0;
|
||||
}
|
13
at/at0900a.uml
Executable file
13
at/at0900a.uml
Executable file
@ -0,0 +1,13 @@
|
||||
PAGE "Cambio intervalli per Lesignano" -1 -1 78 20
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 14 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
Loading…
x
Reference in New Issue
Block a user