Patch level : 4.0

Files correlati     :
Ricompilazione Demo : [ ]
Commento            : Versione con filtro su data e parametrizzaiozne file da importare


git-svn-id: svn://10.65.10.50/trunk@14584 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 2006-11-30 14:13:28 +00:00
parent b8f5142863
commit 817f9582b4
5 changed files with 42 additions and 9 deletions

View File

@ -490,7 +490,7 @@ void TTrasferimentoGalileo_mask::trasferisci()
TGalileo_log* log = new TGalileo_log;
rep.set_recordset(log);
TDate data = get(F_DATA);
const TDate data = get(F_DATA);
bool rep_to_print = false;
bool go_on = true;
@ -500,8 +500,10 @@ void TTrasferimentoGalileo_mask::trasferisci()
TString80 dsn = get(F_DSN1);
if (dsn.empty())
{
TFilename path = get(F_PATH);
path << "clifo.txt";
TSystemisamfile clifo(LF_CLIFO);
clifo.overwrite("clifo.txt");
clifo.overwrite(path);
}
else
{
@ -509,6 +511,7 @@ void TTrasferimentoGalileo_mask::trasferisci()
query_header << "ODBC(" << get(F_DSN1) << ',' << get(F_USR1) << ',' << get(F_PWD1) << ")\n";
TGalileo_clifo pc;
pc.set_data_limite(get_date(F_DATA));
pc.set_path(get(F_PATH));
pc.init(TR("Clienti/Fornitori"), query_header, log);
go_on = pc.trasferisci();
book.add(rep);
@ -522,10 +525,14 @@ void TTrasferimentoGalileo_mask::trasferisci()
TString80 dsn = get(F_DSN2);
if (dsn.empty())
{
TFilename path = get(F_PATH);
path << "anamag.txt";
TSystemisamfile anamag(LF_ANAMAG);
anamag.overwrite("anamag.txt");
anamag.overwrite(path);
TSystemisamfile umart(LF_UMART);
umart.overwrite("umart.txt");
path = get(F_PATH);
path << "umart.txt";
umart.overwrite(path);
}
else
{
@ -533,6 +540,8 @@ void TTrasferimentoGalileo_mask::trasferisci()
query_header << "ODBC(" << get(F_DSN2) << ',' << get(F_USR2) << ',' << get(F_PWD2) << ")\n";
TGalileo_articoli pc;
pc.init(TR("Articoli"), query_header, log);
pc.set_data_limite(get_date(F_DATA));
pc.set_path(get(F_PATH));
go_on = pc.trasferisci();
book.add(rep);
if (go_on)

View File

@ -121,6 +121,7 @@ class TGalileo_clifo : public TGalileo_transfer
{
TDate _data;
TString _path;
protected:
int cancella_clifo(TLocalisamfile& clifo) const;
@ -132,6 +133,7 @@ public:
virtual bool trasferisci();
virtual bool dump();
void set_data_limite(const TDate& data) { _data = data; }
void set_path(const TString& path) { _path = path; }
TGalileo_clifo();
~TGalileo_clifo();
};
@ -140,6 +142,7 @@ class TGalileo_articoli : public TGalileo_transfer
{
TDate _data;
TString _path;
protected:
int cancella_articolo(TLocalisamfile& clifo) const;
@ -149,6 +152,7 @@ public:
virtual bool trasferisci();
virtual bool dump();
void set_data_limite(const TDate& data) { _data = data; }
void set_path(const TString& path) { _path = path; }
TGalileo_articoli();
~TGalileo_articoli();
};

View File

@ -15,4 +15,6 @@
#define F_USR2 205
#define F_PWD2 206
#define F_PATH 207
#endif

View File

@ -104,6 +104,11 @@ BEGIN
FLAGS "*"
END
STRING F_PATH 100 35
BEGIN
PROMPT 2 12 "Percorso file da importare/esportare "
END
ENDPAGE
ENDMASK

View File

@ -75,8 +75,10 @@ bool TGalileo_clifo::dump()
if (!campo_orig.blank())
lista_dump.add(campo_dest);
}
TFilename path = _path;
path << "clifo.txt";
TSystemisamfile clifo(LF_CLIFO);
return (clifo.dump("clifo.txt", lista_dump) == NOERR);
return (clifo.dump(path, lista_dump) == NOERR);
}
bool TGalileo_clifo::trasferisci()
@ -87,8 +89,8 @@ bool TGalileo_clifo::trasferisci()
"FROM CGANA01J \n";
if (!_data.empty())
{
query << "WHERE DTMNCA >= '";
query << _data.string() << "'";
query << "WHERE DTMNCA >= ";
query << _data.date2ansi();
}
TRecordset& recset = create_recordset(query);
@ -223,11 +225,17 @@ bool TGalileo_articoli::dump()
if (!campo_orig.blank())
lista_dump.add(campo_dest);
}
TFilename path = _path;
path << "umart.txt";
TSystemisamfile anamag(LF_ANAMAG);
TSystemisamfile umart(LF_UMART);
int err = umart.dump("umart.txt");
int err = umart.dump(path);
if (err == NOERR)
err = anamag.dump("anamag.txt", lista_dump);
{
path = _path;
path << "anamag.txt";
err = anamag.dump(path, lista_dump);
}
return (err == NOERR);
}
@ -237,6 +245,11 @@ bool TGalileo_articoli::trasferisci()
"SELECT RICOD, RDES1, RDES2, RDES3, RSUMS, RITIP \n"
"FROM BRISO00F, BTABE00F \n"
"WHERE (MID(TBDAT,9,1)=RITIP) AND (TBTIP='COD') AND (TBELE='RIS')";
if (!_data.empty())
{
query << "WHERE RIDTX >= ";
query << _data.date2ansi();
}
TRecordset& recset = create_recordset(query);