Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/branches/R_10_00@21569 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca83 2011-02-02 11:47:26 +00:00
parent 85f0696188
commit e3b1c64f21
5 changed files with 1255 additions and 3 deletions

View File

@ -8,6 +8,7 @@ int main(int argc, char** argv)
{
case 0 : ci2100(argc,argv); break; // Rilevamento preventivi
case 1 : ci2200(argc,argv); break; // Rilevamento consuntivo
case 2 : ci2300(argc,argv); break; // Importatore da TeamSystem
default: ci2100(argc,argv); break; // Rilevamento preventivi
}
return 0;

View File

@ -1,7 +1,8 @@
#ifndef __CI0_H
#define __CI0_H
#ifndef __CI2_H
#define __CI2_H
int ci2100(int argc, char* argv[]); // Rilevamento preventivi
int ci2200(int argc, char* argv[]); // Rilevamento consuntivi
int ci2300(int argc, char* argv[]); // Rilevamento consuntivi
#endif // __CI0_H
#endif // __CI2_H

644
ci/ci2300.cpp Executable file
View File

@ -0,0 +1,644 @@
#include <applicat.h>
#include <automask.h>
#include <colors.h>
#include <defmask.h>
#include <recset.h>
#include <sheet.h>
#include <textset.h>
#include <utility.h>
#include <doc.h>
#include "ci2.h"
#include "cilib.h"
#include "ci2300a.h"
#include "rilore.h"
#include "../ca/calib01.h"
#include "../ve/velib.h"
#define T_N "N"
#define T_X "X"
class TImporta_recordset : public TAS400_recordset
{
public:
void add_field(const char* name, const char* tipo, int pos, int len);
TImporta_recordset(const int rec_length);
};
//ADD_FIELD: aggiunge i campi al recordset
void TImporta_recordset::add_field(const char* name, const char* tipo, int pos, int len)
{
//CHECK(name[1]=='.', "Campo orfano di tracciato");
const TFixed_string str_tipo(tipo);
TFieldtypes ft = _alfafld;
if (str_tipo.ends_with("N"))
ft = _intzerofld;
create_field(name, -1, len, ft);
}
//costruttore
TImporta_recordset::TImporta_recordset(const int rec_lenght)
: TAS400_recordset("AS400()")
{
TString16 query;
query << "AS400(" << rec_lenght << ")";
TFilename cazzone;
parse_query(query, cazzone);
}
//Classe TImporta_fat_rec
class TImporta_rilore_rec : public TImporta_recordset
{
protected:
virtual TRecnotype new_rec(const char* trc);
public:
TImporta_rilore_rec(const TFilename& filename);
};
/////////////////////////////////////////////////////////////
// Recordset specifici per i dati da trasferire INPUT
/////////////////////////////////////////////////////////////
TRecnotype TImporta_rilore_rec::new_rec(const char* trc)
{
if (trc && *trc > ' ')
{
TString rec; rec << trc << "\r\n";
return TText_recordset::new_rec(rec);
}
return -1;
}
//questo invece è il metodo magico che vale per il caricamento da file esterno
TImporta_rilore_rec::TImporta_rilore_rec(const TFilename& filename)
: TImporta_recordset(1707)
{
TFilename cazzone;
parse_query("AS400(1707)", cazzone);
add_field("CODAZI", T_N, -1, 4);
add_field("CODFIL", T_N, -1, 2);
add_field("MATR", T_N, -1, 9);
add_field("COGNOME", T_X, -1, 34);
add_field("NOME", T_X, -1, 34);
add_field("DADATA", T_X, -1, 6);
add_field("ADATA", T_X, -1, 6);
add_field("01_OREORD", T_N, -1, 4);
add_field("01_CODGIU1", T_N, -1, 4);
add_field("01_OREGIU1", T_N, -1, 4);
add_field("01_CODGIU2", T_N, -1, 4);
add_field("01_OREGIU2", T_N, -1, 4);
add_field("01_CODGIU3", T_N, -1, 4);
add_field("01_OREGIU3", T_N, -1, 4);
add_field("01_CODGIU4", T_N, -1, 4);
add_field("01_OREGIU4", T_N, -1, 4);
add_field("01_CODGIU5", T_N, -1, 4);
add_field("01_OREGIU5", T_N, -1, 4);
add_field("01_CODGIU6", T_N, -1, 4);
add_field("01_OREGIU6", T_N, -1, 4);
add_field("02_OREORD", T_N, -1, 4);
add_field("02_CODGIU1", T_N, -1, 4);
add_field("02_OREGIU1", T_N, -1, 4);
add_field("02_CODGIU2", T_N, -1, 4);
add_field("02_OREGIU2", T_N, -1, 4);
add_field("02_CODGIU3", T_N, -1, 4);
add_field("02_OREGIU3", T_N, -1, 4);
add_field("02_CODGIU4", T_N, -1, 4);
add_field("02_OREGIU4", T_N, -1, 4);
add_field("02_CODGIU5", T_N, -1, 4);
add_field("02_OREGIU5", T_N, -1, 4);
add_field("02_CODGIU6", T_N, -1, 4);
add_field("02_OREGIU6", T_N, -1, 4);
add_field("03_OREORD", T_N, -1, 4);
add_field("03_CODGIU1", T_N, -1, 4);
add_field("03_OREGIU1", T_N, -1, 4);
add_field("03_CODGIU2", T_N, -1, 4);
add_field("03_OREGIU2", T_N, -1, 4);
add_field("03_CODGIU3", T_N, -1, 4);
add_field("03_OREGIU3", T_N, -1, 4);
add_field("03_CODGIU4", T_N, -1, 4);
add_field("03_OREGIU4", T_N, -1, 4);
add_field("03_CODGIU5", T_N, -1, 4);
add_field("03_OREGIU5", T_N, -1, 4);
add_field("03_CODGIU6", T_N, -1, 4);
add_field("03_OREGIU6", T_N, -1, 4);
add_field("04_OREORD", T_N, -1, 4);
add_field("04_CODGIU1", T_N, -1, 4);
add_field("04_OREGIU1", T_N, -1, 4);
add_field("04_CODGIU2", T_N, -1, 4);
add_field("04_OREGIU2", T_N, -1, 4);
add_field("04_CODGIU3", T_N, -1, 4);
add_field("04_OREGIU3", T_N, -1, 4);
add_field("04_CODGIU4", T_N, -1, 4);
add_field("04_OREGIU4", T_N, -1, 4);
add_field("04_CODGIU5", T_N, -1, 4);
add_field("04_OREGIU5", T_N, -1, 4);
add_field("04_CODGIU6", T_N, -1, 4);
add_field("04_OREGIU6", T_N, -1, 4);
add_field("05_OREORD", T_N, -1, 4);
add_field("05_CODGIU1", T_N, -1, 4);
add_field("05_OREGIU1", T_N, -1, 4);
add_field("05_CODGIU2", T_N, -1, 4);
add_field("05_OREGIU2", T_N, -1, 4);
add_field("05_CODGIU3", T_N, -1, 4);
add_field("05_OREGIU3", T_N, -1, 4);
add_field("05_CODGIU4", T_N, -1, 4);
add_field("05_OREGIU4", T_N, -1, 4);
add_field("05_CODGIU5", T_N, -1, 4);
add_field("05_OREGIU5", T_N, -1, 4);
add_field("05_CODGIU6", T_N, -1, 4);
add_field("05_OREGIU6", T_N, -1, 4);
add_field("06_OREORD", T_N, -1, 4);
add_field("06_CODGIU1", T_N, -1, 4);
add_field("06_OREGIU1", T_N, -1, 4);
add_field("06_CODGIU2", T_N, -1, 4);
add_field("06_OREGIU2", T_N, -1, 4);
add_field("06_CODGIU3", T_N, -1, 4);
add_field("06_OREGIU3", T_N, -1, 4);
add_field("06_CODGIU4", T_N, -1, 4);
add_field("06_OREGIU4", T_N, -1, 4);
add_field("06_CODGIU5", T_N, -1, 4);
add_field("06_OREGIU5", T_N, -1, 4);
add_field("06_CODGIU6", T_N, -1, 4);
add_field("06_OREGIU6", T_N, -1, 4);
add_field("07_OREORD", T_N, -1, 4);
add_field("07_CODGIU1", T_N, -1, 4);
add_field("07_OREGIU1", T_N, -1, 4);
add_field("07_CODGIU2", T_N, -1, 4);
add_field("07_OREGIU2", T_N, -1, 4);
add_field("07_CODGIU3", T_N, -1, 4);
add_field("07_OREGIU3", T_N, -1, 4);
add_field("07_CODGIU4", T_N, -1, 4);
add_field("07_OREGIU4", T_N, -1, 4);
add_field("07_CODGIU5", T_N, -1, 4);
add_field("07_OREGIU5", T_N, -1, 4);
add_field("07_CODGIU6", T_N, -1, 4);
add_field("07_OREGIU6", T_N, -1, 4);
add_field("08_OREORD", T_N, -1, 4);
add_field("08_CODGIU1", T_N, -1, 4);
add_field("08_OREGIU1", T_N, -1, 4);
add_field("08_CODGIU2", T_N, -1, 4);
add_field("08_OREGIU2", T_N, -1, 4);
add_field("08_CODGIU3", T_N, -1, 4);
add_field("08_OREGIU3", T_N, -1, 4);
add_field("08_CODGIU4", T_N, -1, 4);
add_field("08_OREGIU4", T_N, -1, 4);
add_field("08_CODGIU5", T_N, -1, 4);
add_field("08_OREGIU5", T_N, -1, 4);
add_field("08_CODGIU6", T_N, -1, 4);
add_field("08_OREGIU6", T_N, -1, 4);
add_field("09_OREORD", T_N, -1, 4);
add_field("09_CODGIU1", T_N, -1, 4);
add_field("09_OREGIU1", T_N, -1, 4);
add_field("09_CODGIU2", T_N, -1, 4);
add_field("09_OREGIU2", T_N, -1, 4);
add_field("09_CODGIU3", T_N, -1, 4);
add_field("09_OREGIU3", T_N, -1, 4);
add_field("09_CODGIU4", T_N, -1, 4);
add_field("09_OREGIU4", T_N, -1, 4);
add_field("09_CODGIU5", T_N, -1, 4);
add_field("09_OREGIU5", T_N, -1, 4);
add_field("09_CODGIU6", T_N, -1, 4);
add_field("09_OREGIU6", T_N, -1, 4);
add_field("10_OREORD", T_N, -1, 4);
add_field("10_CODGIU1", T_N, -1, 4);
add_field("10_OREGIU1", T_N, -1, 4);
add_field("10_CODGIU2", T_N, -1, 4);
add_field("10_OREGIU2", T_N, -1, 4);
add_field("10_CODGIU3", T_N, -1, 4);
add_field("10_OREGIU3", T_N, -1, 4);
add_field("10_CODGIU4", T_N, -1, 4);
add_field("10_OREGIU4", T_N, -1, 4);
add_field("10_CODGIU5", T_N, -1, 4);
add_field("10_OREGIU5", T_N, -1, 4);
add_field("10_CODGIU6", T_N, -1, 4);
add_field("10_OREGIU6", T_N, -1, 4);
add_field("11_OREORD", T_N, -1, 4);
add_field("11_CODGIU1", T_N, -1, 4);
add_field("11_OREGIU1", T_N, -1, 4);
add_field("11_CODGIU2", T_N, -1, 4);
add_field("11_OREGIU2", T_N, -1, 4);
add_field("11_CODGIU3", T_N, -1, 4);
add_field("11_OREGIU3", T_N, -1, 4);
add_field("11_CODGIU4", T_N, -1, 4);
add_field("11_OREGIU4", T_N, -1, 4);
add_field("11_CODGIU5", T_N, -1, 4);
add_field("11_OREGIU5", T_N, -1, 4);
add_field("11_CODGIU6", T_N, -1, 4);
add_field("11_OREGIU6", T_N, -1, 4);
add_field("12_OREORD", T_N, -1, 4);
add_field("12_CODGIU1", T_N, -1, 4);
add_field("12_OREGIU1", T_N, -1, 4);
add_field("12_CODGIU2", T_N, -1, 4);
add_field("12_OREGIU2", T_N, -1, 4);
add_field("12_CODGIU3", T_N, -1, 4);
add_field("12_OREGIU3", T_N, -1, 4);
add_field("12_CODGIU4", T_N, -1, 4);
add_field("12_OREGIU4", T_N, -1, 4);
add_field("12_CODGIU5", T_N, -1, 4);
add_field("12_OREGIU5", T_N, -1, 4);
add_field("12_CODGIU6", T_N, -1, 4);
add_field("12_OREGIU6", T_N, -1, 4);
add_field("13_OREORD", T_N, -1, 4);
add_field("13_CODGIU1", T_N, -1, 4);
add_field("13_OREGIU1", T_N, -1, 4);
add_field("13_CODGIU2", T_N, -1, 4);
add_field("13_OREGIU2", T_N, -1, 4);
add_field("13_CODGIU3", T_N, -1, 4);
add_field("13_OREGIU3", T_N, -1, 4);
add_field("13_CODGIU4", T_N, -1, 4);
add_field("13_OREGIU4", T_N, -1, 4);
add_field("13_CODGIU5", T_N, -1, 4);
add_field("13_OREGIU5", T_N, -1, 4);
add_field("13_CODGIU6", T_N, -1, 4);
add_field("13_OREGIU6", T_N, -1, 4);
add_field("14_OREORD", T_N, -1, 4);
add_field("14_CODGIU1", T_N, -1, 4);
add_field("14_OREGIU1", T_N, -1, 4);
add_field("14_CODGIU2", T_N, -1, 4);
add_field("14_OREGIU2", T_N, -1, 4);
add_field("14_CODGIU3", T_N, -1, 4);
add_field("14_OREGIU3", T_N, -1, 4);
add_field("14_CODGIU4", T_N, -1, 4);
add_field("14_OREGIU4", T_N, -1, 4);
add_field("14_CODGIU5", T_N, -1, 4);
add_field("14_OREGIU5", T_N, -1, 4);
add_field("14_CODGIU6", T_N, -1, 4);
add_field("14_OREGIU6", T_N, -1, 4);
add_field("15_OREORD", T_N, -1, 4);
add_field("15_CODGIU1", T_N, -1, 4);
add_field("15_OREGIU1", T_N, -1, 4);
add_field("15_CODGIU2", T_N, -1, 4);
add_field("15_OREGIU2", T_N, -1, 4);
add_field("15_CODGIU3", T_N, -1, 4);
add_field("15_OREGIU3", T_N, -1, 4);
add_field("15_CODGIU4", T_N, -1, 4);
add_field("15_OREGIU4", T_N, -1, 4);
add_field("15_CODGIU5", T_N, -1, 4);
add_field("15_OREGIU5", T_N, -1, 4);
add_field("15_CODGIU6", T_N, -1, 4);
add_field("15_OREGIU6", T_N, -1, 4);
add_field("16_OREORD", T_N, -1, 4);
add_field("16_CODGIU1", T_N, -1, 4);
add_field("16_OREGIU1", T_N, -1, 4);
add_field("16_CODGIU2", T_N, -1, 4);
add_field("16_OREGIU2", T_N, -1, 4);
add_field("16_CODGIU3", T_N, -1, 4);
add_field("16_OREGIU3", T_N, -1, 4);
add_field("16_CODGIU4", T_N, -1, 4);
add_field("16_OREGIU4", T_N, -1, 4);
add_field("16_CODGIU5", T_N, -1, 4);
add_field("16_OREGIU5", T_N, -1, 4);
add_field("16_CODGIU6", T_N, -1, 4);
add_field("16_OREGIU6", T_N, -1, 4);
add_field("17_OREORD", T_N, -1, 4);
add_field("17_CODGIU1", T_N, -1, 4);
add_field("17_OREGIU1", T_N, -1, 4);
add_field("17_CODGIU2", T_N, -1, 4);
add_field("17_OREGIU2", T_N, -1, 4);
add_field("17_CODGIU3", T_N, -1, 4);
add_field("17_OREGIU3", T_N, -1, 4);
add_field("17_CODGIU4", T_N, -1, 4);
add_field("17_OREGIU4", T_N, -1, 4);
add_field("17_CODGIU5", T_N, -1, 4);
add_field("17_OREGIU5", T_N, -1, 4);
add_field("17_CODGIU6", T_N, -1, 4);
add_field("17_OREGIU6", T_N, -1, 4);
add_field("18_OREORD", T_N, -1, 4);
add_field("18_CODGIU1", T_N, -1, 4);
add_field("18_OREGIU1", T_N, -1, 4);
add_field("18_CODGIU2", T_N, -1, 4);
add_field("18_OREGIU2", T_N, -1, 4);
add_field("18_CODGIU3", T_N, -1, 4);
add_field("18_OREGIU3", T_N, -1, 4);
add_field("18_CODGIU4", T_N, -1, 4);
add_field("18_OREGIU4", T_N, -1, 4);
add_field("18_CODGIU5", T_N, -1, 4);
add_field("18_OREGIU5", T_N, -1, 4);
add_field("18_CODGIU6", T_N, -1, 4);
add_field("18_OREGIU6", T_N, -1, 4);
add_field("19_OREORD", T_N, -1, 4);
add_field("19_CODGIU1", T_N, -1, 4);
add_field("19_OREGIU1", T_N, -1, 4);
add_field("19_CODGIU2", T_N, -1, 4);
add_field("19_OREGIU2", T_N, -1, 4);
add_field("19_CODGIU3", T_N, -1, 4);
add_field("19_OREGIU3", T_N, -1, 4);
add_field("19_CODGIU4", T_N, -1, 4);
add_field("19_OREGIU4", T_N, -1, 4);
add_field("19_CODGIU5", T_N, -1, 4);
add_field("19_OREGIU5", T_N, -1, 4);
add_field("19_CODGIU6", T_N, -1, 4);
add_field("19_OREGIU6", T_N, -1, 4);
add_field("20_OREORD", T_N, -1, 4);
add_field("20_CODGIU1", T_N, -1, 4);
add_field("20_OREGIU1", T_N, -1, 4);
add_field("20_CODGIU2", T_N, -1, 4);
add_field("20_OREGIU2", T_N, -1, 4);
add_field("20_CODGIU3", T_N, -1, 4);
add_field("20_OREGIU3", T_N, -1, 4);
add_field("20_CODGIU4", T_N, -1, 4);
add_field("20_OREGIU4", T_N, -1, 4);
add_field("20_CODGIU5", T_N, -1, 4);
add_field("20_OREGIU5", T_N, -1, 4);
add_field("20_CODGIU6", T_N, -1, 4);
add_field("20_OREGIU6", T_N, -1, 4);
add_field("21_OREORD", T_N, -1, 4);
add_field("21_CODGIU1", T_N, -1, 4);
add_field("21_OREGIU1", T_N, -1, 4);
add_field("21_CODGIU2", T_N, -1, 4);
add_field("21_OREGIU2", T_N, -1, 4);
add_field("21_CODGIU3", T_N, -1, 4);
add_field("21_OREGIU3", T_N, -1, 4);
add_field("21_CODGIU4", T_N, -1, 4);
add_field("21_OREGIU4", T_N, -1, 4);
add_field("21_CODGIU5", T_N, -1, 4);
add_field("21_OREGIU5", T_N, -1, 4);
add_field("21_CODGIU6", T_N, -1, 4);
add_field("21_OREGIU6", T_N, -1, 4);
add_field("22_OREORD", T_N, -1, 4);
add_field("22_CODGIU1", T_N, -1, 4);
add_field("22_OREGIU1", T_N, -1, 4);
add_field("22_CODGIU2", T_N, -1, 4);
add_field("22_OREGIU2", T_N, -1, 4);
add_field("22_CODGIU3", T_N, -1, 4);
add_field("22_OREGIU3", T_N, -1, 4);
add_field("22_CODGIU4", T_N, -1, 4);
add_field("22_OREGIU4", T_N, -1, 4);
add_field("22_CODGIU5", T_N, -1, 4);
add_field("22_OREGIU5", T_N, -1, 4);
add_field("22_CODGIU6", T_N, -1, 4);
add_field("22_OREGIU6", T_N, -1, 4);
add_field("23_OREORD", T_N, -1, 4);
add_field("23_CODGIU1", T_N, -1, 4);
add_field("23_OREGIU1", T_N, -1, 4);
add_field("23_CODGIU2", T_N, -1, 4);
add_field("23_OREGIU2", T_N, -1, 4);
add_field("23_CODGIU3", T_N, -1, 4);
add_field("23_OREGIU3", T_N, -1, 4);
add_field("23_CODGIU4", T_N, -1, 4);
add_field("23_OREGIU4", T_N, -1, 4);
add_field("23_CODGIU5", T_N, -1, 4);
add_field("23_OREGIU5", T_N, -1, 4);
add_field("23_CODGIU6", T_N, -1, 4);
add_field("23_OREGIU6", T_N, -1, 4);
add_field("24_OREORD", T_N, -1, 4);
add_field("24_CODGIU1", T_N, -1, 4);
add_field("24_OREGIU1", T_N, -1, 4);
add_field("24_CODGIU2", T_N, -1, 4);
add_field("24_OREGIU2", T_N, -1, 4);
add_field("24_CODGIU3", T_N, -1, 4);
add_field("24_OREGIU3", T_N, -1, 4);
add_field("24_CODGIU4", T_N, -1, 4);
add_field("24_OREGIU4", T_N, -1, 4);
add_field("24_CODGIU5", T_N, -1, 4);
add_field("24_OREGIU5", T_N, -1, 4);
add_field("24_CODGIU6", T_N, -1, 4);
add_field("24_OREGIU6", T_N, -1, 4);
add_field("25_OREORD", T_N, -1, 4);
add_field("25_CODGIU1", T_N, -1, 4);
add_field("25_OREGIU1", T_N, -1, 4);
add_field("25_CODGIU2", T_N, -1, 4);
add_field("25_OREGIU2", T_N, -1, 4);
add_field("25_CODGIU3", T_N, -1, 4);
add_field("25_OREGIU3", T_N, -1, 4);
add_field("25_CODGIU4", T_N, -1, 4);
add_field("25_OREGIU4", T_N, -1, 4);
add_field("25_CODGIU5", T_N, -1, 4);
add_field("25_OREGIU5", T_N, -1, 4);
add_field("25_CODGIU6", T_N, -1, 4);
add_field("25_OREGIU6", T_N, -1, 4);
add_field("26_OREORD", T_N, -1, 4);
add_field("26_CODGIU1", T_N, -1, 4);
add_field("26_OREGIU1", T_N, -1, 4);
add_field("26_CODGIU2", T_N, -1, 4);
add_field("26_OREGIU2", T_N, -1, 4);
add_field("26_CODGIU3", T_N, -1, 4);
add_field("26_OREGIU3", T_N, -1, 4);
add_field("26_CODGIU4", T_N, -1, 4);
add_field("26_OREGIU4", T_N, -1, 4);
add_field("26_CODGIU5", T_N, -1, 4);
add_field("26_OREGIU5", T_N, -1, 4);
add_field("26_CODGIU6", T_N, -1, 4);
add_field("26_OREGIU6", T_N, -1, 4);
add_field("27_OREORD", T_N, -1, 4);
add_field("27_CODGIU1", T_N, -1, 4);
add_field("27_OREGIU1", T_N, -1, 4);
add_field("27_CODGIU2", T_N, -1, 4);
add_field("27_OREGIU2", T_N, -1, 4);
add_field("27_CODGIU3", T_N, -1, 4);
add_field("27_OREGIU3", T_N, -1, 4);
add_field("27_CODGIU4", T_N, -1, 4);
add_field("27_OREGIU4", T_N, -1, 4);
add_field("27_CODGIU5", T_N, -1, 4);
add_field("27_OREGIU5", T_N, -1, 4);
add_field("27_CODGIU6", T_N, -1, 4);
add_field("27_OREGIU6", T_N, -1, 4);
add_field("28_OREORD", T_N, -1, 4);
add_field("28_CODGIU1", T_N, -1, 4);
add_field("28_OREGIU1", T_N, -1, 4);
add_field("28_CODGIU2", T_N, -1, 4);
add_field("28_OREGIU2", T_N, -1, 4);
add_field("28_CODGIU3", T_N, -1, 4);
add_field("28_OREGIU3", T_N, -1, 4);
add_field("28_CODGIU4", T_N, -1, 4);
add_field("28_OREGIU4", T_N, -1, 4);
add_field("28_CODGIU5", T_N, -1, 4);
add_field("28_OREGIU5", T_N, -1, 4);
add_field("28_CODGIU6", T_N, -1, 4);
add_field("28_OREGIU6", T_N, -1, 4);
add_field("29_OREORD", T_N, -1, 4);
add_field("29_CODGIU1", T_N, -1, 4);
add_field("29_OREGIU1", T_N, -1, 4);
add_field("29_CODGIU2", T_N, -1, 4);
add_field("29_OREGIU2", T_N, -1, 4);
add_field("29_CODGIU3", T_N, -1, 4);
add_field("29_OREGIU3", T_N, -1, 4);
add_field("29_CODGIU4", T_N, -1, 4);
add_field("29_OREGIU4", T_N, -1, 4);
add_field("29_CODGIU5", T_N, -1, 4);
add_field("29_OREGIU5", T_N, -1, 4);
add_field("29_CODGIU6", T_N, -1, 4);
add_field("29_OREGIU6", T_N, -1, 4);
add_field("30_OREORD", T_N, -1, 4);
add_field("30_CODGIU1", T_N, -1, 4);
add_field("30_OREGIU1", T_N, -1, 4);
add_field("30_CODGIU2", T_N, -1, 4);
add_field("30_OREGIU2", T_N, -1, 4);
add_field("30_CODGIU3", T_N, -1, 4);
add_field("30_OREGIU3", T_N, -1, 4);
add_field("30_CODGIU4", T_N, -1, 4);
add_field("30_OREGIU4", T_N, -1, 4);
add_field("30_CODGIU5", T_N, -1, 4);
add_field("30_OREGIU5", T_N, -1, 4);
add_field("30_CODGIU6", T_N, -1, 4);
add_field("30_OREGIU6", T_N, -1, 4);
add_field("31_OREORD", T_N, -1, 4);
add_field("31_CODGIU1", T_N, -1, 4);
add_field("31_OREGIU1", T_N, -1, 4);
add_field("31_CODGIU2", T_N, -1, 4);
add_field("31_OREGIU2", T_N, -1, 4);
add_field("31_CODGIU3", T_N, -1, 4);
add_field("31_OREGIU3", T_N, -1, 4);
add_field("31_CODGIU4", T_N, -1, 4);
add_field("31_OREGIU4", T_N, -1, 4);
add_field("31_CODGIU5", T_N, -1, 4);
add_field("31_OREGIU5", T_N, -1, 4);
add_field("31_CODGIU6", T_N, -1, 4);
add_field("31_OREGIU6", T_N, -1, 4);
TText_recordset::load_file(filename);
}
////////////////////////////////////////////
//// CLASSE TImporta_rilore_msk ////
////////////////////////////////////////////
//Classe TRilevamento_imp_msk
class TImporta_rilore_msk : public TAutomask
{
protected:
const real proponi_costo(TToken_string& riga);
void importa();
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
public:
TImporta_rilore_msk();
};
const real TImporta_rilore_msk::proponi_costo(TToken_string& riga)
{
/*real costo = ZERO;
TSheet_field& sheet = sfield(F_SHEET);
const char tipo = riga.get_char(sheet.cid2index(S_RISOATT));
TString80 codice;
switch(tipo)
{
case 'R': codice = riga.get(sheet.cid2index(S_CODRIS)); break;
case 'A': codice = riga.get(sheet.cid2index(S_CODATT)); break;
default : break;
}
const int anno = get_int(F_ANNO);
const TString4 mese = get(F_MESE);
const TString4 tpora = riga.get(sheet.cid2index(S_TPORA));
const TRisoatt_key chiave(tipo, codice, anno, mese, tpora);
const TRectype & roa = cache().get("&ROA", chiave);
if(!roa.empty())
costo = roa.get_real("R1");
else
{
TString8 tmp; tmp << anno << mese;
const long anme = atol(tmp);
TString query;
query << "USE &ROA\n"
<< "SELECT I0<" << anme << "\n"
<< "FROM CODTAB=" << tipo << codice.left_just(16) << "\n"
<< "TO CODTAB=" << tipo << codice.left_just(16) << "\n"
<< "BY I0\n";
TISAM_recordset rec(query);
if(rec.move_last())
costo = rec.cursor()->curr().get_real("R1");
}
return costo;*/
return ZERO;
}
void TImporta_rilore_msk::importa()
{
TFilename file = get(F_FILE);
TImporta_rilore_rec recordset(file);
TLocalisamfile rilore(LF_RILORE);
rilore.put(RILORE_TIPO, 'C');
rilore.put(RILORE_TIPORA, 'A');
rilore.put(RILORE_CODICE, recordset.get("MATR").as_string());
TString8 data = recordset.get("DADATA").as_string();
TString4 anno = "20"; anno << data.right(2);
const TDate dadata(atoi(data.left(2)), atoi(data.mid(2, 2)), atoi(anno));
data = recordset.get("ADATA").as_string();
anno = "20"; anno << data.right(2);
const TDate adata(atoi(data.left(2)), atoi(data.mid(2, 2)), atoi(anno));
}
//ON_FIELD_EVENT: metodo che gestisce gli eventi sui vari campi della maschera
bool TImporta_rilore_msk::on_field_event(TOperable_field& f, TField_event e, long jolly)
{
switch (f.dlg())
{
default: break;
}
return true;
}
TImporta_rilore_rec::TImporta_rilore_rec()
: TAutomask("ci2300a")
{
}
////////////////////////////////////////////
//// CLASSE TRilevamento_imp_app ////
////////////////////////////////////////////
//classe TRilevamento_imp_app
class TRilevamento_imp_app : public TSkeleton_application
{
public:
virtual void main_loop();
};
void TRilevamento_imp_app::main_loop()
{
TRilevamento_imp_msk msk;
while (msk.run() != K_QUIT) ;
}
int ci2300(int argc, char *argv[])
{
TRilevamento_imp_app a;
a.run (argc, argv, TR("Importazione Ore"));
return TRUE;
}

