// Version: 2019.4.4 10:22:45 // File: T_LOV_ZONE.cpp #include "T_LOV_ZONE.h" T_LOV_ZONE::T_LOV_ZONE(){ // initialise all membervariables initial(); } T_LOV_ZONE::~T_LOV_ZONE(){ } void T_LOV_ZONE::initial(){ // initialise all membervariables set_eqpseq(0); set_eqpZone((char*)""); set_zone((char*)""); set_zoneName((char*)""); set_zoneNameZi(-1); set_zoneSeq(0); set_zoneSeqZi(-1); set_visable((char*)""); set_visableZi(-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_eqpseq(0); set_k_eqpZone((char*)""); set_k_zone((char*)""); } T_LOV_ZONE::T_LOV_ZONE(long arg1,const char* arg2,const char* arg3) { initial(); setPrimKey (arg1, arg2, arg3); //read DB record dbAccess = true; dbMessage = readDB(); if ( dbMessage != NULL ) {dbAccess = false;} } char* T_LOV_ZONE:: execute(const char* sql , long* count){ return( db.execute( sql , count ) ); } char* T_LOV_ZONE:: dbCommit(){ return( db.dbCommit( ) ); } char* T_LOV_ZONE:: dbRollback(){ return( db.dbRollback( ) ); } char* T_LOV_ZONE::readDB(){ // DB Trace is off return( db.readDB(*this) ); } char* T_LOV_ZONE::updateDB(){ // DB Trace is off return( db.updateDB(*this) ); } char* T_LOV_ZONE::insertDB(){ // DB Trace is off return( db.insertDB(*this) ); } char* T_LOV_ZONE::deleteDB(){ // DB Trace is off return( db.deleteDB(*this) ); } char* T_LOV_ZONE::deleteDB(const char * where, long* count){ // DB Trace is off return( db.deleteDB( where , count ) ); } char* T_LOV_ZONE::openSetDB(const char * where,const char* order){ // DB Trace is off return( db.openSetDB( where , order ) ); } char* T_LOV_ZONE::countDB(const char * where, long* count){ // DB Trace is off return( db.countDB( where , count ) ); } char* T_LOV_ZONE::getSetDB(){ // DB Trace is off return( db.getSetDB(*this) ); } char* T_LOV_ZONE::closeSetDB(){ // DB Trace is off return( db.closeSetDB() ); } char* T_LOV_ZONE::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_ZONE // // this methode stores the unique key attributes // void T_LOV_ZONE::setPrimKey( long arg1 , const char* arg2 , const char* arg3 ){ l_k_eqpseq = arg1; strncpy( (char*)c_k_eqpZone , arg2 , sizeof(c_k_eqpZone) ); c_k_eqpZone[sizeof(c_k_eqpZone)-1] = '\0'; strncpy( (char*)c_k_zone , arg3 , sizeof(c_k_zone) ); c_k_zone[sizeof(c_k_zone)-1] = '\0'; } // end of methode void T_LOV_ZONE::initInsertKeys( long arg1 , const char* arg2 , const char* arg3 ){ setPrimKey ( arg1 , arg2 , arg3); l_eqpseq = arg1; strncpy( (char*)c_eqpZone , arg2 , sizeof(c_eqpZone) ); c_eqpZone[sizeof(c_eqpZone)-1] = '\0'; strncpy( (char*)c_zone , arg3 , sizeof(c_zone) ); c_zone[sizeof(c_zone)-1] = '\0'; } // end of methode void T_LOV_ZONE::setKeysFromRecord(){ set_k_eqpseq( eqpseq() ); set_k_eqpZone( eqpZone() ); set_k_zone( zone() ); } // end of methode // //O P E R A T O R + //=================== // T_LOV_ZONE T_LOV_ZONE::operator+(const T_LOV_ZONE &inst) const{ T_LOV_ZONE ptrT_LOV_ZONE(*this); //---------------------------------------------------------- ptrT_LOV_ZONE.set_eqpseq(inst.eqpseq()); //---------------------------------------------------------- ptrT_LOV_ZONE.set_eqpZone(inst.eqpZone()); //---------------------------------------------------------- ptrT_LOV_ZONE.set_zone(inst.zone()); //---------------------------------------------------------- if(inst.zoneNameZi() != -1){ ptrT_LOV_ZONE.set_zoneName(inst.zoneName()); ptrT_LOV_ZONE.set_zoneNameZi(inst.zoneNameZi()); } //---------------------------------------------------------- if(inst.zoneSeqZi() != -1){ ptrT_LOV_ZONE.set_zoneSeq(inst.zoneSeq()); ptrT_LOV_ZONE.set_zoneSeqZi(inst.zoneSeqZi()); } //---------------------------------------------------------- if(inst.visableZi() != -1){ ptrT_LOV_ZONE.set_visable(inst.visable()); ptrT_LOV_ZONE.set_visableZi(inst.visableZi()); } //---------------------------------------------------------- if(inst.tocZi() != -1){ ptrT_LOV_ZONE.set_toc(inst.toc()); ptrT_LOV_ZONE.set_tocZi(inst.tocZi()); } //---------------------------------------------------------- if(inst.tomZi() != -1){ ptrT_LOV_ZONE.set_tom(inst.tom()); ptrT_LOV_ZONE.set_tomZi(inst.tomZi()); } //---------------------------------------------------------- if(inst.mopZi() != -1){ ptrT_LOV_ZONE.set_mop(inst.mop()); ptrT_LOV_ZONE.set_mopZi(inst.mopZi()); } //---------------------------------------------------------- if(inst.mouZi() != -1){ ptrT_LOV_ZONE.set_mou(inst.mou()); ptrT_LOV_ZONE.set_mouZi(inst.mouZi()); } return (ptrT_LOV_ZONE); } // //O P E R A T O R = //=================== // const T_LOV_ZONE& T_LOV_ZONE::operator=(const T_LOV_ZONE &inst){ //---------------------------------------------------------- this->set_eqpseq(inst.eqpseq()); //---------------------------------------------------------- this->set_eqpZone(inst.eqpZone()); //---------------------------------------------------------- this->set_zone(inst.zone()); //---------------------------------------------------------- this->set_zoneName(inst.zoneName()); this->set_zoneNameZi(inst.zoneNameZi()); //---------------------------------------------------------- this->set_zoneSeq(inst.zoneSeq()); this->set_zoneSeqZi(inst.zoneSeqZi()); //---------------------------------------------------------- this->set_visable(inst.visable()); this->set_visableZi(inst.visableZi()); //---------------------------------------------------------- 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_ZONE::T_LOV_ZONE(const T_LOV_ZONE &inst){ //---------------------------------------------------------- this->set_eqpseq(inst.eqpseq()); //---------------------------------------------------------- this->set_eqpZone(inst.eqpZone()); //---------------------------------------------------------- this->set_zone(inst.zone()); //---------------------------------------------------------- this->set_zoneName(inst.zoneName()); this->set_zoneNameZi(inst.zoneNameZi()); //---------------------------------------------------------- this->set_zoneSeq(inst.zoneSeq()); this->set_zoneSeqZi(inst.zoneSeqZi()); //---------------------------------------------------------- this->set_visable(inst.visable()); this->set_visableZi(inst.visableZi()); //---------------------------------------------------------- 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()); } long T_LOV_ZONE::eqpseq() const{ return((long)l_eqpseq ); } void T_LOV_ZONE::set_eqpseq( long arg ){ l_eqpseq = arg; return; } char* T_LOV_ZONE::eqpZone() const{ return((char*)c_eqpZone ); } void T_LOV_ZONE::set_eqpZone( const char* arg ){ strncpy((char*)c_eqpZone , arg , sizeof(c_eqpZone)); c_eqpZone[sizeof(c_eqpZone)-1] = '\0'; return; } char* T_LOV_ZONE::zone() const{ return((char*)c_zone ); } void T_LOV_ZONE::set_zone( const char* arg ){ strncpy((char*)c_zone , arg , sizeof(c_zone)); c_zone[sizeof(c_zone)-1] = '\0'; return; } char* T_LOV_ZONE::zoneName() const{ return((char*)c_zoneName ); } short T_LOV_ZONE::zoneNameZi() const{ return( s_zoneNameZi); } void T_LOV_ZONE::set_zoneName( const char* arg ){ strncpy((char*)c_zoneName , arg , sizeof(c_zoneName)); c_zoneName[sizeof(c_zoneName)-1] = '\0'; s_zoneNameZi= 0; return; } void T_LOV_ZONE::set_zoneNameZi( short arg ) { s_zoneNameZi = arg; } long T_LOV_ZONE::zoneSeq() const{ return((long)l_zoneSeq ); } short T_LOV_ZONE::zoneSeqZi() const{ return( s_zoneSeqZi); } void T_LOV_ZONE::set_zoneSeq( long arg ){ l_zoneSeq = arg; s_zoneSeqZi= 0; return; } void T_LOV_ZONE::set_zoneSeqZi( short arg ) { s_zoneSeqZi = arg; } char* T_LOV_ZONE::visable() const{ return((char*)c_visable ); } short T_LOV_ZONE::visableZi() const{ return( s_visableZi); } void T_LOV_ZONE::set_visable( const char* arg ){ strncpy((char*)c_visable , arg , sizeof(c_visable)); c_visable[sizeof(c_visable)-1] = '\0'; s_visableZi= 0; return; } void T_LOV_ZONE::set_visableZi( short arg ) { s_visableZi = arg; } char* T_LOV_ZONE::toc() const{ return((char*)c_toc ); } short T_LOV_ZONE::tocZi() const{ return( s_tocZi); } void T_LOV_ZONE::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_ZONE::set_tocZi( short arg ){ s_tocZi = arg; } char* T_LOV_ZONE::tom() const{ return((char*)c_tom ); } short T_LOV_ZONE::tomZi() const{ return( s_tomZi); } void T_LOV_ZONE::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_ZONE::set_tomZi( short arg ){ s_tomZi = arg; } char* T_LOV_ZONE::mop() const{ return((char*)c_mop ); } short T_LOV_ZONE::mopZi() const{ return( s_mopZi); } void T_LOV_ZONE::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_ZONE::set_mopZi( short arg ){ s_mopZi = arg; } char* T_LOV_ZONE::mou() const{ return((char*)c_mou ); } short T_LOV_ZONE::mouZi() const{ return( s_mouZi); } void T_LOV_ZONE::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_ZONE::set_mouZi( short arg ){ s_mouZi = arg; } // methodes for Primary key long T_LOV_ZONE::k_eqpseq(){ return((long)l_k_eqpseq ); } void T_LOV_ZONE::set_k_eqpseq( long arg ){ l_k_eqpseq = arg; return; } char* T_LOV_ZONE::k_eqpZone(){ return((char*)c_k_eqpZone ); } void T_LOV_ZONE::set_k_eqpZone( char* arg ){ strncpy((char*)c_k_eqpZone , arg , sizeof(c_k_eqpZone)); c_k_eqpZone[sizeof(c_k_eqpZone)-1] = '\0'; return; } char* T_LOV_ZONE::k_zone(){ return((char*)c_k_zone ); } void T_LOV_ZONE::set_k_zone( char* arg ){ strncpy((char*)c_k_zone , arg , sizeof(c_k_zone)); c_k_zone[sizeof(c_k_zone)-1] = '\0'; return; } // // public methode fillStructure // // this methode filles the classstructue with the private attributes // void T_LOV_ZONE::fillStructure(){ structTable.eqpseq = eqpseq(); strncpy ( structTable.eqpZone , eqpZone(),sizeof(structTable.eqpZone)); strncpy ( structTable.zone , zone(),sizeof(structTable.zone)); strncpy ( structTable.zoneName , zoneName(),sizeof(structTable.zoneName)); structTable.zoneSeq = zoneSeq(); strncpy ( structTable.visable , visable(),sizeof(structTable.visable)); 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_ZONE::fillStructureZi(){ structTableZi.zoneNameZi = zoneNameZi(); structTableZi.zoneSeqZi = zoneSeqZi(); structTableZi.visableZi = visableZi(); structTableZi.tocZi = tocZi(); structTableZi.tomZi = tomZi(); structTableZi.mopZi = mopZi(); structTableZi.mouZi = mouZi(); return; } /////////////////////////////////////////////////// void T_LOV_ZONE::setStructure() { set_zoneName( structTable.zoneName); set_zoneSeq( structTable.zoneSeq); set_visable( structTable.visable); set_toc(structTable.toc); set_tom(structTable.tom); set_mop(structTable.mop); set_mou(structTable.mou); return; } /////////////////////////////////////////////////// void T_LOV_ZONE::setStructureZi() { set_zoneNameZi( structTableZi.zoneNameZi); set_zoneSeqZi( structTableZi.zoneSeqZi); set_visableZi( structTableZi.visableZi); set_tocZi(structTableZi.tocZi); set_tomZi(structTableZi.tomZi); set_mopZi(structTableZi.mopZi); set_mouZi(structTableZi.mouZi); return; } /////////////////////////////////////////////////// char* T_LOV_ZONE::getName(){ return((char*)"T_LOV_ZONE"); } /////////////////////////////////////////////////// int T_LOV_ZONE::getSqlCode(){ return( db.dbSqlCode); } int T_LOV_ZONE::getRowsProcessed(){ return( db.dbRowsProcessed); }