Patch level : 10.0 no patch

Files correlati     : ci0.exe CI2.EXE
Ricompilazione Demo : [ ]
Commento            :


Modulo rilevazione ore step 2


git-svn-id: svn://10.65.10.50/branches/R_10_00@21142 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2010-11-16 16:17:20 +00:00
parent ac1c8f5ad0
commit c3663ec316
3 changed files with 37 additions and 43 deletions

View File

@ -688,14 +688,15 @@ TDef_risoatt_msk::TDef_risoatt_msk()
disable(F_MESE);
}
else
{
if (_dett == "M")
{
field(F_ANNO).update_flags("A", true);
reset(F_MESE);
disable(F_MESE);
}
else
field(F_ANNO).update_flags("A", true);
set(F_ANNO, TDate(TODAY).year());
}
}
////////////////////////////////////////

View File

@ -29,7 +29,6 @@ class TRilevamento_cons_msk : public TAutomask
short _scdc_sid, _scdc_lid;
short _scms_sid, _scms_lid;
short _sfase_sid, _sfase_lid;
char _edit_mode;
TDate _datasel;
TString _dett;
int _anno;
@ -49,7 +48,7 @@ protected:
void update_day();
void riempi_sheet();
void riempi_calendario(const TString & query);
void riempi_risoatt();
void riempi_risoatt(char tipo = 'C');
void azzera_tutto();
void registra();
@ -208,6 +207,7 @@ void TRilevamento_cons_msk::carica_default()
TString query;
TString select;
update_day();
switch(get(F_RISOATT)[0])
{
case 'R': codice = get(F_CODRIS); break;
@ -255,14 +255,17 @@ void TRilevamento_cons_msk::carica_default()
if (_mese > 0)
fromto << RILORE_MESE << "=" << _mese << " ";
}
riempi_calendario(query);
riempi_calendario(query);
riempi_risoatt('D');
}
//RIEMPI_CALENDARIO: coloro le celle dello sheet calendario secondo le festività e i giorni occupati
void TRilevamento_cons_msk::riempi_calendario(const TString & query)
{
TSheet_field& calendario = sfield(F_CALENDARIO);
TSheet_field& calendario = sfield(F_CALENDARIO);
update_day();
if (_dett == "A")
{
TBit_array full_years;
@ -280,8 +283,7 @@ void TRilevamento_cons_msk::riempi_calendario(const TString & query)
if (full_years[_es_array[i]])
{
if (_edit_mode)
calendario.set_back_and_fore_color(COLOR_DKBLUE, COLOR_DKBLUE, i, 0); // coloro di blu le date con registrazioni
calendario.set_back_and_fore_color(COLOR_DKBLUE, COLOR_DKBLUE, i, 0); // coloro di blu le date con registrazioni
}
row.add(_es_array[i]);
}
@ -299,16 +301,15 @@ void TRilevamento_cons_msk::riempi_calendario(const TString & query)
full_months.set(mese);
}
for (int i = 0; i < 12; i++)
for (int i = 1; i <= 12; i++)
{
TToken_string & row = calendario.row(i);
TToken_string & row = calendario.row(i - 1);
if (full_months[i])
{
if (_edit_mode)
calendario.set_back_and_fore_color(COLOR_DKBLUE, COLOR_DKBLUE, i, 0); // coloro di blu le date con registrazioni
calendario.set_back_and_fore_color(COLOR_DKBLUE, COLOR_DKBLUE, i - 1, 0); // coloro di blu le date con registrazioni
}
row.add(itom(i + 1));
row.add(itom(i));
}
}
else
@ -328,25 +329,31 @@ void TRilevamento_cons_msk::riempi_calendario(const TString & query)
fulldays.set(day);
}
for(int i = 0; i < end_month; i++)
for(int i = 1; i <= end_month; i++)
{
TToken_string & row = calendario.row(i);
TToken_string & row = calendario.row(i - 1);
COLOR back = NORMAL_BACK_COLOR;
COLOR fore = NORMAL_COLOR;
if (fulldays[i])
{
if (_edit_mode)
calendario.set_back_and_fore_color(COLOR_DKBLUE, COLOR_DKBLUE, i, 0); // coloro di blu le date con registrazioni
back = COLOR_DKBLUE; // coloro di blu le date con registrazioni
fore = COLOR_WHITE; // coloro di blu le date con registrazioni
}
else
if (TDate(i, _mese, _anno).is_holiday())
calendario.set_back_and_fore_color(COLOR_DKRED, COLOR_DKRED, i, 0); // coloro di rosso le festivitŕ
row.add(i + 1);
{
back = COLOR_DKRED; // coloro di rosso le festivitŕ
fore = COLOR_WHITE; // coloro di rosso le festivitŕ
}
calendario.set_back_and_fore_color(back, fore, i - 1, 0);
row.add(i);
}
}
calendario.force_update();
}
void TRilevamento_cons_msk::riempi_risoatt()
void TRilevamento_cons_msk::riempi_risoatt(char tipo)
{
TSheet_field& sheet = sfield(F_SHEET);
@ -354,7 +361,8 @@ void TRilevamento_cons_msk::riempi_risoatt()
registra();
sheet.destroy();
//leggo dalla maschera i campi chiave di ricerca
update_day();
//leggo dalla maschera i campi chiave di ricerca
const TString4 risoatt = get(F_RISOATT) == "T" ? "" : get(F_RISOATT);
const TString4 tpora = get(F_TPORA);
TString80 codcosto;
@ -406,17 +414,14 @@ void TRilevamento_cons_msk::riempi_risoatt()
TString fromto = RILORE_TIPO;
if (_edit_mode)
fromto << "=\"C\"";
else
fromto << "=\"D\"";
fromto << "=\"" << tipo << "\"";
if (_anno > 0)
{
fromto << " " << RILORE_ANNO << "=" << _anno << " ";
if (_mese > 0)
{
fromto << RILORE_MESE << "=" << _mese << " ";
if (_edit_mode && _giorno > 0)
if (tipo == 'C')
fromto << RILORE_GIORNO << "=" << _giorno << " ";
}
}
@ -466,6 +471,7 @@ void TRilevamento_cons_msk::riempi_sheet()
TString query;
TString select;
update_day();
switch(get(F_RISOATT)[0])
{
case 'R': codice = get(F_CODRIS); break;
@ -626,24 +632,15 @@ bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, l
{
case DLG_DEFAULT:
if(e == fe_button)
{
_edit_mode = false;
carica_default();
}
break;
case DLG_CERCA:
if(e == fe_button)
{
_edit_mode = true;
riempi_sheet();
}
break;
case DLG_SAVEREC:
if(e == fe_button)
{
_edit_mode = true;
registra();
}
case F_ANNO:
case F_MESE:
case F_RISOATT:
@ -651,17 +648,11 @@ bool TRilevamento_cons_msk::on_field_event(TOperable_field& f, TField_event e, l
case F_CODATT:
case F_TPORA:
if (e == fe_modify)
{
update_day();
riempi_sheet();
}
break;
case F_CALENDARIO:
if (e == se_enter)
{
update_day();
riempi_risoatt();
}
break;
case S_RISOATT:
case S_CODRIS:
@ -822,11 +813,14 @@ TRilevamento_cons_msk::TRilevamento_cons_msk()
disable(F_MESE);
}
else
{
if (_dett == "M")
{
reset(F_MESE);
disable(F_MESE);
}
set(F_ANNO, TDate(TODAY).year());
}
}
////////////////////////////////////////////

View File

@ -46,7 +46,6 @@ END
LISTBOX F_MESE 10
BEGIN
PROMPT 24 1 "Mese "
ITEM "|"
FLAGS "M"
END