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:
parent
3189ae24b0
commit
bfe130f077
@ -3,6 +3,7 @@
|
||||
|
||||
#include <applicat.h>
|
||||
#include <automask.h>
|
||||
#include <defmask.h>
|
||||
#include <progind.h>
|
||||
#include <reprint.h>
|
||||
#include <reputils.h>
|
||||
@ -191,9 +192,12 @@ long TPack_transfer::odbc_exec(const char* cmd)
|
||||
if (_outset == NULL)
|
||||
{
|
||||
_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;
|
||||
}
|
||||
|
@ -2,14 +2,7 @@
|
||||
|
||||
TOOLBAR "topbar" 0 0 0 2
|
||||
|
||||
BUTTON DLG_ELABORA 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 "~Elabora"
|
||||
PICTURE BMP_ELABORA
|
||||
MESSAGE EXIT,K_ENTER
|
||||
END
|
||||
|
||||
#include <helpbar.h>
|
||||
#include <elabar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
|
@ -65,24 +65,24 @@ const TString& TCache_ban::decode(const TToken_string& tok)
|
||||
bool TPack_conti::trasferisci()
|
||||
{
|
||||
log(TR("Azzeramento piano dei conti PACK"));
|
||||
odbc_exec("DELETE FROM AccountPlan");
|
||||
|
||||
TRecordset& pcon = create_recordset("USE PCON");
|
||||
TPack_iterator pi(this);
|
||||
while (++pi)
|
||||
if (odbc_exec("DELETE FROM AccountPlan") >= 0)
|
||||
{
|
||||
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;
|
||||
TRecordset& pcon = create_recordset("USE PCON");
|
||||
TPack_iterator pi(this);
|
||||
while (++pi)
|
||||
{
|
||||
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;
|
||||
values.add(gruconto);
|
||||
values.add(sottoc);
|
||||
values.add(pcon.get("DESCR").as_string());
|
||||
odbc_exec(build_insert_query("AccountPlan", "AccountCode,AccountSubCode,DescAccount", values));
|
||||
}
|
||||
|
||||
TToken_string values;
|
||||
values.add(gruconto);
|
||||
values.add(sottoc);
|
||||
values.add(pcon.get("DESCR").as_string());
|
||||
odbc_exec(build_insert_query("AccountPlan", "AccountCode,AccountSubCode,DescAccount", values));
|
||||
}
|
||||
}
|
||||
return write_enabled();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user