Ricompilazione Demo : [ ] Commento : Riportata la versione 3.1 patch 848 git-svn-id: svn://10.65.10.50/trunk@14993 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			103 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			103 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #include <confapp.h>
 | |
| 
 | |
| #include "vdconf.h"
 | |
| #include "../ve/velib.h"
 | |
| 
 | |
| class TConf_vendita_ditta : public TConfig_application
 | |
| {
 | |
|   static bool check_fields(TMask_field& f, KEY k);
 | |
| 	virtual TMask* create_mask(const TFilename& f);
 | |
| 
 | |
| public:
 | |
|   // @cmember Disabilita la verifica del modulo in chiave
 | |
|   virtual bool check_autorization() const  { return false; }
 | |
| 
 | |
|   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_vendita_ditta() : TConfig_application( CONFIG_DITTA ){ }
 | |
|   virtual ~TConf_vendita_ditta( ){ }
 | |
| };
 | |
| 
 | |
| bool tipo_handler( TMask_field& f, KEY k)
 | |
| {
 | |
|   TMask& m = f.mask();
 | |
| 
 | |
|   if (f.to_check(k))
 | |
|   {
 | |
|     TCodice_numerazione cod_num(m.get(FD_CODNUM));
 | |
|     const TString& tipo = f.get();
 | |
|     int last = cod_num.ntipi_doc();
 | |
|     for (int i = 0; i < last; i++ )
 | |
|     {
 | |
|       const TString16 curtipo(cod_num.tipo_doc(i));
 | |
|       if (curtipo == tipo)
 | |
|         return true;
 | |
|     }
 | |
|     return f.error_box( TR("Tipo non valido per la numerazione selezionata!"));
 | |
|   }
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| bool TConf_vendita_ditta::check_fields(TMask_field& f, KEY k)
 | |
| {
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| bool TConf_vendita_ditta::preprocess_config (TMask& mask, TConfig& config)
 | |
| {
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| bool TConf_vendita_ditta::postprocess_config (TMask& mask, TConfig& config)
 | |
| {
 | |
| 	bool ok = true;
 | |
| 	TString_array codes;
 | |
| 
 | |
| 	for (int i = 0 ; ok && i< 8; i++)
 | |
| 	{
 | |
| 		const TString & codpag = mask.get(FD_CODPAG01 + ROW_INC * i);
 | |
| 		if (codpag.not_empty())
 | |
| 		{
 | |
| 			const int row = codes.find(codpag);
 | |
| 
 | |
| 			if (row == -1)
 | |
| 				codes.add(codpag);
 | |
| 			else
 | |
| 				ok = error_box(FR("Il codice %s è già stato utilòizzato nella riga %d"), (const char *) codpag, row + 1);
 | |
| 		}
 | |
| 	}
 | |
| 
 | |
|   return ok;
 | |
| }
 | |
| 
 | |
| TMask* TConf_vendita_ditta::create_mask(const TFilename& f) 
 | |
| { 
 | |
| 	TMask*  m = TConfig_application::create_mask(f);
 | |
| 	
 | |
| 	m->set_handler(FD_TIPODOC, tipo_handler);
 | |
|   return m;
 | |
| }
 | |
| 
 | |
| bool TConf_vendita_ditta::user_create( )
 | |
| {
 | |
| 
 | |
| 	TConfig conf(CONFIG_DITTA);
 | |
| 
 | |
|   conf.set( "EdMask", "vd0300a", "vd");
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| bool TConf_vendita_ditta::user_destroy( )
 | |
| {
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| int vd0300(int argc, char* argv[])
 | |
| {
 | |
|   TConf_vendita_ditta appc;
 | |
|   appc.run(argc, argv, TR("Parametri ditta vendita al banco"));
 | |
|   return 0;
 | |
| } |