campo-sirio/ve/ve0100.h
alex 4ab6a5be42 Aggiunta gestione dei magazzini standard
git-svn-id: svn://10.65.10.50/trunk@5149 c028cbd2-c16b-5b4b-a496-9718f37d4682
1997-09-02 09:55:40 +00:00

197 lines
4.7 KiB
C++
Executable File

#ifndef __VE0100_H
#define __VE0100_H
#define CHANGE_MESSAGE "Sono state effettuate modifiche alla configurazione.\nPrima di eseguire la gestione documenti occorre rigenerare le maschere.\nDesideri farlo ora ?"
#ifndef __CHECKS_H
#include <checks.h>
#endif
#ifndef __EXPR_H
#include <expr.h>
#endif
#ifndef __TABUTIL_H
#include <tabutil.h>
#endif
#ifndef __RELAPP_H
#include <relapp.h>
#endif
#ifndef __CONFIG_H
#include <config.h>
#endif
#ifndef __LFFILES_H
#include <lffiles.h>
#endif
#ifndef __DEFMASK_H
#include "defmask.h"
#endif
#ifndef __VEUML_H
#include "veuml.h"
#endif
#ifndef __VEUML1_H
#include "veuml1.h"
#endif
#ifndef __VERIG_H
#include "verig.h"
#endif
#ifndef __SHEET_H
#include <sheet.h>
#endif
#ifndef __REAL_H
#include <real.h>
#endif
#ifndef __MSKSHEET_H
#include <msksheet.h>
#endif
#ifndef __VARMASK_H
#include <varmask.h>
#endif
#ifndef __EXECP_H
#include <execp.h>
#endif
#ifndef __SCONTI_H
#include "sconti.h"
#endif
#ifndef __VELIB_H
#include "velib.h"
#endif
// Definizione della classe dell'applicazione motore
class TMotore_application : public TRelation_application
{
TArray _file; // Tutti i fiels da usare
TDocumento * _doc;
TCodice_numerazione * _cod_num;
// Puntatore al profilo del documento caricato
TConfig * _pro;
TConfig * _config_ditta;
// Puntatore alla maschera di ricerca
TMask * _msk;
TMask * _occas_mask;
// puntatore alla relazione
TRelation * _rel;
// Puntatore allo sheet delle righe documento
TSheet_field * _sheet;
TCond_vendita * _condv;
// Indica se il documento ha come soggetto un <C>liente o un <F>ornitore
char _tipocf;
TString16 _codnum;
TString16 _tipodoc;
bool _ges_mag;
bool _ges_dep;
TString16 _std_mag;
TString16 _std_dep;
// Array di maschere documento
TAssoc_array _doc_masks;
TLista_elaborazioni _elab;
// Ridefinizione dei metodi virtuali
virtual bool user_create( );
virtual bool user_destroy( );
virtual TMask* get_mask( int mode );
virtual bool changing_mask( int mode );
virtual void init_query_mode(TMask& m);
virtual void init_insert_mode( TMask& m );
virtual void init_modify_mode( TMask& m );
virtual int read( TMask& m );
virtual int write( const TMask& m );
virtual int rewrite( const TMask& m );
// Funzioni da associare ad ogni procedura
int user_function( int index );
void user_set_handler( int fieldid, int index, TMask* m = NULL );
protected:
void open_files(int logicnum, ...);
void close_files() { _file.destroy(); }
virtual void on_firm_change();
// Procedure e funzioni per la gestione della maschera e dei files
void update_profile();
// Procedure e funzioni per la gestione degli stati
int stato_corrente( );
// Handle che ritorna la maschera per le righe
static TMask * ss_getmask( int numriga, TMask& fullmask);
// Handler che gestisce la richiesta del tipo riga in inserimento
static bool ss_handler( TSheet_field& ss, int r, KEY key );
// Handler per la maschera di ricerca
static bool ndoc_handler( TMask_field& f, KEY key );
static bool num_handler( TMask_field& f, KEY key );
static bool tip_handler( TMask_field& f, KEY key );
static bool occas_code_handler(TMask_field& f, KEY key);
// Handler per la maschera di modifica
static bool clifo_handler( TMask_field& f, KEY key );
static bool occas_handler( TMask_field& f, KEY key );
static bool elabora_handler( TMask_field& f, KEY key );
static bool print_handler( TMask_field& f, KEY key );
// Configurazione dello sheet dato il profilo
void configura_sheet( TSheet_field& sheet, TConfig& config );
public:
virtual TRelation* get_relation( ) const { return _rel;}
// Funzioni di accesso alle variabili private
TConfig & pro() { CHECK( _pro, "Profilo del documento nullo!" ); return *_pro; }
const TFilename & proname() { return _pro->name(); }
TMask & query_mask() { CHECK( _msk, "Maschera di ricerca nulla!" ); return *_msk; }
TMask & edit_mask() { return (TMask &) _doc_masks[_doc->tipo().codice()]; }
TRelation & rel() { CHECK( _rel, "Relazione nulla!" ); return *_rel; }
TSheet_field & sheet() { CHECK( _sheet, "Sheet nullo!" ); return *_sheet; }
TCond_vendita & condv() { return *_condv; }
TConfig & config_ditta() {return *_config_ditta; }
TLista_elaborazioni & elab() { return _elab; }
TDocumento & doc() {return *_doc; }
// Operazione
const char tipocf( ) { return _tipocf; }
void tipocf( const char tcf ) { _tipocf = tcf; }
TSheet_field & ss( ) const { return *_sheet; }
TMotore_application( ) { _pro = NULL; }
virtual ~TMotore_application( ) { if ( _pro ) delete _pro; }
virtual const char* get_next_key( );
};
inline TMotore_application & app() { return (TMotore_application &) main_app(); }
#endif