From a36a5c61a34fad4029adb69d0427309da3d5379f Mon Sep 17 00:00:00 2001 From: luca Date: Thu, 24 Jan 2002 12:01:02 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:1.7=20?= =?UTF-8?q?004=20Files=20correlati=20=20=20=20=20:at8.exe=20Ricompilazione?= =?UTF-8?q?=20Demo=20:=20[=20]=20Commento=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20:eliminata=20la=20dataidoneit=C3=A1=20=3D=20dataacquisizione?= =?UTF-8?q?=20da=20winsit=20per=20i=20soggetti=20=09=09=09non=20donatori?= =?UTF-8?q?=20(avis=20BO)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/trunk@10026 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- at/at8800.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/at/at8800.cpp b/at/at8800.cpp index 17c39e14a..412f76c18 100755 --- a/at/at8800.cpp +++ b/at/at8800.cpp @@ -23,9 +23,9 @@ #define ATFILENAME "pippo.txt" -///////////////////////////////////////////////////// +//////////////////////////////////////////////////////// // Classe TCtbo2at_file customizzata dalla TFile_text // -///////////////////////////////////////////////////// +//////////////////////////////////////////////////////// class TCtbo2at_file: public TFile_text { @@ -68,9 +68,9 @@ int TCtbo2at_file::autosave(TRelation& rel, const TRecord_text& rec) bool vuoto = valore.blank(); if (valore[0] == '@') //se trovo il carattere @ -> azzero il campo valore.cut(0); - switch(tipo_campo) + switch(tipo_campo) //in base al tipo di campo formatta i valori seguendo le specifiche del tracciato { - case _datefld: + case _datefld: //tipo data... { if (real::is_null(valore)) { @@ -81,7 +81,7 @@ int TCtbo2at_file::autosave(TRelation& rel, const TRecord_text& rec) format_date(data, fpicture(tc), valore);//formatta la data secondo le specifiche del tracciato } break; - case _realfld: + case _realfld: //tipi numerici case _intfld: case _longfld: { @@ -213,7 +213,7 @@ bool TCtbo2at::test_donation(TRectype& recsog, const char* tipo, const TDate& da rec->put(DON_CODSEZ,recsog.get(SOG_CODSEZ)); rec->put(DON_CODSOT,recsog.get(SOG_CODSOT)); rec->put(DON_LUOGODON, luogodon); - if (r == 0) + if (r == 0) //puó essere una prima donazione... rec->put(DON_PRIMADON,"X"); donazioni.insert_row(rec); @@ -271,8 +271,8 @@ bool TCtbo2at::test_inter(TRectype& recsog, const char* tipo, const TDate& datad TRecord_array idoneita(LF_IDONEITA,IDO_PROGIDO); idoneita.read(key); - const int r = idoneita.last_row(); //se trova una data idoneita >= di quella in esame, quest'ultima - if (r > 0) //viene ignorata + const int r = idoneita.last_row(); //se trova una data idoneita >= di quella in esame, quest'ultima viene ignorata + if (r > 0) { const TRectype& lastido = idoneita[r]; if (lastido.get_date(IDO_DATAIDO) >= datadon) @@ -282,8 +282,8 @@ bool TCtbo2at::test_inter(TRectype& recsog, const char* tipo, const TDate& datad TRectype* rec = new TRectype(LF_IDONEITA); rec->put(IDO_CODICE, recsog.get(SOG_CODICE)); rec->put(IDO_PROGIDO, r+1); - rec->put(IDO_DATAIDO, datadon); - rec->put(IDO_TIPOIDO, stricmp(tipo, "SI") != 0 ? "AF" : "SI"); // Il mondo è bello perchè c'é l'AVIS + rec->put(IDO_DATAIDO, datadon); + rec->put(IDO_TIPOIDO, stricmp(tipo, "SI") != 0 ? "AF" : "SI"); // Il mondo è bello perchè c'é l'AVIS (tutte le donaz. non SI sono AF! mah?!) rec->put(IDO_IDO_SOS, "ID"); rec->put(IDO_INTERVALLO, inter); idoneita.add_row(rec); @@ -340,9 +340,10 @@ void TCtbo2at::transfer() str1.trim(); if (str != sogg.get(SOG_CODSEZ) && str != "01" && str1 == "") curr.add("@",1); - + + //esegue l'effettivo passaggio dati basandosi sulla formattazione del file .ini _trasfile->autosave(rel, curr); - //const long codsog = atol(curr.get(2)); + const char* tipo[] = { "SI", "PL", "PI", "PP" }; for (int i = 0; i < 4; i++) { @@ -363,11 +364,12 @@ void TCtbo2at::transfer() if (str == "IMOLA") str = "70"; update |= test_donation(sogg, tipo[i], datadon, str); - } - str = curr.get(27+i); - if (!real::is_null(str)) - { - update |= test_inter(sogg, tipo[i], datadon, atoi(str)); + //rimette a posto idoneitá ed intervalli vari...(lo fa solo per chi ha donato perché per gli altri non viene passata + //alcuna data... winsit del c...o!) + str = curr.get(27+i); + if (!real::is_null(str)) + update |= test_inter(sogg, tipo[i], datadon, atoi(str)); + } if (update) rel.rewrite();