Patch level : 10.0
Files correlati : Ricompilazione Demo : [ ] Commento : Cambia i dati di autista e/o mezzo a tutte le righe di un planning SOLO se richiesto dall'utente git-svn-id: svn://10.65.10.50/trunk@17240 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
609c7b83d9
commit
aa4ae86039
@ -26,6 +26,7 @@ private:
|
|||||||
bool changed(TToken_string& oldrow, TToken_string& newrow, short id);
|
bool changed(TToken_string& oldrow, TToken_string& newrow, short id);
|
||||||
int codice_riga(const TDate& data);
|
int codice_riga(const TDate& data);
|
||||||
void aggiorna_plan();
|
void aggiorna_plan();
|
||||||
|
void rewrite_all(TToken_string& rigamodificata, TDate& data, long codplan);
|
||||||
bool cancella_riga();
|
bool cancella_riga();
|
||||||
void nuova_riga();
|
void nuova_riga();
|
||||||
|
|
||||||
@ -126,7 +127,7 @@ void TGestione_planning_mask::aggiorna_plan()
|
|||||||
{
|
{
|
||||||
//bool che indicano se effettivamente devo fare una rewrite dei dati...
|
//bool che indicano se effettivamente devo fare una rewrite dei dati...
|
||||||
//...se ho modificato un autista e/o un mezzo, questo va modificato su tutte...
|
//...se ho modificato un autista e/o un mezzo, questo va modificato su tutte...
|
||||||
//...le righe di quel planning
|
//...le righe di quel planning se confermato dall'utente
|
||||||
bool dorewrite = false;
|
bool dorewrite = false;
|
||||||
bool updatecar = false;
|
bool updatecar = false;
|
||||||
|
|
||||||
@ -213,10 +214,28 @@ void TGestione_planning_mask::aggiorna_plan()
|
|||||||
rplan.curr().zero(LVRCONSPLAN_CONSSTD);
|
rplan.curr().zero(LVRCONSPLAN_CONSSTD);
|
||||||
lv_set_update_info(rplan.curr());
|
lv_set_update_info(rplan.curr());
|
||||||
rplan.rewrite();
|
rplan.rewrite();
|
||||||
}
|
|
||||||
|
|
||||||
|
if (updatecar)
|
||||||
|
rewrite_all(rigamodificata, data, codplan);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TGestione_planning_mask::rewrite_all(TToken_string& rigamodificata, TDate& data, long codplan)
|
||||||
|
{
|
||||||
|
//instanzio una variabile di sheet
|
||||||
|
TSheet_field& sheet = sfield(F_PLAN);
|
||||||
|
|
||||||
|
//instanzio un isam file sulla tabella dei planning
|
||||||
|
TLocalisamfile rplan(LF_LVRCONSPLAN);
|
||||||
|
|
||||||
//se ho modificato autista e/o mezzo, allora:
|
//se ho modificato autista e/o mezzo, allora:
|
||||||
if (updatecar)
|
TString msg;
|
||||||
|
msg << "Si desidera apportare le stesse modifiche\n"
|
||||||
|
<< " sull'autista e/o sul mezzo su tutte le righe\n"
|
||||||
|
<< " del planning in data " << data << "?";
|
||||||
|
|
||||||
|
if (yesno_box(msg))
|
||||||
{
|
{
|
||||||
//recupero dai dati modificati i nuovi valori di autista e mezzo
|
//recupero dai dati modificati i nuovi valori di autista e mezzo
|
||||||
const int codaut = rigamodificata.get_int(sheet.cid2index(F_S_CODAUT));
|
const int codaut = rigamodificata.get_int(sheet.cid2index(F_S_CODAUT));
|
||||||
@ -233,7 +252,7 @@ void TGestione_planning_mask::aggiorna_plan()
|
|||||||
|
|
||||||
for (bool ok = recrplan.move_first(); ok; ok = recrplan.move_next())
|
for (bool ok = recrplan.move_first(); ok; ok = recrplan.move_next())
|
||||||
{
|
{
|
||||||
//cambio autisyta e mezzo
|
//cambio autista e mezzo
|
||||||
rec.put(LVRCONSPLAN_CODAUT,codaut);
|
rec.put(LVRCONSPLAN_CODAUT,codaut);
|
||||||
rec.put(LVRCONSPLAN_CODMEZ,codmez);
|
rec.put(LVRCONSPLAN_CODMEZ,codmez);
|
||||||
rec.zero(LVRCONSPLAN_CONSSTD);
|
rec.zero(LVRCONSPLAN_CONSSTD);
|
||||||
@ -242,6 +261,8 @@ void TGestione_planning_mask::aggiorna_plan()
|
|||||||
rec.rewrite(rplan);
|
rec.rewrite(rplan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fill_sheet();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//questa funzione elimina una riga dal planning
|
//questa funzione elimina una riga dal planning
|
||||||
@ -356,8 +377,7 @@ bool TGestione_planning_mask::on_field_event(TOperable_field& o, TField_event e,
|
|||||||
|
|
||||||
const TRectype& iti = cache().get("&ITI",o.get());
|
const TRectype& iti = cache().get("&ITI",o.get());
|
||||||
if (!iti.empty())
|
if (!iti.empty())
|
||||||
{
|
{
|
||||||
|
|
||||||
const bool riganuova = msk.get_int(F_S_RIGA) <= 0;
|
const bool riganuova = msk.get_int(F_S_RIGA) <= 0;
|
||||||
if (riganuova || msk.field(F_S_CODAUT).empty())
|
if (riganuova || msk.field(F_S_CODAUT).empty())
|
||||||
msk.set(F_S_CODAUT,iti.get("S1"));
|
msk.set(F_S_CODAUT,iti.get("S1"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user