campo-sirio/pr/pr0100.cpp
guy 8fa72f5d1a Patch level : 05.646
Files correlati     : pr0.exe pr1.exe
Ricompilazione Demo : [ ]
Commento            :
Gestione Euro per inserimento e stampa provvigioni agenti


git-svn-id: svn://10.65.10.50/trunk@8618 c028cbd2-c16b-5b4b-a496-9718f37d4682
1999-10-15 09:19:29 +00:00

62 lines
1.4 KiB
C++
Executable File

// Programma generico di gestione tabelle modulo provvigioni agenti
#include <tabapp.h>
#include "prtbapr.h"
class TTablePR_app : public TTable_application
{
protected:
virtual bool user_create() ;
static bool gmc_handler(TMask_field& f, KEY k);
};
static inline TTablePR_app& app() { return (TTablePR_app&)main_app(); }
bool TTablePR_app::gmc_handler(TMask_field& f, KEY k)
{
if (f.to_check(k))
{
TString v1 = f.get(),v2;
TMask& m = f.mask();
if (v1 == "E" || v1 == "R")
{
for (short id = F_SEQRIC1; id <= F_SEQRIC4; id++)
{
if (f.dlg() == id)
continue;
v2 = m.get(id);
if (v1 == "E" && v2 == "R" || v1 == "R" && v2 == "E")
return f.error_box("Non e' possibile usare contemporaneamente la "
"tabella gruppo merceologico e la tabella sottogruppo "
"merceologico");
}
}
}
return TRUE;
}
bool TTablePR_app::user_create()
{
Tab_application::user_create();
const TString& name = get_tabname();
TMask& mask = *get_mask();
if (name == "APR")
{
mask.set_handler(F_SEQRIC1,gmc_handler);
mask.set_handler(F_SEQRIC2,gmc_handler);
mask.set_handler(F_SEQRIC3,gmc_handler);
mask.set_handler(F_SEQRIC4,gmc_handler);
}
return TRUE;
}
int pr0100(int argc, char** argv)
{
TTablePR_app a;
a.run(argc, argv, "Tabella");
return 0;
}