Corretta autosave
git-svn-id: svn://10.65.10.50/trunk@915 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
9c46904f42
commit
d907c91539
@ -239,57 +239,55 @@ void TDitte_application::set_att_prev(const TMask& m)
|
||||
|
||||
int TDitte_application::write(const TMask& m)
|
||||
{
|
||||
m.autosave();
|
||||
if (_rel->write() != NOERR)
|
||||
return _rel->status();
|
||||
|
||||
TRectype& ditte=_rel->curr();
|
||||
|
||||
TString codditta(ditte.get(CODDITTA)) ;
|
||||
|
||||
set_att_prev(m);
|
||||
|
||||
_anag->zero() ;
|
||||
_anag->put(TIPOA, ditte.get(TIPOA));
|
||||
_anag->put(CODANAGR, ditte.get(CODANAGR));
|
||||
_anag->read();
|
||||
if (_anag->good())
|
||||
const int err = TRelation_application::write();
|
||||
if (err == NOERR)
|
||||
{
|
||||
_unloc->zero() ;
|
||||
_unloc->put(CODDITTA, (const char*) codditta) ;
|
||||
_unloc->put(CODULC, (int) 1) ;
|
||||
TString s(_anag->get(COMRF));
|
||||
if (s.empty())
|
||||
TRectype& ditte=_rel->curr();
|
||||
|
||||
TString codditta(ditte.get(CODDITTA)) ;
|
||||
|
||||
set_att_prev(m);
|
||||
|
||||
_anag->zero() ;
|
||||
_anag->put(TIPOA, ditte.get(TIPOA));
|
||||
_anag->put(CODANAGR, ditte.get(CODANAGR));
|
||||
_anag->read();
|
||||
if (_anag->good())
|
||||
{
|
||||
_unloc->put(COMULC, _anag->get(COMRES));
|
||||
_unloc->put(INDULC, _anag->get(INDRES));
|
||||
_unloc->put(CIVULC, _anag->get(CIVRES));
|
||||
_unloc->put(CAPULC, _anag->get(CAPRES));
|
||||
_unloc->put(COMCCIAA, _anag->get(COMRES));
|
||||
_unloc->put(COMTRIB, _anag->get(COMRES));
|
||||
_unloc->zero() ;
|
||||
_unloc->put(CODDITTA, (const char*) codditta) ;
|
||||
_unloc->put(CODULC, (int) 1) ;
|
||||
TString s(_anag->get(COMRF));
|
||||
if (s.empty())
|
||||
{
|
||||
_unloc->put(COMULC, _anag->get(COMRES));
|
||||
_unloc->put(INDULC, _anag->get(INDRES));
|
||||
_unloc->put(CIVULC, _anag->get(CIVRES));
|
||||
_unloc->put(CAPULC, _anag->get(CAPRES));
|
||||
_unloc->put(COMCCIAA, _anag->get(COMRES));
|
||||
_unloc->put(COMTRIB, _anag->get(COMRES));
|
||||
}
|
||||
else
|
||||
{
|
||||
_unloc->put(COMULC, (const char*) s);
|
||||
_unloc->put(INDULC, _anag->get(INDRF));
|
||||
_unloc->put(CIVULC, _anag->get(CIVRF));
|
||||
_unloc->put(CAPULC, _anag->get(CAPRF));
|
||||
_unloc->put(COMCCIAA, (const char*) s);
|
||||
_unloc->put(COMTRIB, (const char*) s);
|
||||
}
|
||||
_unloc->write();
|
||||
}
|
||||
else
|
||||
{
|
||||
_unloc->put(COMULC, (const char*) s);
|
||||
_unloc->put(INDULC, _anag->get(INDRF));
|
||||
_unloc->put(CIVULC, _anag->get(CIVRF));
|
||||
_unloc->put(CAPULC, _anag->get(CAPRF));
|
||||
_unloc->put(COMCCIAA, (const char*) s);
|
||||
_unloc->put(COMTRIB, (const char*) s);
|
||||
}
|
||||
_unloc->write();
|
||||
}
|
||||
return NOERR;
|
||||
return err;
|
||||
}
|
||||
|
||||
int TDitte_application::rewrite(const TMask& m)
|
||||
{
|
||||
_rel->zero();
|
||||
m.autosave();
|
||||
if (_rel->rewrite() != NOERR)
|
||||
return _rel->status();
|
||||
set_att_prev(m);
|
||||
return NOERR;
|
||||
const int err = TRelation_application::rewrite();
|
||||
if (err == NOERR)
|
||||
set_att_prev(m);
|
||||
return err;
|
||||
}
|
||||
|
||||
void TDitte_application::init_query_mode(TMask& m)
|
||||
|
Loading…
x
Reference in New Issue
Block a user