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:
void highlight(const TString & query, int mese, int anno);
public:
void highlight(const TString & query, int mese, int anno);
bool update_content(const TString & query, const TString & dett, int month, int year);
virtual bool goto_root();
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])
_t[i - 1] = _full;
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();
_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;
}
@ -282,10 +282,12 @@ class TRilevamento_cons_msk : public TAutomask
int _anno;
int _mese;
int _giorno;
int _curr_anno;
int _curr_mese;
int _curr_giorno;
TString _numcn;
TString _tipocn;
TToken_string _last_key;
TAssoc_array _oredisp;
TAssoc_array _oreprev;
protected:
@ -607,7 +609,10 @@ void TRilevamento_cons_msk::riempi_sheet(char tipo)
TISAM_recordset def(query);
//riempio lo sheet con i dati che soddisfano il filtro preparato prima
_curr_giorno = _giorno;
_curr_mese = _mese;
_curr_anno = _anno;
//riempio lo sheet con i dati che soddisfano il filtro preparato prima
for(bool ok = def.move_first(); ok; ok = def.move_next())
{
TRilevamento_ore rilore(def.cursor()->curr());
@ -673,7 +678,6 @@ void TRilevamento_cons_msk::update_tree()
tree->update_content(content_query(), get(F_INTERVALLO), _mese, _anno);
cal.force_update();
cal.tree()->goto_root();
}
void TRilevamento_cons_msk::update_disp()
@ -715,46 +719,38 @@ void TRilevamento_cons_msk::update_disp()
TString chiave;
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;
if (codice.full())
{
real oredisp;
if (codice.full())
{
TString query;
query << "USE &DRA SELECT RIGHT(CODTAB,2)==\"" << tpora << "\"\n"
<< "FROM CODTAB=\"" << chiave << "\"\n" ;
TString tochiave(risoatt);
const TString4 intervallo = get(F_INTERVALLO);
TString query;
if (intervallo == "M")
query << "USE &DRA SELECT RIGHT(CODTAB,2)==\"" << tpora << "\"\n"
<< "FROM CODTAB=\"" << chiave << "\"\n" ;
TString tochiave(risoatt);
const TString4 intervallo = get(F_INTERVALLO);
if (intervallo == "M")
{
day.addmonth();
--day;
}
else
if (intervallo == "A")
{
day.addmonth();
day.addyear();
--day;
}
else
if (intervallo == "A")
{
day.addyear();
--day;
}
tochiave << codice << day.string(ANSI) << tpora;
query << "TO CODTAB=\"" << tochiave << "\"\n";
TISAM_recordset def(query);
tochiave << codice << day.string(ANSI) << tpora;
query << "TO CODTAB=\"" << tochiave << "\"\n";
TISAM_recordset def(query);
for(bool ok = def.move_first(); ok; ok = def.move_next())
oredisp += def.cursor()->curr().get_real("R1");
}
set(F_OREDIS, oredisp);
_oredisp.add(chiave, oredisp);
for(bool ok = def.move_first(); ok; ok = def.move_next())
oredisp += def.cursor()->curr().get_real("R1");
}
set(F_OREDIS, oredisp);
real orecons;
codice.trim();
@ -1024,9 +1020,9 @@ void TRilevamento_cons_msk::registra()
{
rilroa.put(RILORE_TIPO, "C");
rilroa.put(RILORE_ID, id);
rilroa.put(RILORE_ANNO, _anno);
rilroa.put(RILORE_MESE, _mese);
rilroa.put(RILORE_GIORNO, _giorno);
rilroa.put(RILORE_ANNO, _curr_anno);
rilroa.put(RILORE_MESE, _curr_mese);
rilroa.put(RILORE_GIORNO, _curr_giorno);
rilroa.put(RILORE_TIPORA, tipora);
rilroa.put(RILORE_CODICE, codice);
rilroa.put(RILORE_TPORA, tpora);
@ -1116,6 +1112,7 @@ void TRilevamento_cons_msk::registra()
{
ca.destroy();
sheet.destroy();
((TRil_tree * )tfield(F_CALENDARIO).tree())->highlight(content_query(), _mese, _anno);
riempi_sheet();
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)
{
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 (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)
update_tree();
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_CODRIS:
case F_CODATT:
case F_TPORA:
if (e == fe_modify)
{
update_tree();
riempi_sheet();
}
break;
case F_CALENDARIO:
if (e == fe_modify)

View File

@ -13,6 +13,18 @@
#define F_CODFASE 312
#define F_CALENDARIO 313
#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_INTERVALLO 331
#define F_OREDIS 332