2012-04-10 07:38:03 +00:00
|
|
|
#include <relapp.h>
|
|
|
|
|
|
|
|
#include "ba4.h"
|
|
|
|
#include "ba4700a.h"
|
|
|
|
|
|
|
|
class TContact_application : public TRelation_application
|
|
|
|
{
|
|
|
|
TMask* _msk;
|
|
|
|
TRelation* _rel;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool user_create() ;
|
|
|
|
virtual bool user_destroy() ;
|
|
|
|
virtual TMask* get_mask(int mode) { return _msk;}
|
|
|
|
virtual TRelation* get_relation() const { return _rel;}
|
2012-04-13 15:07:32 +00:00
|
|
|
virtual bool get_next_key(TToken_string& key);
|
2012-04-10 07:38:03 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
};
|
|
|
|
|
2012-04-13 15:07:32 +00:00
|
|
|
bool TContact_application::get_next_key(TToken_string& key)
|
|
|
|
{
|
|
|
|
TRecnotype n = 1;
|
|
|
|
TLocalisamfile& f = _rel->file();
|
|
|
|
if (f.last() == NOERR)
|
|
|
|
n += f.get_long("CONTACT");
|
|
|
|
key.format("%d|%ld", F_CONTACT, n);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-04-10 07:38:03 +00:00
|
|
|
bool TContact_application::user_create()
|
|
|
|
{
|
|
|
|
_rel = new TRelation(LF_CONTACT) ;
|
|
|
|
_msk = new TMask("ba4700a") ;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool TContact_application::user_destroy()
|
|
|
|
{
|
|
|
|
delete _msk;
|
|
|
|
delete _rel;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ba4700(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
TContact_application a;
|
|
|
|
a.run(argc, argv, TR("Contatti"));
|
|
|
|
return 0;
|
|
|
|
}
|