Patch level : 12.00 1388

Files correlati     : cg0.exe ve0.exe

Commento:
Trasformazione occasionali in clienti/fornitori
This commit is contained in:
Alessandro Bonazzi 2025-04-10 10:17:30 +02:00
parent f2633c1a29
commit 98be734862
2 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,4 @@
#include <applicat.h>
#include <array.h>
#include <config.h>
#include <execp.h>
@ -6,6 +7,7 @@
#include <strings.h>
#include <transaction.h>
#include <utility.h>
#include <strings.h>
#include <tabutil.h>
#include <tabmod.h>
#include <xml.h>
@ -715,6 +717,34 @@ bool TTransaction::get_warnings(TString_array & warnings) const
return warnings.items() > 0;
}
bool TTransaction::set_user(const char * u)
{
const char * wrk_user = u != nullptr ? u : user();
return set("User", wrk_user, -1, nullptr);
}
bool TTransaction::set_hostname(const char * h)
{
const char * wrk_host = h != nullptr ? h : get_hostname();
return set("HostName", wrk_host, -1, nullptr);
}
bool TTransaction::set_version()
{
int year, release, tag, patch;
if (main_app().get_version_info(year, release, tag, patch))
{
TString80 ver;
ver.format("%d %d.%d-%d", year, release, tag, patch);
set("Version", ver, -1, nullptr);
return true;
}
return false;
}
bool TTransaction::read()
{
if (_type == ini_transaction)

View File

@ -168,7 +168,10 @@ public:
bool set_stop_on_error(bool val) { return set("StopOnError", val ? 1 : 0, -1, nullptr); }
bool set_caller(const TString & caller) { return set("From", caller, -1, nullptr); }
bool set_firm(int firm) { return set("Firm", firm, -1, nullptr); }
const char * ext() const { return _type == ini_transaction ? "ini" : "xml"; }
bool set_user(const char * u = nullptr);
bool set_hostname(const char * h = nullptr);
bool set_version();
const char * ext() const { return _type == ini_transaction ? "ini" : "xml"; }
bool read();
bool write();