Patch level : 10.0
Files correlati : ps0713 Ricompilazione Demo : [ ] Commento : Migliorato l'inserimento delle commesse: utilizzando i Systemisamfile è diventato molto più veloce git-svn-id: svn://10.65.10.50/trunk@20500 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
065f2502a3
commit
52c74c4e00
@ -105,9 +105,9 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
||||
TProgind pi(righe.items(), "Importazione commesse in corso...", true, true);
|
||||
TLog_report log("Importazione Commesse");
|
||||
|
||||
TLocalisamfile com(LF_COMMESSE);
|
||||
TLocalisamfile rip(LF_RIP);
|
||||
TLocalisamfile rrip(LF_RRIP);
|
||||
TSystemisamfile com(LF_COMMESSE); com.open(_excllock);
|
||||
TSystemisamfile rip(LF_RIP); rip.open(_excllock);
|
||||
TSystemisamfile rrip(LF_RRIP); rrip.open(_excllock);
|
||||
rip.last();
|
||||
const TRectype& r = rip.curr();
|
||||
long codice = r.get_long("CODICE");
|
||||
@ -123,13 +123,13 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
||||
TString str;
|
||||
str << "La commessa " << codcms;
|
||||
|
||||
TString query;
|
||||
query << "USE RIP KEY 4\n"
|
||||
<< "FROM TIPO=\"B\" CODCOSTO=\"\" CODCMS=\"" << codcms << "\"\n"
|
||||
<< "TO TIPO=\"B\" CODCOSTO=\"\" CODCMS=\"" << codcms << "\"\n";
|
||||
const TISAM_recordset riprec(query);
|
||||
rip.zero();
|
||||
rip.put("TIPO", 'B');
|
||||
rip.put("CODCOSTO", "");
|
||||
rip.put("CODCMS", codcms);
|
||||
int err_read = rip.read();
|
||||
|
||||
if(riprec.empty())
|
||||
if(err_read != NOERR)
|
||||
{
|
||||
const int gruppo = cms.gruppo(); TString4 grup; grup.format("%03d", gruppo);
|
||||
const int conto = cms.conto(); TString4 cont; cont.format("%03d", conto);
|
||||
@ -150,7 +150,8 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
||||
rip.put("TIPO", 'B');
|
||||
rip.put("CODICE", cod);
|
||||
rip.put("CODCMS", codcms);
|
||||
//rip.put("INDBIL", bill.indicatore_bilancio());
|
||||
if(gruppo > 0 && conto > 0 && sotco > 0)
|
||||
rip.put("INDBIL", bill.indicatore_bilancio());
|
||||
rip.put("DESCRIZ", descr);
|
||||
|
||||
rrip.put("TIPO", 'B');
|
||||
@ -169,7 +170,7 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
||||
|
||||
if(err == NOERR)
|
||||
{
|
||||
str << codcms << " è stata inserita";
|
||||
str << " è stata inserita";
|
||||
log.log(0, str);
|
||||
}
|
||||
else
|
||||
@ -180,10 +181,14 @@ void TImporta_comm_app::importa_cms(TAssoc_array& righe)
|
||||
}
|
||||
else
|
||||
{
|
||||
str << codcms << " NON è stata inserita perchè esiste già";
|
||||
str << " NON è stata inserita perchè esiste già";
|
||||
log.log(2, str);
|
||||
}
|
||||
}
|
||||
|
||||
rrip.close();
|
||||
rip.close();
|
||||
com.close();
|
||||
//stampo a video il log
|
||||
TReport_book buc;
|
||||
buc.add(log);
|
||||
|
Loading…
x
Reference in New Issue
Block a user