94 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			94 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#include <xvt.h>
 | 
						|
 | 
						|
#ifndef __CHECKS_H
 | 
						|
#include <checks.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __CONFAPP_H
 | 
						|
#include <confapp.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __EXECP_H
 | 
						|
#include <execp.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __TABUTIL_H
 | 
						|
#include <tabutil.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#include "mgconf.h"
 | 
						|
 | 
						|
#define SINTASSI "Usage: mg0 -2 -[1|2|3|4|5|6]"
 | 
						|
 | 
						|
class TConf_magazz : public TConfig_application
 | 
						|
{
 | 
						|
  char _current;
 | 
						|
 | 
						|
  static bool check_fields(TMask_field& f, KEY k);
 | 
						|
public:
 | 
						|
 | 
						|
  virtual bool preprocess_config (TMask& mask, TConfig& config);
 | 
						|
  virtual bool postprocess_config (TMask& mask, TConfig& config);
 | 
						|
  virtual bool user_create( );
 | 
						|
  virtual bool user_destroy( );
 | 
						|
 | 
						|
  TConf_magazz() : TConfig_application( CONFIG_DITTA ){ }
 | 
						|
  virtual ~TConf_magazz( ){ }
 | 
						|
};
 | 
						|
 | 
						|
bool TConf_magazz::check_fields(TMask_field& f, KEY k)
 | 
						|
{
 | 
						|
  return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
bool TConf_magazz::preprocess_config (TMask& mask, TConfig& config)
 | 
						|
{
 | 
						|
  return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
bool TConf_magazz::postprocess_config (TMask& mask, TConfig& config)
 | 
						|
{
 | 
						|
  return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
bool TConf_magazz::user_create( )
 | 
						|
{
 | 
						|
  TString16 arg( argv(2) );
 | 
						|
  if( arg[ 0 ] != '-' )
 | 
						|
    fatal_box( SINTASSI );
 | 
						|
  _current = arg[1];
 | 
						|
 | 
						|
  TConfig conf(_current == '6' ? CONFIG_STUDIO : CONFIG_DITTA );
 | 
						|
  if (_current == '6') set_config(CONFIG_STUDIO);
 | 
						|
  switch( _current )
 | 
						|
  {
 | 
						|
  case '1':
 | 
						|
    conf.set( "EdMask", "mg0300a", "mg");
 | 
						|
    break;
 | 
						|
  case '2':
 | 
						|
    conf.set( "EdMask", "mg0300b", "mg" );
 | 
						|
    break;
 | 
						|
  default:
 | 
						|
    fatal_box( SINTASSI );
 | 
						|
    return FALSE;
 | 
						|
    break;
 | 
						|
  }
 | 
						|
  return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
bool TConf_magazz::user_destroy( )
 | 
						|
{
 | 
						|
  return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
int mg0300(int argc, char* argv[])
 | 
						|
{
 | 
						|
  TConf_magazz appc;
 | 
						|
 | 
						|
  //if( argc < 3 )
 | 
						|
  //  fatal_box( SINTASSI );
 | 
						|
  appc.run(argc, argv, "Parametri gestione magazzino");
 | 
						|
  return 0;
 | 
						|
}
 |