77
ci/ci2300a.h Executable file
View File

@ -0,0 +1,77 @@
//Campi maschera ci2300a
#define F_ANNO 301
#define F_MESE 302
#define F_TPORA 303
#define F_RISOATT 304
#define F_CODICE 305
#define F_CODRIS 306
#define F_DESRIS 307
#define F_CODATT 308
#define F_DESATT 309
#define F_CODCOSTO 310
#define F_CODCMS 311
#define F_CODFASE 312
#define F_CALENDARIO 313
#define F_ANAL 314
#define F_SHEET 330
#define DLG_RESET 900
#define DLG_CERCA 901
#define DLG_DEFAULT 902
#define C_0 100
#define C_1 101
#define C_2 102
#define C_3 103
#define C_4 104
#define C_5 105
#define C_6 106
#define C_7 107
#define C_8 108
#define C_9 109
#define C_10 110
#define C_11 111
#define C_12 112
#define C_13 113
#define C_14 114
#define C_15 115
#define C_16 116
#define C_17 117
#define C_18 118
#define C_19 119
#define C_20 120
#define C_21 121
#define C_22 122
#define C_23 123
#define C_24 124
#define C_25 125
#define C_26 126
#define C_27 127
#define C_28 128
#define C_29 129
#define C_30 130
#define C_31 131
#define ID2DAY(ID) (ID - C_0)
#define DAY2ID(DAY) (C_0 + DAY)
#define S_RISOATT 101
#define S_CODRIS 102
#define S_DESRIS 119
#define S_CODATT 202
#define S_DESATT 219
#define S_TPORA 103
#define S_CDC1 104
#define S_CDC2 105
#define S_CDC3 106
#define S_CDC4 107
#define S_CDC5 108
#define S_CDC6 109
#define S_CDC7 110
#define S_CDC8 111
#define S_CDC9 112
#define S_CDC10 113
#define S_CDC11 114
#define S_CDC12 115
#define S_QTAORE 116
#define S_COSTO 117
#define S_OREDIS 118

