From 83c0eeef071ee28f0dbb4e49e34f83d25062269f Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 27 Jan 2011 14:09:29 +0000 Subject: [PATCH] Patch level : 10.0 900 Files correlati : cg3.exe Ricompilazione Demo : [ ] Commento : Bug 0001760: Visualizzazione Mastrini (cg3) Quando si seleziona il conto da visualizzare, se sono presenti 2 conti clienti o fornitori anche se viene selezionato il secondo il programma rimettere il primo. (Dinamica) git-svn-id: svn://10.65.10.50/branches/R_10_00@21527 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg3600.cpp | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/cg/cg3600.cpp b/cg/cg3600.cpp index 9bbc839b9..75a6cb895 100755 --- a/cg/cg3600.cpp +++ b/cg/cg3600.cpp @@ -2318,6 +2318,7 @@ long TGrid_mask::handler(WINDOW win, EVENT* ep) class TQuery_mask : public TAutomask { TGrid_mask* _gm; + TString4 _last_tipo; protected: virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); @@ -2337,18 +2338,23 @@ bool TQuery_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) if (e == fe_modify) { const TString& tipo = o.get(); - if (tipo.full()) - { - TWait_cursor hourglass; - TString query; - query << "USE " << LF_PCON << " SELECT " << PCN_TMCF << "=\"" << tipo << "\""; - TISAM_recordset conti(query); - if (conti.move_first()) - { - set(F_GRUPPO, conti.get(PCN_GRUPPO).as_int(), 0x2); - set(F_CONTO, conti.get(PCN_CONTO).as_int(), 0x2); - } - } + + if (tipo != _last_tipo) + { + _last_tipo = tipo; + if (tipo.full()) + { + TWait_cursor hourglass; + TString query; + query << "USE " << LF_PCON << " SELECT " << PCN_TMCF << "=\"" << tipo << "\""; + TISAM_recordset conti(query); + if (conti.move_first()) + { + set(F_GRUPPO, conti.get(PCN_GRUPPO).as_int(), 0x2); + set(F_CONTO, conti.get(PCN_CONTO).as_int(), 0x2); + } + } + } } break; case F_CLIENTE: @@ -2445,7 +2451,7 @@ bool TQuery_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) return true; } -TQuery_mask::TQuery_mask(TGrid_mask* gm) : TAutomask("cg3600a"), _gm(gm) +TQuery_mask::TQuery_mask(TGrid_mask* gm) : TAutomask("cg3600a"), _gm(gm), _last_tipo("") { } void TQuery_mask::do_query()