Corretto menu

git-svn-id: svn://10.65.10.50/trunk@947 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-02-01 18:02:41 +00:00
parent ca9cbb6b36
commit 1fd60f8e2c
3 changed files with 11 additions and 14 deletions

View File

@ -1,7 +1,7 @@
#include <relapp.h> #include <relapp.h>
#include <stdtypes.h> #include <stdtypes.h>
#include <lffiles.h>
#include <utility.h> #include <utility.h>
#include "ba4.h" #include "ba4.h"
#include "ba4600.h" #include "ba4600.h"
@ -47,15 +47,12 @@ void TSoci_application::init_query_insert_mode(TMask& m)
void TSoci_application::update_ap_socio(const TMask& m) void TSoci_application::update_ap_socio(const TMask& m)
{ {
TString16 ap = m.get(FLD_SC1_ANNO);
int err = NOERR; int err = NOERR;
const char ap = (m.get(FLD_SC1_ANNO)[0] == 'A') ? 'P' : 'A';
if (ap == "A") if (yesno_box(format("Aggiornare anche il socio %s?", ap == 'A' ? "attuale" : "precedente")))
ap = "P";
else
ap = "A";
if (yesno_box(format("Devo aggiornare anche il socio %s", ap == "A" ? "attuale" : "precedente")))
{ {
_rel->save_status();
m.autosave(_rel); m.autosave(_rel);
_rel->lfile().put("ATTPREC", ap); _rel->lfile().put("ATTPREC", ap);
const bool was =_rel->read(_isequal, _lock) == NOERR; const bool was =_rel->read(_isequal, _lock) == NOERR;
@ -64,8 +61,8 @@ void TSoci_application::update_ap_socio(const TMask& m)
if (was) err = _rel->rewrite(); if (was) err = _rel->rewrite();
else err = _rel->write(); else err = _rel->write();
if (err != NOERR) if (err != NOERR)
message_box(format("Aggiornamento socio %s - Errore : %d", ap == "A" ? "attuale" : "precedente", err)); error_box("Aggiornamento socio %s - Errore : %d", ap == 'A' ? "attuale" : "precedente", err);
get_relation()->restore_status(); _rel->restore_status();
} }
} }
@ -87,10 +84,10 @@ int TSoci_application::rewrite(const TMask& m)
bool TSoci_application::user_create() bool TSoci_application::user_create()
{ {
_msk = new TMask("ba4600a") ;
_rel = new TRelation(LF_SOCI) ; _rel = new TRelation(LF_SOCI) ;
_anag = new TLocalisamfile(LF_ANAG) ; _anag = new TLocalisamfile(LF_ANAG) ;
_ditte = new TLocalisamfile(LF_NDITTE) ; _ditte = new TLocalisamfile(LF_NDITTE) ;
_msk = new TMask("ba4600a") ;
set_search_field(FLD_SC1_CODANAGRSOH); set_search_field(FLD_SC1_CODANAGRSOH);
return TRUE; return TRUE;
} }
@ -98,9 +95,9 @@ bool TSoci_application::user_create()
bool TSoci_application::user_destroy() bool TSoci_application::user_destroy()
{ {
delete _msk; delete _msk;
delete _rel;
delete _anag;
delete _ditte; delete _ditte;
delete _anag;
delete _rel;
return TRUE; return TRUE;
} }

View File

@ -20,7 +20,7 @@ protected:
virtual TMask* get_mask(int) { return _msk; } virtual TMask* get_mask(int) { return _msk; }
virtual bool changing_mask(int) { return FALSE;} virtual bool changing_mask(int) { return FALSE;}
virtual TRelation* get_relation() const { return _rel; } virtual TRelation* get_relation() const { return _rel; }
virtual int read(TMask& m) { m.autoload(); return NOERR; } virtual int read(TMask& m) { m.autoload(_rel); return NOERR; }
virtual int write(const TMask&) { return NOERR; } virtual int write(const TMask&) { return NOERR; }
virtual int rewrite(const TMask&) { return NOERR; } virtual int rewrite(const TMask&) { return NOERR; }

View File

@ -140,7 +140,7 @@
16|Copia Archivi|cg4 -1 16|Copia Archivi|cg4 -1
16|Ripristino stampa registri|cg5 -4 16|Ripristino stampa registri|cg5 -4
16|Ripristino liquidazione|cg5 -6 16|Ripristino liquidazione|cg5 -6
17|Modello 770|5 17|Modello 770|2
17|Manutenzione dichiarazioni|18|F,4 17|Manutenzione dichiarazioni|18|F,4
17|Parametri di studio|773 -0 17|Parametri di studio|773 -0
17|Tabella C.A.A.F.|773 -3 %caf 17|Tabella C.A.A.F.|773 -3 %caf