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)
|
int TDitte_application::write(const TMask& m)
|
||||||
{
|
{
|
||||||
m.autosave();
|
const int err = TRelation_application::write();
|
||||||
if (_rel->write() != NOERR)
|
if (err == 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())
|
|
||||||
{
|
{
|
||||||
_unloc->zero() ;
|
TRectype& ditte=_rel->curr();
|
||||||
_unloc->put(CODDITTA, (const char*) codditta) ;
|
|
||||||
_unloc->put(CODULC, (int) 1) ;
|
TString codditta(ditte.get(CODDITTA)) ;
|
||||||
TString s(_anag->get(COMRF));
|
|
||||||
if (s.empty())
|
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->zero() ;
|
||||||
_unloc->put(INDULC, _anag->get(INDRES));
|
_unloc->put(CODDITTA, (const char*) codditta) ;
|
||||||
_unloc->put(CIVULC, _anag->get(CIVRES));
|
_unloc->put(CODULC, (int) 1) ;
|
||||||
_unloc->put(CAPULC, _anag->get(CAPRES));
|
TString s(_anag->get(COMRF));
|
||||||
_unloc->put(COMCCIAA, _anag->get(COMRES));
|
if (s.empty())
|
||||||
_unloc->put(COMTRIB, _anag->get(COMRES));
|
{
|
||||||
|
_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)
|
int TDitte_application::rewrite(const TMask& m)
|
||||||
{
|
{
|
||||||
_rel->zero();
|
const int err = TRelation_application::rewrite();
|
||||||
m.autosave();
|
if (err == NOERR)
|
||||||
if (_rel->rewrite() != NOERR)
|
set_att_prev(m);
|
||||||
return _rel->status();
|
return err;
|
||||||
set_att_prev(m);
|
|
||||||
return NOERR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TDitte_application::init_query_mode(TMask& m)
|
void TDitte_application::init_query_mode(TMask& m)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user