From 9a685ffcd86553bd0c2c65667be7e8e1bc681225 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 1 Apr 2005 11:01:55 +0000 Subject: [PATCH] Patch level : 2.2 Files correlati : ca0.exe Ricompilazione Demo : [ ] Commento : Corretto inserimento delle tabelle con codici multilivello git-svn-id: svn://10.65.10.50/trunk@12889 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ca/calib01.cpp | 23 ++++++++++++++++------- ca/calib01.h | 1 + 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ca/calib01.cpp b/ca/calib01.cpp index 96a4f68dc..8ed876458 100755 --- a/ca/calib01.cpp +++ b/ca/calib01.cpp @@ -63,6 +63,12 @@ const TString& TMultilevel_code_info::picture(int level) const return _picture.row(level); } +bool TMultilevel_code_info::is_required(int level) const +{ + bool yes = level <= 0; + return yes; +} + bool TMultilevel_code_info::is_numeric_picture(int level) const { const TString& pic = picture(level); @@ -321,7 +327,7 @@ void ca_create_browse1(TEdit_field& kfld, int level, int logic, short key_id, sh const TFieldref& field = mci.fieldref(0, 2); out << "DI \"" << TR("Descrizione") << "@50\" " << field << endl; out << "OU " << (des_id+level) << ' ' << field << endl; - out << "CH RE" << endl; + out << "CH " << (level == 0 ? "RE" : "NO") << endl; out << "FI " << main_info.fieldref(level) << endl; out << "EN" << endl; out.close(); @@ -729,7 +735,9 @@ int TSimple_anal_msk::create_key_fields() const short did = get_field_id(0, 2); const int x = compute_offset()+2; const int y = 1; - return ca_create_fields(*this, logic, x, y, kid, did, 0x3); + const int n = ca_create_fields(*this, logic, x, y, kid, did, 0x1); + const int m = ca_create_fields(*this, logic, x, y, kid, did, 0x2); + return n; } /////////////////////////////////////////////////////////// @@ -998,11 +1006,14 @@ void TAnal_app::init_key_fields() const } else { - TString key2; key2 << _msk->fieldref(0, 2); e.show(); e.check(STARTING_CHECK); - d.show(); + + TString80 key2; + if (i == maxlev-1) + key2 << _msk->fieldref(0, 2); d.set_field(key2); + d.show(); d.enable(); d.enable_check(false); break; @@ -1010,7 +1021,6 @@ void TAnal_app::init_key_fields() const } } - TRelation* TAnal_app::create_relation() const { return new TRelation(_msk->get_logicnum()); @@ -1038,7 +1048,6 @@ void TAnal_app::init_query_mode(TMask& mask) const short did = m.get_field_id(i, 2); TEdit_field& d = m.efield(did); d.show(); d.enable(); -// d.set_field(EMPTY_STRING); d.enable_check(); } } @@ -1284,7 +1293,7 @@ TObject* TCache_ripartizioni::key2obj(const char* key) const TRecord_array& TCache_ripartizioni::righe(const char* costo, const char* commessa) { TToken_string parametro; - parametro <<"4|" << costo << '|' << commessa; //per chiave 4 + parametro << "4|" << costo << '|' << commessa; //per chiave 4 return *(const TRecord_array*)objptr(parametro); } diff --git a/ca/calib01.h b/ca/calib01.h index aa755abd4..d4c99303b 100755 --- a/ca/calib01.h +++ b/ca/calib01.h @@ -32,6 +32,7 @@ public: int len(int level) const; const TString& picture(int level) const; bool is_numeric_picture(int level) const; + bool is_required(int level) const; const TString& prompt(int level) const; const TFieldref& fieldref(int level, int key = 1) const; int parent() const { return _parentnum; }