From 9867be85130c09007e7d6f88845f01759bdf3daf Mon Sep 17 00:00:00 2001 From: luca Date: Wed, 6 Apr 2011 13:32:29 +0000 Subject: [PATCH] Patch level : Files correlati : Ricompilazione Demo : [ ] Commento : git-svn-id: svn://10.65.10.50/branches/R_10_00@21907 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ha/ha0100.cpp | 28 ++++++++++++++++++++++++++++ ha/ha2200.cpp | 2 +- ha/ha3.cpp | 3 ++- ha/ha3.h | 1 + ha/ha3900.cpp | 5 ++--- ha/hamenu.men | 13 +++++++++++-- projects/Cg7.vcproj | 36 ++++++++++++++++++++++++++++++++++-- projects/ha.sln | 6 ++++++ projects/ha2.vcproj | 28 ++++++++++++++++++++++++++++ 9 files changed, 113 insertions(+), 9 deletions(-) diff --git a/ha/ha0100.cpp b/ha/ha0100.cpp index 5a198af1e..1d5519369 100755 --- a/ha/ha0100.cpp +++ b/ha/ha0100.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include "hatbcau.h" @@ -33,10 +34,37 @@ bool THA_table_mask::on_field_event(TOperable_field &o, TField_event e, long jol class THA_table_app : public TTable_module_application { protected: // TRelation_application + virtual bool protected_record(TRectype& record); virtual void init_query_mode(TMask& m); virtual void init_query_insert_mode(TMask& m); }; + +bool THA_table_app::protected_record(TRectype& record) +{ + const TString4 name = get_relation()->file(0).name(); + + //tabella delle attrezzature + //non si puņ eliminare una attrezzatura se la medesima ha una storia! rispettiamo gli anziani! + if (name == "ATT") + { + //controlla che l'attrezzatura non abbia record nella tabella della storia attrezzature + TString query; + query << "USE &HAHIS"; + query << "\nFROM CODTAB=#CODATTR"; + query << "\nTO CODTAB=#CODATTR"; + + const TString codattr = record.get("CODTAB"); + + TISAM_recordset attr_recset(query); + attr_recset.set_var("#CODATTR", codattr); + + const long items = attr_recset.items(); + return items > 0; + } + return true; +} + void THA_table_app::init_query_mode(TMask& m) { const TString4 name = get_relation()->file(0).name(); diff --git a/ha/ha2200.cpp b/ha/ha2200.cpp index 84fe03470..7bd423bda 100755 --- a/ha/ha2200.cpp +++ b/ha/ha2200.cpp @@ -115,7 +115,7 @@ public: }; void TFatture_recordset::add_field(const char* name, TFE_type type, int len, int pos, - bool required = false, const char* def = NULL) + bool required, const char* def) { CHECKS(len > 0, "Lunghezza nulla sul campo ", name); CHECKS(pos > 0, "Posizione nulla sul campo ", name); diff --git a/ha/ha3.cpp b/ha/ha3.cpp index 559bbc636..d3ea81d3d 100755 --- a/ha/ha3.cpp +++ b/ha/ha3.cpp @@ -3,7 +3,7 @@ #include "ha3.h" -#define usage "Error - usage : %s -{0|1}" +#define usage "Error - usage : %s -{0|8}" int main(int argc,char** argv) { @@ -13,6 +13,7 @@ int main(int argc,char** argv) switch (r) { case 0: rt = ha3100(argc, argv); break; //Gestione giri + case 8: rt = ha3900(argc, argv); break; //Gestione attrezzature default: error_box(usage, argv[0]); break; } return rt; diff --git a/ha/ha3.h b/ha/ha3.h index 968cc86fb..a5b01427d 100755 --- a/ha/ha3.h +++ b/ha/ha3.h @@ -1 +1,2 @@ int ha3100(int argc, char* argv[]); +int ha3900(int argc, char* argv[]); diff --git a/ha/ha3900.cpp b/ha/ha3900.cpp index 4647d01d2..a5d657eea 100755 --- a/ha/ha3900.cpp +++ b/ha/ha3900.cpp @@ -195,9 +195,8 @@ void TGestione_attrezzature_mask::fill_sheet_storico(const TString& codattr) { TToken_string& row = sf_righe.row(-1); //riga sheet da riempire row.add(""); //nuova riga - const TString& row_tipo = recset.get("S7").as_string(); //tipo intervento - row.add(row_tipo, _pos_tipo); - const TDate row_data = recset.get("D0").as_date(); + /*const TString& row_nr = recset.get("CODTAB[31,35]").as_string(); + row.add(row_codattr, _pos_nr);*/ } //mostra e aggiorna lo sheet diff --git a/ha/hamenu.men b/ha/hamenu.men index 4816e8271..f0fc08ae3 100755 --- a/ha/hamenu.men +++ b/ha/hamenu.men @@ -7,8 +7,9 @@ Item_01 = "Gestione listini", [HAMENU_002] Item_02 = "Gestione contratti premio", [HAMENU_003] Item_03 = "Collegamento terminalini", [HAMENU_004] Item_04 = "Procedura Esselunga", [HAMENU_006] -Item_05 = "Gestione dei giri", "ha3 -0", "" -Item_06 = "Servizi", [HAMENU_005] +Item_05 = "Gestione attrezzature", [HAMENU_007] +Item_06 = "Gestione dei giri", "ha3 -0", "" +Item_07 = "Servizi", [HAMENU_005] [HAMENU_002] Caption = "Listini" @@ -57,3 +58,11 @@ Flags = "F" Item_01 = "Gestione file Privat", "ha2 -0", "F" Item_02 = "Gestione file Fattura", "ha2 -1", "F" Item_03 = "Tabella clienti Esselunga", "ha0 -0 &CEL", "" + +[HAMENU_007] +Caption = "Gestione attrezzature" +Picture = +Module = 46 +Flags = "F" +Item_01 = "Tabella attrezzature", "ha0 -0 &ATT", "" +Item_02 = "Gestione attrezzature", "ha3 -8", "F" diff --git a/projects/Cg7.vcproj b/projects/Cg7.vcproj index 94ef06bad..92091b11c 100755 --- a/projects/Cg7.vcproj +++ b/projects/Cg7.vcproj @@ -325,6 +325,10 @@ Name="Sources" Filter="cpp" > + + @@ -369,13 +373,25 @@ /> + + + + + + @@ -388,7 +404,23 @@ > + + + + + + + + diff --git a/projects/ha.sln b/projects/ha.sln index a06da9ba3..9cf8f26cc 100755 --- a/projects/ha.sln +++ b/projects/ha.sln @@ -9,6 +9,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ha1", "ha1.vcproj", "{5C6DF EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ha2", "ha2.vcproj", "{4C15FF8A-4C27-4243-9E21-E7C96AE94E58}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ha3", "ha3.vcproj", "{9A791169-2B91-451F-8A2C-CE28C9F1F316}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -31,6 +33,10 @@ Global {4C15FF8A-4C27-4243-9E21-E7C96AE94E58}.Debug|Win32.Build.0 = Debug|Win32 {4C15FF8A-4C27-4243-9E21-E7C96AE94E58}.Release|Win32.ActiveCfg = Release|Win32 {4C15FF8A-4C27-4243-9E21-E7C96AE94E58}.Release|Win32.Build.0 = Release|Win32 + {9A791169-2B91-451F-8A2C-CE28C9F1F316}.Debug|Win32.ActiveCfg = Debug|Win32 + {9A791169-2B91-451F-8A2C-CE28C9F1F316}.Debug|Win32.Build.0 = Debug|Win32 + {9A791169-2B91-451F-8A2C-CE28C9F1F316}.Release|Win32.ActiveCfg = Release|Win32 + {9A791169-2B91-451F-8A2C-CE28C9F1F316}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/projects/ha2.vcproj b/projects/ha2.vcproj index 121ec7ddf..0e7dce3f4 100755 --- a/projects/ha2.vcproj +++ b/projects/ha2.vcproj @@ -334,6 +334,10 @@ RelativePath="..\ha\ha2100.cpp" > + + + + + + + + + + + + +