campo-sirio/lv/lvlib.h
alex 1f773d23aa Patch level : 10.0 164
Files correlati     : lv0.exe
Ricompilazione Demo : [ ]
Commento            :

Implementate le proposte di contratto con un flag sulla testata


git-svn-id: svn://10.65.10.50/trunk@17672 c028cbd2-c16b-5b4b-a496-9718f37d4682
2008-11-18 14:08:37 +00:00

123 lines
4.1 KiB
C++
Executable File

#ifndef __LVLIB_H
#define __LVLIB_H
#ifndef __RECSET_H
#include <recset.h>
#endif
#ifndef __MGLIB_H
#include "../mg/mglib.h"
#endif
void lv_set_creation_info(TRectype& rec);
void lv_set_update_info(TRectype& rec);
long lv_find_contract(const long codcf, const long indsped, const TDate& data);
class TLaundry_contract : public TRectype
{
public:
const TRectype& row(const char* codart) const;
virtual bool ok() const;
bool read(const long codcf, const long codcont);
bool read(const long codcf, const long indsped, const TDate& data);
TLaundry_contract();
TLaundry_contract(const long codcf, const long codcont);
TLaundry_contract(const long codcf, const long indsped, const TDate& data);
};
class TRecmag_lavanderie : public TVariable_rectype
{
real _dotin;
real _dotod;
real _dottm;
real _consanno;
real _consmese;
long _update_time;
protected:
virtual const TString & get_str(const char* fieldname) const ;
virtual void put_str(const char* fieldname, const char* val) { return TRectype::put_str(fieldname, val);}
void update();
public:
virtual int name2index(const char* fieldname) const;
virtual TFieldtypes type(const char* fieldname) const;
virtual int length(const char* fieldname) const;
virtual int ndec(const char* fieldname) const;
virtual bool exist(const char* fieldname) const;
virtual TObject* dup() const;
TRecmag_lavanderie();
TRecmag_lavanderie(const TRecmag_lavanderie & rec) : TVariable_rectype(rec), _update_time(0L) {}
virtual ~TRecmag_lavanderie() {}
};
class TArticolo_lavanderie : public TArticolo_giacenza_data
{
int _anno_lav;
char _tipocf;
long _codcf;
int _indsped;
protected:
// la get_str supporta anche la sintassi:
// #LF->fieldname
// #LF_par1->fieldname
// #LF_par1_par2->fieldname
// #LF_par1_par2_par3->fieldname
// dove:
// LF = numero logico del sottofile collegato (LF_UMART, LF_DESLIN, LF_CODCORR
// par1, par2, par3 = varie parti della chiave dell'indice del file collegato
// il numero di queste parti ed il loro valore dipende dal file collegato
// se parX comincia per # rappresenta il numero progressivo nell'indice
// fieldname = nome del campo nel file collegato
virtual const TString & get_str(const char* fieldname) const ;
virtual void set_body_key(TRectype & rowrec);
void set_anno_lav (int anno = 0);
void set_anno_lav (const char * anno) { set_anno_mag(atoi(anno)); }
virtual TRectype * new_body_record(int logicnum = 0);
public:
virtual TObject* dup() const { return new TArticolo_lavanderie(codice(), _tipocf, _codcf, _indsped); }
int find_clifomag(TRecord_array& rclifomag, const char * livello = NULL, int from = 0) const ;
int find_clifomag(int annoes, const char * livello = NULL, int from = 0) const ;
int find_clifomag(const char * annoes, const char * livello = NULL, int from = 0) const { return find_clifomag(atoi(annoes), livello, from); }
TRecord_array & clifomag(int annoes) const;
TRecord_array & clifomag(const char * annoes) const { return clifomag(atoi(annoes));}
void set_tipocf(char tipocf) { _tipocf = tipocf;}
void set_codcf(long codcf) { _codcf = codcf;}
void set_indsped(int indsped) { _indsped = indsped;}
TArticolo_lavanderie(const char* codice = NULL, const char tipocf = ' ', const long codcf = 0L, const int indsped = 0);
TArticolo_lavanderie(const TRectype& rec, const char tipocf = ' ', const long codcf = 0L, const int indsped = 0);
virtual ~TArticolo_lavanderie() {}
};
TArticolo_lavanderie& cached_article_laundry(const char * codart, const char tipocf, const long codcf, const int indsped);
class TLavanderie_calendar : public TObject
{
int _year;
TBit_array _days;
bool _dirty;
public:
int read(int year = 0);
int write() const;
int rewrite() const { return write(); }
int remove() const;
void set_holiday(const TDate& date, bool holiday = true);
void reset_holiday(const TDate& date) { set_holiday(date, false);}
bool is_holiday(const TDate& date) const;
TLavanderie_calendar(int year);
virtual ~TLavanderie_calendar() { }
};
#endif