529
ci/ci2300a.uml Executable file
View File

@ -0,0 +1,529 @@
#include "ci2300a.h"
TOOLBAR "topbar" 0 0 0 2
BUTTON DLG_DEFAULT
BEGIN
PROMPT 1 1 "Default"
PICTURE TOOL_SMILE
END
BUTTON DLG_CERCA
BEGIN
PROMPT 1 1 "Cerca"
PICTURE TOOL_FINDREC
END
BUTTON DLG_SAVEREC 2 2
BEGIN
PROMPT 1 1 "Salva"
PICTURE TOOL_SAVEREC
END
BUTTON DLG_RESET 2 2
BEGIN
PROMPT 1 1 "Azzera"
PICTURE TOOL_RESET
END
#include <helpbar.h>
ENDPAGE
PAGE "Rilevazione consuntivi" 0 2 0 0
GROUPBOX DLG_NULL 78 7
BEGIN
PROMPT 1 0 "@bSelezione"
END
NUMBER F_ANNO 4
BEGIN
PROMPT 2 1 "Anno "
FLAGS "A"
CHECKTYPE REQUIRED
END
LISTBOX F_MESE 10
BEGIN
PROMPT 24 1 "Mese "
FLAGS "M"
END
STRING F_TPORA 2
BEGIN
PROMPT 44 1 "Tipo ora "
USE &ORE
INPUT CODTAB F_TPORA
DISPLAY "Codice@16" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_TPORA CODTAB
END
LISTBOX F_RISOATT 1 12
BEGIN
PROMPT 2 2 "@bTipo "
ITEM "T|Tutti"
MESSAGE SHOW,1@|HIDE,2@|HIDE,3@
ITEM "R|Risorsa"
MESSAGE HIDE,1@|SHOW,2@|HIDE,3@
ITEM "A|Attrezzatura"
MESSAGE HIDE,1@|HIDE,2@|SHOW,3@
FLAGS "Z"
END
STRING F_CODRIS 16
BEGIN
PROMPT 23 2 "Codice "
USE RSS
INPUT CODTAB F_CODRIS
DISPLAY "Codice@16" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_CODRIS CODTAB
OUTPUT F_DESRIS S0
GROUP 2
CHECKTYPE NORMAL
END
STRING F_DESRIS 50 27
BEGIN
PROMPT 50 2 ""
FLAGS "D"
GROUP 2
END
STRING F_CODATT 16
BEGIN
PROMPT 23 2 "Codice "
USE ATR
INPUT CODTAB F_CODATT
DISPLAY "Codice@16" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT F_CODATT CODTAB
OUTPUT F_DESATT S0
GROUP 3
CHECKTYPE NORMAL
END
STRING F_DESATT 50 27
BEGIN
PROMPT 50 27 ""
FLAGS "D"
GROUP 3
END
SPREADSHEET F_CALENDARIO -16 2
BEGIN
PROMPT 1 7 ""
ITEM "1@2"
ITEM "2@2"
ITEM "3@2"
ITEM "4@2"
ITEM "5@2"
ITEM "6@2"
ITEM "7@2"
ITEM "8@2"
ITEM "9@2"
ITEM "10"
ITEM "11"
ITEM "12"
ITEM "13"
ITEM "14"
ITEM "15"
ITEM "16"
ITEM "17"
ITEM "18"
ITEM "19"
ITEM "20"
ITEM "21"
ITEM "22"
ITEM "23"
ITEM "24"
ITEM "25"
ITEM "26"
ITEM "27"
ITEM "28"
ITEM "29"
ITEM "30"
ITEM "31"
END
SPREADSHEET F_SHEET -15 0
BEGIN
PROMPT 1 10 ""
ITEM "Tipo"
ITEM "Codice@16"
ITEM "Tipo\nOra@5"
ITEM "CDC1"
ITEM "CDC2"
ITEM "CDC3"
ITEM "CDC4"
ITEM "CDC5"
ITEM "CDC6"
ITEM "CDC7"
ITEM "CDC8"
ITEM "CDC9"
ITEM "CDC10"
ITEM "CDC11"
ITEM "CDC12"
ITEM "Qta\nOre@5"
ITEM "Costo@6"
ITEM "Ore\ndisponibilità"
ITEM "Descrizione@50"
END
ENDPAGE
ENDMASK
PAGE "Calendario" -1 -1 78 13
STRING C_1 1
BEGIN
PROMPT 2 4 " 1"
END
STRING C_2 1
BEGIN
PROMPT 6 4 " 2"
END
STRING C_3 1
BEGIN
PROMPT 10 4 " 3"
END
STRING C_4 1
BEGIN
PROMPT 14 4 " 4"
END
STRING C_5 1
BEGIN
PROMPT 18 4 " 5"
END
STRING C_6 1
BEGIN
PROMPT 22 4 " 6"
END
STRING C_7 1
BEGIN
PROMPT 26 4 " 7"
END
STRING C_8 1
BEGIN
PROMPT 30 4 " 8"
END
STRING C_9 1
BEGIN
PROMPT 34 4 " 9"
END
STRING C_10 1
BEGIN
PROMPT 38 4 "10"
END
STRING C_11 1
BEGIN
PROMPT 42 4 "11"
END
STRING C_12 1
BEGIN
PROMPT 46 4 "12"
END
STRING C_13 1
BEGIN
PROMPT 50 4 "13"
END
STRING C_14 1
BEGIN
PROMPT 54 4 "14"
END
STRING C_15 1
BEGIN
PROMPT 58 4 "15"
END
STRING C_16 1
BEGIN
PROMPT 62 4 "16"
END
STRING C_17 1
BEGIN
PROMPT 66 4 "17"
END
STRING C_18 1
BEGIN
PROMPT 70 4 "18"
END
STRING C_19 1
BEGIN
PROMPT 2 5 "19"
END
STRING C_20 1
BEGIN
PROMPT 6 5 "20"
END
STRING C_21 1
BEGIN
PROMPT 10 5 "21"
END
STRING C_22 1
BEGIN
PROMPT 14 5 "22"
END
STRING C_23 1
BEGIN
PROMPT 18 5 "23"
END
STRING C_24 1
BEGIN
PROMPT 22 5 "24"
END
STRING C_25 1
BEGIN
PROMPT 26 5 "25"
END
STRING C_26 1
BEGIN
PROMPT 30 5 "26"
END
STRING C_27 1
BEGIN
PROMPT 34 5 "27"
END
STRING C_28 1
BEGIN
PROMPT 38 5 "28"
END
STRING C_29 1
BEGIN
PROMPT 42 5 "29"
END
STRING C_30 1
BEGIN
PROMPT 46 5 "30"
END
STRING C_31 1
BEGIN
PROMPT 50 5 "31"
END
ENDPAGE
TOOLBAR "" 0 0 0 2
BUTTON DLG_CANCEL 2 2
BEGIN
PROMPT 4 1 "Annulla"
PICTURE TOOL_CANCEL
END
ENDPAGE
ENDMASK
PAGE "Riga consuntivo" -1 -1 78 13
GROUPBOX DLG_NULL 76 12
BEGIN
PROMPT 1 1 "@bRisorsa - Attrezzatura"
END
RADIOBUTTON S_RISOATT 1 74
BEGIN
PROMPT 2 2 "@bTipo: "
ITEM "R|Risorsa"
MESSAGE SHOW,1@|HIDE,2@|RESET,2@
ITEM "A|Attrezzatura"
MESSAGE HIDE,1@|SHOW,2@|RESET,1@
FLAGS "GZ"
END
STRING S_CODRIS 16
BEGIN
PROMPT 2 5 "Codice Risorsa "
USE RSS
INPUT CODTAB S_CODRIS
DISPLAY "Codice@16" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT S_CODRIS CODTAB
OUTPUT S_DESRIS S0
CHECKTYPE REQUIRED
FLAGS "G"
GROUP 1
CHECKTYPE REQUIRED
END
STRING S_DESRIS 50
BEGIN
PROMPT 2 6 "Descrizione "
CHECKTYPE NORMAL
GROUP 1
END
STRING S_CODATT 16
BEGIN
PROMPT 2 5 "Codice Attrezzatura "
USE ATR
INPUT CODTAB S_CODATT
DISPLAY "Codice@16" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT S_CODATT CODTAB
OUTPUT S_DESATT S0
CHECKTYPE REQUIRED
FLAGS "G"
GROUP 2
END
STRING S_DESATT 50
BEGIN
PROMPT 2 6 "Descrizione "
CHECKTYPE NORMAL
GROUP 2
END
STRING S_TPORA 2
BEGIN
PROMPT 59 7 "Tipo ora "
USE &ORE
INPUT CODTAB S_TPORA
DISPLAY "Codice@16" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT S_TPORA CODTAB
CHECKTYPE REQUIRED
END
STRING S_CDC1 20
BEGIN
PROMPT 2 8 "Cdc 1"
FLAGS "HB"
END
STRING S_CDC2 20
BEGIN
PROMPT 2 8 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC3 20
BEGIN
PROMPT 2 8 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC4 20
BEGIN
PROMPT 2 8 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC5 20
BEGIN
PROMPT 2 9 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC6 20
BEGIN
PROMPT 2 9 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC7 20
BEGIN
PROMPT 2 9 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC8 20
BEGIN
PROMPT 2 9 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC9 20
BEGIN
PROMPT 2 10 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC10 20
BEGIN
PROMPT 2 10 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC11 20
BEGIN
PROMPT 2 10 "Cdc 2"
FLAGS "HB"
END
STRING S_CDC12 20
BEGIN
PROMPT 2 10 "Cdc 2"
FLAGS "HB"
END
NUMBER S_QTAORE 6
BEGIN
PROMPT 2 11 "Quantità ore "
END
NUMBER S_COSTO 6 2
BEGIN
PROMPT 30 11 "Prezzo "
END
NUMBER S_OREDIS 6
BEGIN
PROMPT 50 11 "Quantità ore "
END
ENDPAGE
TOOLBAR "" 0 0 0 2
BUTTON DLG_OK 2 2
BEGIN
PROMPT 1 1 ""
END
BUTTON DLG_RESET 2 2
BEGIN
PROMPT 2 1 "Azzera"
MESSAGE RESET,S_QTAORE
PICTURE TOOL_RESET
END
BUTTON DLG_CANCEL 2 2
BEGIN
PROMPT 4 1 "Annulla"
PICTURE TOOL_CANCEL
END
ENDPAGE
ENDMASK