From 4bb6ba05093e8ba28a4e30ed850fbcd59ca78b01 Mon Sep 17 00:00:00 2001 From: cris Date: Fri, 3 Jul 1998 13:10:50 +0000 Subject: [PATCH] Patch level : Files correlati : Ricompilazione Demo : [ ] Commento : Sostituito message_box con error_box e corretto handler sul codice soggetto (to_check e K_TAB) git-svn-id: svn://10.65.10.50/trunk@6813 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- at/at0200.cpp | 39 +++++++++++++++++++++++++-------------- at/at0300.cpp | 2 +- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/at/at0200.cpp b/at/at0200.cpp index 05e6b2b4a..ebd4111d1 100755 --- a/at/at0200.cpp +++ b/at/at0200.cpp @@ -180,7 +180,7 @@ bool TGiornalieroDC::menu(MENU_TAG m) TGiornalieroDC::read(s); } else - message_box("Inserire almeno la data donazione per effettuare la ricerca"); + error_box("Inserire almeno la data donazione per effettuare la ricerca"); } break; @@ -308,10 +308,10 @@ int TGiornalieroDC::write(TSheet_field& s) pi->setstatus(1); TLocalisamfile& sog = get_relation()->lfile(); TLocalisamfile rconv(LF_RCONVOC); - for (int r=1; r<=s.items(); r++) + for (int rigasog=1; rigasog<=s.items(); rigasog++) { pi->addstatus(1); - TToken_string& row = s.row(r-1); + TToken_string& row = s.row(rigasog-1); const long codsog = row.get_long(0); if (codsog != 0) { @@ -442,11 +442,16 @@ int TGiornalieroDC::write(TSheet_field& s) _sdonazioni->insert_row(rec); } if (!exist) - { - _sdonazioni->write(TRUE); + { + if (insert) + { + err = _sdonazioni->row(_sdonazioni->rows()).write(*_donaz); + } + else + err = _sdonazioni->write(TRUE); // controllo se è idoneo - + int totdon = sog.get_int(SOG_TOTDON); TDate dataultdon = sog.get_date(SOG_DATAULTDON); sog.put(SOG_TOTDON,totdon+1); @@ -601,8 +606,13 @@ int TGiornalieroDC::write(TSheet_field& s) const TDate oggi(TODAY); sog.put(SOG_DATAULTAGG,oggi); sog.put(SOG_UTENULTAGG,user()); - - sog.rewrite(); + if (err == NOERR) + sog.rewrite(); + else + { + error_box("Errore %d durante la scrittura della riga %d", err, rigasog); + break; + } } } } @@ -631,8 +641,8 @@ bool TGiornalieroDC::soggetti_notify(TSheet_field& s, int r, KEY k) // richiesta inserimento riga if (app()._ricerca) { - s.message_box("Fase di ricerca: impossibile inserire donazioni"); - ok = FALSE; + ok = s.error_box("Fase di ricerca: impossibile inserire donazioni"); + //ok = FALSE; } break; case K_DEL: @@ -731,7 +741,7 @@ bool TGiornalieroDC::nome_handler(TMask_field& f, KEY k) bool TGiornalieroDC::codice_handler(TMask_field& f, KEY k) { bool ok = TRUE; - if (f.to_check(k)) + if ((k==K_TAB) && (f.to_check(k))) { TString256 messaggio = ""; TMask& m = f.mask(); @@ -795,9 +805,10 @@ bool TGiornalieroDC::codice_handler(TMask_field& f, KEY k) } else ok = FALSE; // codice non esistente - } - if (messaggio.not_empty() && !app()._ricerca && !app()._nomessage) - f.message_box(messaggio); + if (messaggio.not_empty() && !app()._ricerca && !app()._nomessage) + //f.message_box(messaggio); + warning_box(messaggio); + } } return ok; } diff --git a/at/at0300.cpp b/at/at0300.cpp index cc1d83a99..43a02c0ee 100755 --- a/at/at0300.cpp +++ b/at/at0300.cpp @@ -383,7 +383,7 @@ bool TGiornalieroC::nome_handler(TMask_field& f, KEY k) bool TGiornalieroC::codice_handler(TMask_field& f, KEY k) { bool ok = TRUE; - if (f.to_check(k)) + if ((k==K_TAB) && (f.to_check(k))) { TMask& m = f.mask(); long codsog = m.get_long(F_S_CODICE);