Patch level : 10.0
Files correlati : tp0 Ricompilazione Demo : [ ] Commento : Corretta esecuzione transazioni via ODBC. Necessaria per trasferimento PACK. git-svn-id: svn://10.65.10.50/trunk@19324 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
bd190b4edd
commit
4436cb7970
@ -574,10 +574,11 @@ void TApplication::print()
|
|||||||
|
|
||||||
void TApplication::preview()
|
void TApplication::preview()
|
||||||
{
|
{
|
||||||
const TPrtype oldmode = printer().printtype();
|
TPrinter& p = printer();
|
||||||
printer().set_printtype(screenvis);
|
const TPrtype oldmode = p.printtype();
|
||||||
|
p.set_printtype(screenvis);
|
||||||
print();
|
print();
|
||||||
printer().set_printtype(oldmode);
|
p.set_printtype(oldmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TApplication::check_menu_item(MENU_TAG item, bool chk)
|
void TApplication::check_menu_item(MENU_TAG item, bool chk)
|
||||||
@ -608,14 +609,13 @@ void TApplication::enable_menu_item(
|
|||||||
bool TApplication::has_module(int module, int checktype) const
|
bool TApplication::has_module(int module, int checktype) const
|
||||||
{
|
{
|
||||||
#ifdef _DEMO_
|
#ifdef _DEMO_
|
||||||
bool ok = true;
|
const bool ok = true;
|
||||||
#else
|
#else
|
||||||
bool ok = dongle().active(module);
|
bool ok = dongle().active(module);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Testa bit di attivazione dell'utente
|
// Testa bit di attivazione dell'utente
|
||||||
if (ok && checktype != CHK_DONGLE)
|
if (ok && checktype != CHK_DONGLE)
|
||||||
ok = _user_aut[module];
|
ok = _user_aut[module];
|
||||||
|
#endif
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,10 @@ long TExternal_app::run(
|
|||||||
TFilename path(_path);
|
TFilename path(_path);
|
||||||
|
|
||||||
TFilename comm_name(_path);
|
TFilename comm_name(_path);
|
||||||
const int p = comm_name.find(" -"); //c'e' uno spazio nella stringa?
|
int p = comm_name.find(" -"); //c'e' un - nella stringa?
|
||||||
|
if (p > 0) //se c'e' tronca il nome allo spazio
|
||||||
|
comm_name.cut(p);
|
||||||
|
p = comm_name.find(" /"); //c'e' un / nella stringa?
|
||||||
if (p > 0) //se c'e' tronca il nome allo spazio
|
if (p > 0) //se c'e' tronca il nome allo spazio
|
||||||
comm_name.cut(p);
|
comm_name.cut(p);
|
||||||
|
|
||||||
@ -67,8 +70,9 @@ long TExternal_app::run(
|
|||||||
|
|
||||||
if (!utente) // cambio directory se eseguo un programma estero
|
if (!utente) // cambio directory se eseguo un programma estero
|
||||||
{
|
{
|
||||||
const TFilename dir(comm_name.path());
|
TFilename dir(comm_name.path());
|
||||||
if (dir.not_empty() && dir.find("custom") < 0)
|
dir.lower();
|
||||||
|
if (dir.full() && dir.find("custom") < 0)
|
||||||
{
|
{
|
||||||
DIRECTORY d;
|
DIRECTORY d;
|
||||||
if (xvt_fsys_convert_str_to_dir(dir, &d))
|
if (xvt_fsys_convert_str_to_dir(dir, &d))
|
||||||
|
@ -315,13 +315,20 @@ bool TODBC_recordset::move_to(TRecnotype n)
|
|||||||
long TODBC_recordset::exec(const char* sql)
|
long TODBC_recordset::exec(const char* sql)
|
||||||
{
|
{
|
||||||
long err = -1;
|
long err = -1;
|
||||||
|
|
||||||
|
TString cmd;
|
||||||
|
|
||||||
|
// Se la stringa "sql" non contiene parametri di connessione ma essi sono in "_sql"
|
||||||
|
// allora cerco di effetture la connessione in base a quella
|
||||||
|
if (_dsn.empty() && strncmp(sql, "ODBC(", 5) != 0 && _sql.starts_with("ODBC("))
|
||||||
|
parsed_text(cmd);
|
||||||
|
|
||||||
XVT_ODBC oc = connection();
|
XVT_ODBC oc = connection();
|
||||||
if (oc != NULL)
|
if (oc != NULL)
|
||||||
{
|
{
|
||||||
|
set(sql);
|
||||||
|
parsed_text(cmd);
|
||||||
TPerformance_profiler prof("ODBC command");
|
TPerformance_profiler prof("ODBC command");
|
||||||
set(sql);
|
|
||||||
TString cmd; parsed_text(cmd);
|
|
||||||
err = xvt_odbc_execute(oc, cmd, NULL, NULL);
|
err = xvt_odbc_execute(oc, cmd, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,9 @@ public:
|
|||||||
long exec(const char* sql);
|
long exec(const char* sql);
|
||||||
|
|
||||||
bool connect(const char* dsn, const char* usr = "", const char* pwd = "", const char* dir = "");
|
bool connect(const char* dsn, const char* usr = "", const char* pwd = "", const char* dir = "");
|
||||||
|
|
||||||
|
const TString& dsn() const { return _dsn; }
|
||||||
|
|
||||||
TODBC_recordset(const char* sql);
|
TODBC_recordset(const char* sql);
|
||||||
virtual ~TODBC_recordset();
|
virtual ~TODBC_recordset();
|
||||||
};
|
};
|
||||||
|
@ -326,6 +326,11 @@ void TRelation_application::update_navigation_bar()
|
|||||||
bool TRelation_application::save_and_new() const
|
bool TRelation_application::save_and_new() const
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
|
bool TRelation_application::save_and_quit() const
|
||||||
|
{
|
||||||
|
return (_autoins_caller.full() || _curr_transaction.not_empty()) && _curr_trans_mode != TM_REMAIN;
|
||||||
|
}
|
||||||
|
|
||||||
int TRelation_application::set_mode(int mode)
|
int TRelation_application::set_mode(int mode)
|
||||||
{
|
{
|
||||||
static int _mode = NO_MODE;
|
static int _mode = NO_MODE;
|
||||||
@ -499,7 +504,7 @@ void TRelation_application::insert_mode()
|
|||||||
init_insert_mode(*_mask);
|
init_insert_mode(*_mask);
|
||||||
|
|
||||||
// ....possibilmente spostare questa chiamata .....
|
// ....possibilmente spostare questa chiamata .....
|
||||||
if (_curr_transaction == TRANSACTION_INSERT)
|
if (is_transaction() && _curr_transaction == TRANSACTION_INSERT)
|
||||||
ini2insert_mask();
|
ini2insert_mask();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1346,9 +1351,11 @@ void TRelation_application::main_loop()
|
|||||||
{
|
{
|
||||||
case K_ESC:
|
case K_ESC:
|
||||||
if (save(TRUE))
|
if (save(TRUE))
|
||||||
|
{
|
||||||
query_mode();
|
query_mode();
|
||||||
if ((_autoins_caller.full() || is_transaction()) && _curr_trans_mode != TM_REMAIN)
|
if (save_and_quit())
|
||||||
k = K_QUIT;
|
k = K_QUIT;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case K_QUIT:
|
case K_QUIT:
|
||||||
if (!save(TRUE))
|
if (!save(TRUE))
|
||||||
@ -1389,7 +1396,7 @@ void TRelation_application::main_loop()
|
|||||||
case K_SAVE:
|
case K_SAVE:
|
||||||
if (save(FALSE))
|
if (save(FALSE))
|
||||||
{
|
{
|
||||||
if ((_autoins_caller.full() || is_transaction()) && _curr_trans_mode != TM_REMAIN)
|
if (save_and_quit())
|
||||||
{
|
{
|
||||||
k = K_QUIT;
|
k = K_QUIT;
|
||||||
}
|
}
|
||||||
|
@ -221,8 +221,10 @@ protected:
|
|||||||
void write_disable()
|
void write_disable()
|
||||||
{ write_enable(FALSE); }
|
{ write_enable(FALSE); }
|
||||||
|
|
||||||
// @cmember Salva il record corrente e si predispone per un nuovo inserimento
|
// @cmember Dopo aver salvato si predispone per un nuovo inserimento
|
||||||
virtual bool save_and_new() const;
|
virtual bool save_and_new() const;
|
||||||
|
// @cmember Deve uscire dal programma dopo aver salvato con successo?
|
||||||
|
virtual bool save_and_quit() const;
|
||||||
|
|
||||||
// @cmember Impone il campo da utilizzare col bottone Ricerca
|
// @cmember Impone il campo da utilizzare col bottone Ricerca
|
||||||
void set_search_field(short id)
|
void set_search_field(short id)
|
||||||
@ -259,14 +261,12 @@ public:
|
|||||||
// @cmember Costruisce il membro <md TRelation_application::_fixed>
|
// @cmember Costruisce il membro <md TRelation_application::_fixed>
|
||||||
void set_link(TMask & m, const char * keyexpr);
|
void set_link(TMask & m, const char * keyexpr);
|
||||||
// @cmember Ritorna TRUE se e' stato chiamato col messaggio di link
|
// @cmember Ritorna TRUE se e' stato chiamato col messaggio di link
|
||||||
bool lnflag() const
|
bool lnflag() const { return _lnflag != 0;}
|
||||||
{ return _lnflag != 0;} // qui
|
// @cmember Ritorna TRUE se e' una transazione
|
||||||
|
virtual bool is_transaction() const { return _curr_transaction.not_empty(); }
|
||||||
|
|
||||||
virtual word class_id() const { return CLASS_RELATION_APPLICATION; }
|
virtual word class_id() const { return CLASS_RELATION_APPLICATION; }
|
||||||
|
|
||||||
// @cmember Ritorna TRUE se e' una transazione
|
|
||||||
bool is_transaction() const { return _curr_transaction.not_empty(); }
|
|
||||||
|
|
||||||
// @cmember Costruttore
|
// @cmember Costruttore
|
||||||
TRelation_application();
|
TRelation_application();
|
||||||
// @cmember Distruttore
|
// @cmember Distruttore
|
||||||
|
Loading…
x
Reference in New Issue
Block a user