From d0a7cbd061dac8be794cd9e77f89a527734a28a5 Mon Sep 17 00:00:00 2001 From: luca83 Date: Fri, 6 Aug 2010 08:58:20 +0000 Subject: [PATCH] Patch level : 10.0 patch ??? Files correlati : tracciati record ci0 cilib Ricompilazione Demo : [ ] Commento : Aggiunta una chiave al file rilore Segnalazione Robby - Devo poter inserire la stessa risorsa con lo stesso tipo ora su piu' cantieri git-svn-id: svn://10.65.10.50/branches/R_10_00@20769 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ci/ci0600.cpp | 2 +- ci/cilib.cpp | 33 +++++++++++++++++++++++++++++++++ ci/cilib.h | 2 ++ ci/f125.trr | 7 ++++--- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/ci/ci0600.cpp b/ci/ci0600.cpp index 1c49ae72f..9975f4667 100755 --- a/ci/ci0600.cpp +++ b/ci/ci0600.cpp @@ -386,7 +386,7 @@ void TDef_risoatt_msk::registra() get_row_anal_fields(riga, codcosto, codcms, codfase); - TRilevamento_ore rilroa('D', tipora, codice, anno, mese, tpora); + TRilevamento_ore rilroa('D', tipora, codice, anno, mese, tpora, codcosto, codcms, codfase); if(!rilroa.empty() && qtaore == 0) rilroa.remove(file); else diff --git a/ci/cilib.cpp b/ci/cilib.cpp index 145448e62..460d7ee36 100755 --- a/ci/cilib.cpp +++ b/ci/cilib.cpp @@ -647,6 +647,7 @@ bool TRilevamento_ore::read(const char tipo, const char tipora, const char *codi int err = _iskeynotfound; TLocalisamfile rilore(LF_RILORE); + rilore.setkey(2); put(RILORE_TIPO, tipo); put(RILORE_TIPORA, tipora); @@ -663,12 +664,38 @@ bool TRilevamento_ore::read(const char tipo, const char tipora, const char *codi return err == NOERR; } +//READ: cerca una riga rilevamento ore in base alla chiave secodaria +bool TRilevamento_ore::read(const char tipo, const char tipora, const char *codice, const int anno, const char *mese, const char *tpora, const char* codcosto, const char* codcms, const char* codfase) +{ + int err = _iskeynotfound; + + TLocalisamfile rilore(LF_RILORE); + + put(RILORE_TIPO, tipo); + put(RILORE_TIPORA, tipora); + put(RILORE_CODICE, codice); + put(RILORE_ANNO, anno); + put(RILORE_MESE, mese); + put(RILORE_TPORA, tpora); + put(RILORE_CODCOSTO, codcosto); + put(RILORE_CODCMS, codcms); + put(RILORE_CODFASE, codfase); + + err = TRectype::read(rilore); + + if (err != NOERR) + zero(); + + return err == NOERR; +} + //READ: cerca una riga rilevamento ore in base alla chiave secondaria bool TRilevamento_ore::read(const char tipo, const char* codcosto, const char* codcms, const char* codfase) { int err = _iskeynotfound; TLocalisamfile rilore(LF_RILORE); + rilore.setkey(3); put(RILORE_TIPO, tipo); put(RILORE_CODCOSTO, codcosto); @@ -850,6 +877,12 @@ TRilevamento_ore::TRilevamento_ore(const TRilevamento_ore& rilore) { } +TRilevamento_ore::TRilevamento_ore(const char tipo, const char tipora, const char* codice, const int anno, const char* mese, const char* tpora, const char* codcosto, const char* codcms, const char* codfase) + : TRectype(LF_RILORE) +{ + read(tipo, tipora, codice, anno, mese, tpora, codcosto, codcms, codfase); +} + TRilevamento_ore::TRilevamento_ore(const char tipo, const char tipora, const char* codice, const int anno, const char* mese, const char* tpora) : TRectype(LF_RILORE) { diff --git a/ci/cilib.h b/ci/cilib.h index 316f06fb1..3f38be52a 100755 --- a/ci/cilib.h +++ b/ci/cilib.h @@ -220,6 +220,7 @@ public: class TRilevamento_ore : public TRectype { private: + bool read(const char tipo, const char tipora, const char* codice, const int anno, const char* mese, const char* tpora, const char* codcosto, const char* codcms, const char* codfase); bool read(const char tipo, const char tipora, const char* codice, const int anno, const char* mese, const char* tpora); bool read(const char tipo, const char* codcosto, const char* codcms, const char* codfase); @@ -256,6 +257,7 @@ public: TRilevamento_ore(const TRectype& rec); TRilevamento_ore(const TRilevamento_ore& rilore); + TRilevamento_ore(const char tipo, const char tipora, const char* codice, const int anno, const char* mese, const char* tpora, const char* codcosto, const char* codcms, const char* codfase); TRilevamento_ore(const char tipo, const char tipora, const char* codice, const int anno, const char* mese, const char* tpora); TRilevamento_ore(const char tipo, const char* codcosto, const char* codcms, const char* codfase); TRilevamento_ore(); diff --git a/ci/f125.trr b/ci/f125.trr index 62bda99bc..df6d45572 100755 --- a/ci/f125.trr +++ b/ci/f125.trr @@ -13,6 +13,7 @@ DADATA|5|8|0|Data Inizio ADATA|5|8|0|Data Fine QTAORE|2|4|0|Quantita' ora COSTO|4|10|2|Costo Unitario -2 -TIPO+TIPORA+CODICE+ANNO+MESE+TPORA| -TIPO+CODCOSTO+CODCMS+CODFASE| +3 +TIPO+TIPORA+CODICE+ANNO+MESE+TPORA+CODCOSTO+CODCMS+CODFASE| +TIPO+TIPORA+CODICE+ANNO+MESE+TPORA|X +TIPO+CODCOSTO+CODCMS+CODFASE|X