Patch level : 4.0 620
Files : ve7.exe Ricompilazione Demo : [ ] Commento : Trasferimento Galileo git-svn-id: svn://10.65.10.50/trunk@14908 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
221c0b2a65
commit
85275d0ef7
@ -209,7 +209,7 @@ TObject* TCache_tab::key2obj(const char* key)
|
|||||||
table.zero();
|
table.zero();
|
||||||
table.put("CODTAB", cod);
|
table.put("CODTAB", cod);
|
||||||
table.put("S0", cod);
|
table.put("S0", cod);
|
||||||
test_write(table);
|
test_write((TIsamfile &)table);
|
||||||
}
|
}
|
||||||
return table.curr().dup();
|
return table.curr().dup();
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ bool TGalileo_transfer::log_cancelled()
|
|||||||
return log_error(TR("Procedura interrotta dall'utente"));
|
return log_error(TR("Procedura interrotta dall'utente"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TGalileo_transfer::test_write(TLocalisamfile& file, bool re)
|
bool TGalileo_transfer::test_write(TIsamfile& file, bool re)
|
||||||
{
|
{
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
if (_write_enabled)
|
if (_write_enabled)
|
||||||
|
10
ve/ve7700.h
10
ve/ve7700.h
@ -65,8 +65,8 @@ public:
|
|||||||
|
|
||||||
bool write_enabled() const { return _write_enabled; }
|
bool write_enabled() const { return _write_enabled; }
|
||||||
|
|
||||||
bool test_write(TLocalisamfile& file, bool re = false);
|
bool test_write(TIsamfile& file, bool re = false);
|
||||||
bool test_rewrite(TLocalisamfile& file) { return test_write(file, true); }
|
bool test_rewrite(TIsamfile& file) { return test_write(file, true); }
|
||||||
|
|
||||||
virtual ~TGalileo_transfer();
|
virtual ~TGalileo_transfer();
|
||||||
};
|
};
|
||||||
@ -99,7 +99,7 @@ class TCache_tp : public TCache
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void log(const char* msg, int sev) const { _pt->log(msg, sev); }
|
void log(const char* msg, int sev) const { _pt->log(msg, sev); }
|
||||||
bool test_write(TLocalisamfile& file) const { return _pt->test_write(file); }
|
bool test_write(TIsamfile& file) const { return _pt->test_write(file); }
|
||||||
const TRecordset& recordset() const { return _pt->recordset(); }
|
const TRecordset& recordset() const { return _pt->recordset(); }
|
||||||
TConfig& config() const { return _pt->config(); }
|
TConfig& config() const { return _pt->config(); }
|
||||||
const TString& query_header() const { return _pt->query_header(); }
|
const TString& query_header() const { return _pt->query_header(); }
|
||||||
@ -127,7 +127,7 @@ protected:
|
|||||||
int cancella_clifo(TLocalisamfile& clifo) const;
|
int cancella_clifo(TLocalisamfile& clifo) const;
|
||||||
long get_next_key(const char tipocf) const;
|
long get_next_key(const char tipocf) const;
|
||||||
long get_codcf(const char tipocf, const char* ricalt) const;
|
long get_codcf(const char tipocf, const char* ricalt) const;
|
||||||
bool aggiorna_record(TLocalisamfile& file, const TString_array& lista_campi);
|
bool aggiorna_record(TIsamfile& file, const TString_array& lista_campi);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool trasferisci();
|
virtual bool trasferisci();
|
||||||
@ -151,7 +151,7 @@ class TGalileo_articoli : public TGalileo_transfer
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int cancella_articolo(TLocalisamfile& clifo) const;
|
int cancella_articolo(TLocalisamfile& clifo) const;
|
||||||
bool aggiorna_record(TLocalisamfile& file, const TString_array& lista_campi);
|
bool aggiorna_record(TIsamfile& file, const TString_array& lista_campi);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool trasferisci();
|
virtual bool trasferisci();
|
||||||
|
@ -113,11 +113,11 @@ bool TGalileo_clifo::trasferisci()
|
|||||||
TConfig& ini = config();
|
TConfig& ini = config();
|
||||||
TString_array lista_clifo;
|
TString_array lista_clifo;
|
||||||
ini.list_variables(lista_clifo, true, "CLIFO", true);
|
ini.list_variables(lista_clifo, true, "CLIFO", true);
|
||||||
TLocalisamfile clifo(LF_CLIFO);
|
TIsamfile clifo(LF_CLIFO);
|
||||||
TRectype& rec_clifo = clifo.curr();
|
TRectype& rec_clifo = clifo.curr();
|
||||||
|
|
||||||
_keys.destroy();
|
_keys.destroy();
|
||||||
|
clifo.open_ex();
|
||||||
TRecord_cache cache_comuni(LF_COMUNI, 2);
|
TRecord_cache cache_comuni(LF_COMUNI, 2);
|
||||||
TGalileo_iterator pi(this);
|
TGalileo_iterator pi(this);
|
||||||
|
|
||||||
@ -175,10 +175,11 @@ bool TGalileo_clifo::trasferisci()
|
|||||||
aggiorna_record(clifo, lista_clifo);
|
aggiorna_record(clifo, lista_clifo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
clifo.close();
|
||||||
return write_enabled();
|
return write_enabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TGalileo_clifo::aggiorna_record(TLocalisamfile& file, const TString_array& lista_campi)
|
bool TGalileo_clifo::aggiorna_record(TIsamfile& file, const TString_array& lista_campi)
|
||||||
{
|
{
|
||||||
TRectype& rec = file.curr();
|
TRectype& rec = file.curr();
|
||||||
TString campo_dest, campo_orig, valore, str;
|
TString campo_dest, campo_orig, valore, str;
|
||||||
@ -308,8 +309,12 @@ bool TGalileo_articoli::trasferisci()
|
|||||||
TString_array lista_anamag, lista_umart;
|
TString_array lista_anamag, lista_umart;
|
||||||
ini.list_variables(lista_anamag, true, "ANAMAG", true);
|
ini.list_variables(lista_anamag, true, "ANAMAG", true);
|
||||||
ini.list_variables(lista_umart, true, "UMART", true);
|
ini.list_variables(lista_umart, true, "UMART", true);
|
||||||
TLocalisamfile anamag(LF_ANAMAG);
|
TIsamfile anamag(LF_ANAMAG);
|
||||||
TLocalisamfile umart(LF_UMART);
|
TIsamfile umart(LF_UMART);
|
||||||
|
|
||||||
|
anamag.open_ex();
|
||||||
|
umart.open_ex();
|
||||||
|
|
||||||
TRectype& rec_anamag = anamag.curr();
|
TRectype& rec_anamag = anamag.curr();
|
||||||
TRectype& rec_umart = umart.curr();
|
TRectype& rec_umart = umart.curr();
|
||||||
_keys_articoli.destroy();
|
_keys_articoli.destroy();
|
||||||
@ -360,6 +365,8 @@ bool TGalileo_articoli::trasferisci()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
anamag.close();
|
||||||
|
umart.close();
|
||||||
return write_enabled();
|
return write_enabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,33 +377,37 @@ bool TGalileo_articoli::trasferisci_costi(const TString & ditta, const TString &
|
|||||||
"WHERE (M2AZI='";
|
"WHERE (M2AZI='";
|
||||||
query << ditta <<"') AND (M2COM='" << cms <<"') AND (M2CAN='" << can << "')";
|
query << ditta <<"') AND (M2COM='" << cms <<"') AND (M2CAN='" << can << "')";
|
||||||
TRecordset& recset = create_recordset(query);
|
TRecordset& recset = create_recordset(query);
|
||||||
TLocalisamfile anamag(LF_ANAMAG);
|
TIsamfile anamag(LF_ANAMAG);
|
||||||
TRectype& rec_anamag = anamag.curr();
|
TRectype& rec_anamag = anamag.curr();
|
||||||
TGalileo_iterator pi(this);
|
TGalileo_iterator pi(this);
|
||||||
TString80 codart;
|
TString80 codart;
|
||||||
|
|
||||||
|
anamag.open_ex();
|
||||||
while (++pi)
|
while (++pi)
|
||||||
{
|
{
|
||||||
codart = get_str("M2RIS");
|
codart = get_str("M2RIS");
|
||||||
codart.trim();
|
codart.trim();
|
||||||
codart.upper();
|
codart.upper();
|
||||||
// rec_anamag.zero();
|
|
||||||
rec_anamag.put(ANAMAG_CODART, codart);
|
rec_anamag.put(ANAMAG_CODART, codart);
|
||||||
bool good = anamag.read() == NOERR;
|
bool good = anamag.read() == NOERR;
|
||||||
|
|
||||||
|
TString msg; msg.format("Codice $s", (const char *) codart);
|
||||||
|
|
||||||
|
log(msg, 0);
|
||||||
if (good)
|
if (good)
|
||||||
{
|
{
|
||||||
TString msg; msg.format("Aggiorno codice $s - costo %s", (const char *) codart, (const char *) get_str("M2CMD"));
|
TString msg; msg.format("Aggiorno al costo %s", (const char *) get_str("M2CMD"));
|
||||||
|
|
||||||
log(msg, 0);
|
log(msg, 0);
|
||||||
anamag.put(ANAMAG_ULTCOS1, get_str("M2CMD"));
|
anamag.put(ANAMAG_ULTCOS1, get_str("M2CMD"));
|
||||||
return test_rewrite(anamag);
|
return test_rewrite(anamag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
anamag.close();
|
||||||
return write_enabled();
|
return write_enabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TGalileo_articoli::aggiorna_record(TLocalisamfile& file, const TString_array& lista_campi)
|
bool TGalileo_articoli::aggiorna_record(TIsamfile& file, const TString_array& lista_campi)
|
||||||
{
|
{
|
||||||
TRectype& rec = file.curr();
|
TRectype& rec = file.curr();
|
||||||
TString campo_dest, campo_orig, valore, str;
|
TString campo_dest, campo_orig, valore, str;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user