Patch level : 314

Files correlati     : tp0.exe tp0100a.msk
Ricompilazione Demo : [ ]
Commento            :
0001304: salvataggio dati video trasferimento pack
I dati impostati non vengono salvati con il bottone elabora, quind bisogna sempre impostare sia quali sono i dati da trasferire che il nome dell'odbc ed i parametri di trasferimento.


git-svn-id: svn://10.65.10.50/trunk@18927 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2009-05-25 14:09:52 +00:00
parent 3189ae24b0
commit bfe130f077
3 changed files with 23 additions and 26 deletions

View File

@ -3,6 +3,7 @@
#include <applicat.h> #include <applicat.h>
#include <automask.h> #include <automask.h>
#include <defmask.h>
#include <progind.h> #include <progind.h>
#include <reprint.h> #include <reprint.h>
#include <reputils.h> #include <reputils.h>
@ -191,9 +192,12 @@ long TPack_transfer::odbc_exec(const char* cmd)
if (_outset == NULL) if (_outset == NULL)
{ {
_outset = new TODBC_recordset(query_header()); _outset = new TODBC_recordset(query_header());
_outset->exec("BEGIN TRANS"); err = _outset->exec("BEGIN TRANS");
} }
err = _outset->exec(cmd); if (err >= 0)
err = _outset->exec(cmd);
if (err < 0)
log_error(TR("Errore di connessione al database"));
} }
return err; return err;
} }

View File

@ -2,14 +2,7 @@
TOOLBAR "topbar" 0 0 0 2 TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_ELABORA 10 2 #include <elabar.h>
BEGIN
PROMPT -12 -11 "~Elabora"
PICTURE BMP_ELABORA
MESSAGE EXIT,K_ENTER
END
#include <helpbar.h>
ENDPAGE ENDPAGE

View File

@ -65,24 +65,24 @@ const TString& TCache_ban::decode(const TToken_string& tok)
bool TPack_conti::trasferisci() bool TPack_conti::trasferisci()
{ {
log(TR("Azzeramento piano dei conti PACK")); log(TR("Azzeramento piano dei conti PACK"));
odbc_exec("DELETE FROM AccountPlan"); if (odbc_exec("DELETE FROM AccountPlan") >= 0)
TRecordset& pcon = create_recordset("USE PCON");
TPack_iterator pi(this);
while (++pi)
{ {
const int gruppo = pcon.get("GRUPPO").as_int(); TRecordset& pcon = create_recordset("USE PCON");
const int conto = pcon.get("CONTO").as_int(); TPack_iterator pi(this);
const long sottoc = pcon.get("SOTTOCONTO").as_int(); while (++pi)
const long gruconto = gruppo*1000+conto; {
const int gruppo = pcon.get("GRUPPO").as_int();
const int conto = pcon.get("CONTO").as_int();
const long sottoc = pcon.get("SOTTOCONTO").as_int();
const long gruconto = gruppo*1000+conto;
TToken_string values; TToken_string values;
values.add(gruconto); values.add(gruconto);
values.add(sottoc); values.add(sottoc);
values.add(pcon.get("DESCR").as_string()); values.add(pcon.get("DESCR").as_string());
odbc_exec(build_insert_query("AccountPlan", "AccountCode,AccountSubCode,DescAccount", values)); odbc_exec(build_insert_query("AccountPlan", "AccountCode,AccountSubCode,DescAccount", values));
} }
}
return write_enabled(); return write_enabled();
} }