Correzioni DNINST via MySql

git-svn-id: svn://10.65.10.50/branches/R_10_00@22808 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2013-03-03 21:43:48 +00:00
parent ab1eb5eb41
commit e2c7783386
4 changed files with 72 additions and 28 deletions

View File

@ -35,6 +35,26 @@ bool TMenu_tree::enabled() const
return curr_item().enabled();
}
bool TMenu_tree::marked() const
{
bool yes = false;
/* Non cambia nulla!
const TMenuitem& mi = curr_item();
if (mi.is_program() && mi.enabled())
{
TFilename n = mi.action().before(' ');
n.ext("exe");
if (n.custom_path())
{
n.lower();
yes = n.find("custom") > 0;
}
}
*/
return yes;
}
struct TFind_node_data
{
TString _id;

View File

@ -47,7 +47,8 @@ public: // TTree
virtual bool get_description(TString& desc) const;
virtual TImage* image(bool selected) const;
virtual bool enabled() const;
virtual bool marked() const;
public:
const TSubmenu& curr_submenu() const;
const TMenuitem& curr_item() const;

View File

@ -124,14 +124,17 @@ void TBook_window::update()
RCT rctw; xvt_vobj_get_client_rect(w, &rctw);
if (rctw.right >= 64 && rctw.bottom >= 64)
{
if (_back.ok())
_back.draw(w, rctw, 'L', 'T', '*'); // Disegna sfondo in alto
if (_logo.ok())
{
const RCT& r = _logo.draw(w, rctw, 'R', 'B', '-'); // Disegna logo in basso
if (_back.ok() && r.top >= 64)
/* if (_back.ok() && r.top >= 64)
{
rctw.bottom = r.top;
_back.draw(w, rctw, 'R', 'T', '*'); // Disegna sfondo in alto
}
*/
}
const PNT pnt = { 0, 0 };
@ -449,7 +452,7 @@ void TBook_window::set_back(const TString& back)
if (!ok)
{
str.ext("gif");
str.custom_path();
ok = str.custom_path();
}
if (ok && _back.load(back))
{
@ -463,9 +466,6 @@ void TBook_window::set_back(const TString& back)
const COLOR rgb = _back.get_pixel(x, y);
if (rgb != NORMAL_BACK_COLOR)
{
const unsigned char r = XVT_COLOR_GET_RED(rgb);
const unsigned char g = XVT_COLOR_GET_GREEN(rgb);
const unsigned char b = XVT_COLOR_GET_BLUE(rgb);
const COLOR col = blend_colors(NORMAL_BACK_COLOR, rgb, 0.9);
if (col != rgb)
_back.set_pixel(x, y, col);

View File

@ -418,25 +418,47 @@ bool Tdninst_mask::load_odbc(TString_array& a) const
r.add(_oem.Agente2OEM(agente), _c_dboem);
r.add(smart_trim(att.get("RagioneSociale").as_string(), 50), _c_dbowner);
const TString& stato = att.get("Stato").as_string();
if (atoi(r) == 5160)
int cazzone = 1;
TString16 kill;
TString16 stato = att.get("Stato").as_string();
if (stato[0] > 'A') // Non Attivo
kill = att.get("DataDisattivazione").as_string();
if (kill.blank())
{
const TString& kill = att.get("DataDisattivazione").as_string();
if (kill.full() && kill.len() == 10)
query.cut(0);
query << "ODBC(" << dsn << ")\n"
<< "SELECT Chiave,DataAttivazione,DataScadenza\n"
<< "FROM attivazioni WHERE Modulo IS NULL AND Chiave=" << r.get(0);
TODBC_recordset ad(query);
for (bool ok = ad.move_first(); ok; ok = ad.move_next())
{
TDate d;
if (kill[2] == '-')
d = TDate(kill); else
if (kill[4] == '-')
d = TDate(atoi(kill.mid(8,2)), atoi(kill.mid(5,2)), atoi(kill.left(4)));
if (d.year() >= 1990)
const TString& attivaz = ad.get("DataAttivazione").as_string();
const TString& disatt = ad.get("DataScadenza").as_string();
if (disatt > kill)
kill = disatt; else
if (attivaz > kill)
kill.cut(0);
}
if (kill.full())
stato = "Disdetto";
}
if (kill.full() && kill.len() == 10)
{
TDate d;
if (kill[2] == '-')
d = TDate(kill); else
if (kill[4] == '-')
d = TDate(atol(kill.strip("-")));
if (d.year() >= 1990)
{
switch (stato[0])
{
switch (stato[0])
{
case 'D': r.add(d.string(), _c_dbkilled); break; // Disdetto
case 'S': r.add(d.string(), _c_dbsuspend); break; // Sospeso
default: break; // Attivo
}
case 'D': r.add(d.string(), _c_dbkilled); break; // Disdetto
case 'S': r.add(d.string(), _c_dbsuspend); break; // Sospeso
default: break; // Attivo
}
}
}
@ -534,7 +556,7 @@ bool Tdninst_mask::load_xml(TString_array& a) const
bool Tdninst_mask::get_remote_dninst()
{
const TString& n = remote_dninst(10);
const TString& n = remote_dninst(11);
if (n.full())
{
const int minsize = 46*1024;
@ -622,7 +644,7 @@ bool Tdninst_mask::fill_sheet()
TDate ds = row->get(_c_suspend);
TDate dk = row->get(_c_killed);
if (ds > ds) ds = dk;
if (dk > ds) ds = dk;
TDate dbs = row->get(_c_dbsuspend);
TDate dbk = row->get(_c_dbkilled);
@ -631,15 +653,16 @@ bool Tdninst_mask::fill_sheet()
if (ds != dbs)
{
if (dbs.ok())
{
s.set_back_and_fore_color(FOCUS_BACK_COLOR, FOCUS_COLOR, r, _c_suspend);
s.set_back_and_fore_color(FOCUS_BACK_COLOR, FOCUS_COLOR, r, _c_killed);
}
else
{
s.set_back_and_fore_color(FOCUS_BACK_COLOR, FOCUS_COLOR, r, _c_dbsuspend);
}
if (dk != dbk)
{
if (dbk.ok())
s.set_back_and_fore_color(FOCUS_BACK_COLOR, FOCUS_COLOR, r, _c_killed);
else
s.set_back_and_fore_color(FOCUS_BACK_COLOR, FOCUS_COLOR, r, _c_dbkilled);
}
}
}