Patch level : 10.984

Files correlati     :  ci2.exe
Ricompilazione Demo : [ ]
Commento            :

Resi festivi i sabati, migliorata l' evidenziazione dei giorni


git-svn-id: svn://10.65.10.50/branches/R_10_00@22025 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2011-04-23 22:48:28 +00:00
parent de1a2d7aef
commit ae3a9eb666
2 changed files with 66 additions and 49 deletions

View File

@ -36,9 +36,9 @@ class TRil_tree : public TBidirectional_tree
protected: protected:
void highlight(const TString & query, int mese, int anno);
public: public:
void highlight(const TString & query, int mese, int anno);
bool update_content(const TString & query, const TString & dett, int month, int year); bool update_content(const TString & query, const TString & dett, int month, int year);
virtual bool goto_root(); virtual bool goto_root();
virtual bool goto_firstson() { return false; } virtual bool goto_firstson() { return false; }
@ -175,7 +175,7 @@ void TRil_tree::highlight(const TString & query, int mese, int anno)
if (full_days[i]) if (full_days[i])
_t[i - 1] = _full; _t[i - 1] = _full;
else else
_t[i - 1] = day.is_holiday() ? _holiday : _normal; _t[i - 1] = (day.is_holiday() || day.wday() == 6) ? _holiday : _normal;
} }
} }
} }
@ -198,7 +198,7 @@ bool TRil_tree::update_content(const TString & query, const TString & dett, int
{ {
const int i = day.day(); const int i = day.day();
_content.add(format("%d", i)); _content.add(format("%d", i));
_t[i - 1] = day.is_holiday() ? _holiday : _normal; _t[i - 1] = (day.is_holiday() || day.wday() == 6) ? _holiday : _normal;
} }
updated = true; updated = true;
} }
@ -282,10 +282,12 @@ class TRilevamento_cons_msk : public TAutomask
int _anno; int _anno;
int _mese; int _mese;
int _giorno; int _giorno;
int _curr_anno;
int _curr_mese;
int _curr_giorno;
TString _numcn; TString _numcn;
TString _tipocn; TString _tipocn;
TToken_string _last_key; TToken_string _last_key;
TAssoc_array _oredisp;
TAssoc_array _oreprev; TAssoc_array _oreprev;
protected: protected:
@ -607,6 +609,9 @@ void TRilevamento_cons_msk::riempi_sheet(char tipo)
TISAM_recordset def(query); TISAM_recordset def(query);
_curr_giorno = _giorno;
_curr_mese = _mese;
_curr_anno = _anno;
//riempio lo sheet con i dati che soddisfano il filtro preparato prima //riempio lo sheet con i dati che soddisfano il filtro preparato prima
for(bool ok = def.move_first(); ok; ok = def.move_next()) for(bool ok = def.move_first(); ok; ok = def.move_next())
{ {
@ -673,7 +678,6 @@ void TRilevamento_cons_msk::update_tree()
tree->update_content(content_query(), get(F_INTERVALLO), _mese, _anno); tree->update_content(content_query(), get(F_INTERVALLO), _mese, _anno);
cal.force_update(); cal.force_update();
cal.tree()->goto_root(); cal.tree()->goto_root();
} }
void TRilevamento_cons_msk::update_disp() void TRilevamento_cons_msk::update_disp()
@ -715,12 +719,6 @@ void TRilevamento_cons_msk::update_disp()
TString chiave; TString chiave;
chiave.cut(0) << risoatt << codice.rpad(field(F_CODRIS).size()) << day.string(ANSI) << tpora; chiave.cut(0) << risoatt << codice.rpad(field(F_CODRIS).size()) << day.string(ANSI) << tpora;
real * val = (real *)_oredisp.objptr(chiave);
if (val != NULL)
set(F_OREDIS, *val);
else
{
real oredisp; real oredisp;
if (codice.full()) if (codice.full())
{ {
@ -753,8 +751,6 @@ void TRilevamento_cons_msk::update_disp()
oredisp += def.cursor()->curr().get_real("R1"); oredisp += def.cursor()->curr().get_real("R1");
} }
set(F_OREDIS, oredisp); set(F_OREDIS, oredisp);
_oredisp.add(chiave, oredisp);
}
real orecons; real orecons;
codice.trim(); codice.trim();
@ -1024,9 +1020,9 @@ void TRilevamento_cons_msk::registra()
{ {
rilroa.put(RILORE_TIPO, "C"); rilroa.put(RILORE_TIPO, "C");
rilroa.put(RILORE_ID, id); rilroa.put(RILORE_ID, id);
rilroa.put(RILORE_ANNO, _anno); rilroa.put(RILORE_ANNO, _curr_anno);
rilroa.put(RILORE_MESE, _mese); rilroa.put(RILORE_MESE, _curr_mese);
rilroa.put(RILORE_GIORNO, _giorno); rilroa.put(RILORE_GIORNO, _curr_giorno);
rilroa.put(RILORE_TIPORA, tipora); rilroa.put(RILORE_TIPORA, tipora);
rilroa.put(RILORE_CODICE, codice); rilroa.put(RILORE_CODICE, codice);
rilroa.put(RILORE_TPORA, tpora); rilroa.put(RILORE_TPORA, tpora);
@ -1116,6 +1112,7 @@ void TRilevamento_cons_msk::registra()
{ {
ca.destroy(); ca.destroy();
sheet.destroy(); sheet.destroy();
((TRil_tree * )tfield(F_CALENDARIO).tree())->highlight(content_query(), _mese, _anno);
riempi_sheet(); riempi_sheet();
tfield(F_CALENDARIO).force_update(); tfield(F_CALENDARIO).force_update();
} }
@ -1127,14 +1124,7 @@ void TRilevamento_cons_msk::registra()
bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, long jolly) bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, long jolly)
{ {
const short dlg = f.dlg(); const short dlg = f.dlg();
if (e == fe_modify)
{
if (dlg >= S_CDC1 && dlg <= S_CDC12)
{
riempi_sheet();
update_prev();
}
}
if (f.dlg() == _scms_lid) if (f.dlg() == _scms_lid)
{ {
if (e == fe_init || e == fe_modify) if (e == fe_init || e == fe_modify)
@ -1185,12 +1175,27 @@ bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, l
if (e == fe_modify) if (e == fe_modify)
update_tree(); update_tree();
break; break;
case F_CDC1:
case F_CDC2:
case F_CDC3:
case F_CDC4:
case F_CDC5:
case F_CDC6:
case F_CDC7:
case F_CDC8:
case F_CDC9:
case F_CDC10:
case F_CDC11:
case F_CDC12:
case F_RISOATT: case F_RISOATT:
case F_CODRIS: case F_CODRIS:
case F_CODATT: case F_CODATT:
case F_TPORA: case F_TPORA:
if (e == fe_modify) if (e == fe_modify)
{
update_tree();
riempi_sheet(); riempi_sheet();
}
break; break;
case F_CALENDARIO: case F_CALENDARIO:
if (e == fe_modify) if (e == fe_modify)

View File

@ -13,6 +13,18 @@
#define F_CODFASE 312 #define F_CODFASE 312
#define F_CALENDARIO 313 #define F_CALENDARIO 313
#define F_ANAL 314 #define F_ANAL 314
#define F_CDC1 314
#define F_CDC2 315
#define F_CDC3 316
#define F_CDC4 317
#define F_CDC5 318
#define F_CDC6 319
#define F_CDC7 320
#define F_CDC8 321
#define F_CDC9 322
#define F_CDC10 323
#define F_CDC11 324
#define F_CDC12 325
#define F_SHEET 330 #define F_SHEET 330
#define F_INTERVALLO 331 #define F_INTERVALLO 331
#define F_OREDIS 332 #define F_OREDIS 332