a659346f5e
Cio' che èper ora non serve e' stato spostato in excluded.fld. git-svn-id: svn://10.65.10.50/trunk@3605 c028cbd2-c16b-5b4b-a496-9718f37d4682
144 lines
3.1 KiB
C++
Executable File
144 lines
3.1 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 "veconf.h"
|
||
|
||
#define SINTASSI "Usage: VE0 -2 -[1|2|3|4|5|6]"
|
||
|
||
class TConf_vendite : public TConfig_application
|
||
{
|
||
char _current;
|
||
|
||
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_vendite() : TConfig_application( CONFIG_DITTA ){ }
|
||
virtual ~TConf_vendite( ){ }
|
||
};
|
||
|
||
bool TConf_vendite::preprocess_config (TMask& mask, TConfig& config)
|
||
{
|
||
disable_menu_item(M_FILE_NEW);
|
||
disable_menu_item(M_FILE_REVERT);
|
||
if (_current == '5') // solo per configurazione "e"
|
||
{
|
||
TToken_string ric(config.get("RICERCACR"));
|
||
TString ana_items("AR|GM|SM|RF");
|
||
int nor_order = 0, ana_order = 0;
|
||
TString it;
|
||
for (it = ric.get();it.not_empty();it = ric.get())
|
||
{
|
||
if (ana_items.find(it) >= 0)
|
||
{
|
||
mask.set(F_RICERCAAN1+ana_order,it);
|
||
if (ana_order>0) // Se e' la prima volta...
|
||
mask.set(F_RICERCACR1+nor_order,"AN");
|
||
ana_order++;
|
||
}
|
||
else
|
||
{
|
||
mask.set(F_RICERCACR1+nor_order,it);
|
||
nor_order++;
|
||
}
|
||
}
|
||
}
|
||
return TRUE;
|
||
}
|
||
|
||
bool TConf_vendite::postprocess_config (TMask& mask, TConfig& config)
|
||
{
|
||
enable_menu_item(M_FILE_NEW);
|
||
enable_menu_item(M_FILE_REVERT);
|
||
if (_current == '5') // solo per configurazione "e"
|
||
{
|
||
TToken_string ric;
|
||
TString r;
|
||
for (short i=F_RICERCACR1;i<=F_RICERCACR5;i++)
|
||
{
|
||
r = mask.get(i);
|
||
if (r == "AN")
|
||
for (short j=F_RICERCAAN1;j<=F_RICERCAAN4;j++)
|
||
ric.add(mask.get(j));
|
||
else
|
||
ric.add(r);
|
||
}
|
||
config.set("RICERCACR",ric);
|
||
}
|
||
return TRUE;
|
||
}
|
||
|
||
|
||
bool TConf_vendite::user_create( )
|
||
{
|
||
TString16 arg( argv(2) );
|
||
// Il fottuto meno serve per evitare fottutamente che la fottuta confapp
|
||
// si fotta il fottuto parametro
|
||
if( arg[ 0 ] != '-' )
|
||
fatal_box( SINTASSI );
|
||
_current = arg[1];
|
||
TConfig conf(_current == '6' ? CONFIG_STUDIO : CONFIG_DITTA );
|
||
if (_current == '6') set_config(CONFIG_STUDIO);
|
||
// Prima usavo le lettere ma la fottuta confapp si fotte il fottuto -c per i suoi fottuti
|
||
// motivi, cos<6F> uso i fottuti numeri
|
||
switch( _current )
|
||
{
|
||
case '1':
|
||
conf.set( "EdMask", "ve0200a", "ve" );
|
||
break;
|
||
case '2':
|
||
conf.set( "EdMask", "ve0200b", "ve" );
|
||
break;
|
||
case '3':
|
||
conf.set( "EdMask", "ve0200c", "ve" );
|
||
break;
|
||
case '4':
|
||
conf.set( "EdMask", "ve0200d", "ve" );
|
||
break;
|
||
case '5':
|
||
conf.set( "EdMask", "ve0200e", "ve" );
|
||
break;
|
||
case '6':
|
||
conf.set( "EdMask", "ve0200f", "ve" );
|
||
break;
|
||
default:
|
||
fatal_box( SINTASSI );
|
||
return FALSE;
|
||
break;
|
||
}
|
||
return TRUE;
|
||
}
|
||
|
||
bool TConf_vendite::user_destroy( )
|
||
{
|
||
return TRUE;
|
||
}
|
||
|
||
int ve0200(int argc, char** argv)
|
||
{
|
||
TConf_vendite appc;
|
||
|
||
if( argc < 3 )
|
||
fatal_box( SINTASSI );
|
||
appc.run(argc, argv, "Parametri gestione vendite");
|
||
return 0;
|
||
}
|