416 lines
9.8 KiB
C++
416 lines
9.8 KiB
C++
|
|
// Version: 2020.7.28 15:27:24
|
||
|
|
|
||
|
|
// File: T_LOV_CONST.cpp
|
||
|
|
|
||
|
|
#include "T_LOV_CONST.h"
|
||
|
|
|
||
|
|
T_LOV_CONST::T_LOV_CONST(){
|
||
|
|
// initialise all membervariables
|
||
|
|
initial();
|
||
|
|
}
|
||
|
|
T_LOV_CONST::~T_LOV_CONST(){
|
||
|
|
}
|
||
|
|
void T_LOV_CONST::initial(){
|
||
|
|
// initialise all membervariables
|
||
|
|
set_Code((char*)"");
|
||
|
|
set_Name((char*)"");
|
||
|
|
set_NameZi(-1);
|
||
|
|
set_Content((char*)"");
|
||
|
|
set_ContentZi(-1);
|
||
|
|
set_toc((char*)"");
|
||
|
|
set_tocZi(-1);
|
||
|
|
set_toc((char*)"");
|
||
|
|
set_tomZi(-1);
|
||
|
|
set_mop((char*)"");
|
||
|
|
set_mopZi(-1);
|
||
|
|
set_mou((char*)"");
|
||
|
|
set_mouZi(-1);
|
||
|
|
// initialies Primary key members
|
||
|
|
set_k_Code((char*)"");
|
||
|
|
}
|
||
|
|
T_LOV_CONST::T_LOV_CONST(const char* arg1)
|
||
|
|
{
|
||
|
|
initial();
|
||
|
|
setPrimKey (arg1);
|
||
|
|
//read DB record
|
||
|
|
dbAccess = true;
|
||
|
|
dbMessage = readDB();
|
||
|
|
if ( dbMessage != NULL ) {dbAccess = false;}
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST:: execute(const char* sql , long* count){
|
||
|
|
return( db.execute( sql , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST:: dbCommit(){
|
||
|
|
return( db.dbCommit( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST:: dbRollback(){
|
||
|
|
return( db.dbRollback( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::readDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.readDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::updateDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.updateDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::insertDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.insertDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::deleteDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::deleteDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::openSetDB(const char * where,const char* order){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.openSetDB( where , order ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::countDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.countDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::getSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.getSetDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::closeSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.closeSetDB() );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::storeDB(){
|
||
|
|
char* ret = NULL;
|
||
|
|
setKeysFromRecord();
|
||
|
|
ret=db.updateDB(*this);
|
||
|
|
if(ret != NULL){
|
||
|
|
ret=db.insertDB(*this);
|
||
|
|
if(ret != NULL){
|
||
|
|
dbAccess = false;
|
||
|
|
return(ret);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return(ret);
|
||
|
|
}
|
||
|
|
|
||
|
|
// public methode setPrimKey T_LOV_CONST
|
||
|
|
//
|
||
|
|
// this methode stores the unique key attributes
|
||
|
|
//
|
||
|
|
void T_LOV_CONST::setPrimKey( const char* arg1 ){
|
||
|
|
strncpy( (char*)c_k_Code , arg1 , sizeof(c_k_Code) );
|
||
|
|
c_k_Code[sizeof(c_k_Code)-1] = '\0';
|
||
|
|
} // end of methode
|
||
|
|
|
||
|
|
void T_LOV_CONST::initInsertKeys( const char* arg1 ){
|
||
|
|
setPrimKey ( arg1);
|
||
|
|
strncpy( (char*)c_Code , arg1 , sizeof(c_Code) );
|
||
|
|
c_Code[sizeof(c_Code)-1] = '\0';
|
||
|
|
} // end of methode
|
||
|
|
void T_LOV_CONST::setKeysFromRecord(){
|
||
|
|
set_k_Code( Code() );
|
||
|
|
} // end of methode
|
||
|
|
//
|
||
|
|
//O P E R A T O R +
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
T_LOV_CONST T_LOV_CONST::operator+(const T_LOV_CONST &inst) const{
|
||
|
|
T_LOV_CONST ptrT_LOV_CONST(*this);
|
||
|
|
//----------------------------------------------------------
|
||
|
|
ptrT_LOV_CONST.set_Code(inst.Code());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.NameZi() != -1){
|
||
|
|
ptrT_LOV_CONST.set_Name(inst.Name());
|
||
|
|
ptrT_LOV_CONST.set_NameZi(inst.NameZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.ContentZi() != -1){
|
||
|
|
ptrT_LOV_CONST.set_Content(inst.Content());
|
||
|
|
ptrT_LOV_CONST.set_ContentZi(inst.ContentZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.tocZi() != -1){
|
||
|
|
ptrT_LOV_CONST.set_toc(inst.toc());
|
||
|
|
ptrT_LOV_CONST.set_tocZi(inst.tocZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.tomZi() != -1){
|
||
|
|
ptrT_LOV_CONST.set_tom(inst.tom());
|
||
|
|
ptrT_LOV_CONST.set_tomZi(inst.tomZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.mopZi() != -1){
|
||
|
|
ptrT_LOV_CONST.set_mop(inst.mop());
|
||
|
|
ptrT_LOV_CONST.set_mopZi(inst.mopZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.mouZi() != -1){
|
||
|
|
ptrT_LOV_CONST.set_mou(inst.mou());
|
||
|
|
ptrT_LOV_CONST.set_mouZi(inst.mouZi());
|
||
|
|
}
|
||
|
|
return (ptrT_LOV_CONST);
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
//O P E R A T O R =
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
const T_LOV_CONST& T_LOV_CONST::operator=(const T_LOV_CONST &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Code(inst.Code());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Name(inst.Name());
|
||
|
|
this->set_NameZi(inst.NameZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Content(inst.Content());
|
||
|
|
this->set_ContentZi(inst.ContentZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_toc(inst.toc());
|
||
|
|
this->set_tocZi(inst.tocZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_tom(inst.tom());
|
||
|
|
this->set_tomZi(inst.tomZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_mop(inst.mop());
|
||
|
|
this->set_mopZi(inst.mopZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_mou(inst.mou());
|
||
|
|
this->set_mouZi(inst.mouZi());
|
||
|
|
return (*this);
|
||
|
|
}
|
||
|
|
//
|
||
|
|
//C O P Y - C O N S T R U C T O R
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
T_LOV_CONST::T_LOV_CONST(const T_LOV_CONST &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Code(inst.Code());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Name(inst.Name());
|
||
|
|
this->set_NameZi(inst.NameZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Content(inst.Content());
|
||
|
|
this->set_ContentZi(inst.ContentZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_toc(inst.toc());
|
||
|
|
this->set_tocZi(inst.tocZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_tom(inst.tom());
|
||
|
|
this->set_tomZi(inst.tomZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_mop(inst.mop());
|
||
|
|
this->set_mopZi(inst.mopZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_mou(inst.mou());
|
||
|
|
this->set_mouZi(inst.mouZi());
|
||
|
|
}
|
||
|
|
char* T_LOV_CONST::Code() const{
|
||
|
|
return((char*)c_Code );
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_Code( const char* arg ){
|
||
|
|
strncpy((char*)c_Code , arg , sizeof(c_Code));
|
||
|
|
c_Code[sizeof(c_Code)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
char* T_LOV_CONST::Name() const{
|
||
|
|
return((char*)c_Name );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_CONST::NameZi() const{
|
||
|
|
return( s_NameZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_Name( const char* arg ){
|
||
|
|
strncpy((char*)c_Name , arg , sizeof(c_Name));
|
||
|
|
c_Name[sizeof(c_Name)-1] = '\0';
|
||
|
|
s_NameZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_NameZi( short arg ) {
|
||
|
|
s_NameZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::Content() const{
|
||
|
|
return((char*)c_Content );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_CONST::ContentZi() const{
|
||
|
|
return( s_ContentZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_Content( const char* arg ){
|
||
|
|
strncpy((char*)c_Content , arg , sizeof(c_Content));
|
||
|
|
c_Content[sizeof(c_Content)-1] = '\0';
|
||
|
|
s_ContentZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_ContentZi( short arg ) {
|
||
|
|
s_ContentZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::toc() const{
|
||
|
|
return((char*)c_toc );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_CONST::tocZi() const{
|
||
|
|
return( s_tocZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_toc( char* arg ){
|
||
|
|
strncpy((char*)c_toc , arg , sizeof(c_toc));
|
||
|
|
c_toc[sizeof(c_toc)-1] = '\0';
|
||
|
|
s_tocZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_tocZi( short arg ){
|
||
|
|
s_tocZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::tom() const{
|
||
|
|
return((char*)c_tom );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_CONST::tomZi() const{
|
||
|
|
return( s_tomZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_tom( char* arg ){
|
||
|
|
strncpy((char*)c_tom , arg , sizeof(c_tom));
|
||
|
|
c_tom[sizeof(c_tom)-1] = '\0';
|
||
|
|
s_tomZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_tomZi( short arg ){
|
||
|
|
s_tomZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::mop() const{
|
||
|
|
return((char*)c_mop );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_CONST::mopZi() const{
|
||
|
|
return( s_mopZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_mop( char* arg ){
|
||
|
|
strncpy((char*)c_mop , arg , sizeof(c_mop));
|
||
|
|
c_mop[sizeof(c_mop)-1] = '\0';
|
||
|
|
s_mopZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_mopZi( short arg ){
|
||
|
|
s_mopZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_CONST::mou() const{
|
||
|
|
return((char*)c_mou );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_CONST::mouZi() const{
|
||
|
|
return( s_mouZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_mou( char* arg ){
|
||
|
|
strncpy((char*)c_mou , arg , sizeof(c_mou));
|
||
|
|
c_mou[sizeof(c_mou)-1] = '\0';
|
||
|
|
s_mouZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_mouZi( short arg ){
|
||
|
|
s_mouZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
// methodes for Primary key
|
||
|
|
char* T_LOV_CONST::k_Code(){
|
||
|
|
return((char*)c_k_Code );
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_CONST::set_k_Code( char* arg ){
|
||
|
|
strncpy((char*)c_k_Code , arg , sizeof(c_k_Code));
|
||
|
|
c_k_Code[sizeof(c_k_Code)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
// public methode fillStructure
|
||
|
|
//
|
||
|
|
// this methode filles the classstructue with the private attributes
|
||
|
|
//
|
||
|
|
void T_LOV_CONST::fillStructure(){
|
||
|
|
strncpy ( structTable.Code , Code(),sizeof(structTable.Code));
|
||
|
|
strncpy ( structTable.Name , Name(),sizeof(structTable.Name));
|
||
|
|
strncpy ( structTable.Content , Content(),sizeof(structTable.Content));
|
||
|
|
strncpy ( structTable.toc , toc(),sizeof(structTable.toc));
|
||
|
|
strncpy ( structTable.tom , tom(),sizeof(structTable.tom));
|
||
|
|
strncpy ( structTable.mop , mop(),sizeof(structTable.mop));
|
||
|
|
strncpy ( structTable.mou , mou(),sizeof(structTable.mou));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_LOV_CONST::fillStructureZi(){
|
||
|
|
structTableZi.NameZi = NameZi();
|
||
|
|
structTableZi.ContentZi = ContentZi();
|
||
|
|
structTableZi.tocZi = tocZi();
|
||
|
|
structTableZi.tomZi = tomZi();
|
||
|
|
structTableZi.mopZi = mopZi();
|
||
|
|
structTableZi.mouZi = mouZi();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_LOV_CONST::setStructure() {
|
||
|
|
set_Name( structTable.Name);
|
||
|
|
set_Content( structTable.Content);
|
||
|
|
set_toc(structTable.toc);
|
||
|
|
set_tom(structTable.tom);
|
||
|
|
set_mop(structTable.mop);
|
||
|
|
set_mou(structTable.mou);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_LOV_CONST::setStructureZi() {
|
||
|
|
set_NameZi( structTableZi.NameZi);
|
||
|
|
set_ContentZi( structTableZi.ContentZi);
|
||
|
|
set_tocZi(structTableZi.tocZi);
|
||
|
|
set_tomZi(structTableZi.tomZi);
|
||
|
|
set_mopZi(structTableZi.mopZi);
|
||
|
|
set_mouZi(structTableZi.mouZi);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
char* T_LOV_CONST::getName(){
|
||
|
|
return((char*)"T_LOV_CONST");
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
int T_LOV_CONST::getSqlCode(){
|
||
|
|
return( db.dbSqlCode);
|
||
|
|
}
|
||
|
|
int T_LOV_CONST::getRowsProcessed(){
|
||
|
|
return( db.dbRowsProcessed);
|
||
|
|
}
|