// Version: 2019.4.4 10:22:45 // File: T_LOV_TELE.cpp #include "T_LOV_TELE.h" T_LOV_TELE::T_LOV_TELE(){ // initialise all membervariables initial(); } T_LOV_TELE::~T_LOV_TELE(){ } void T_LOV_TELE::initial(){ // initialise all membervariables set_EventNo(0); set_Sender((char*)""); set_SenderZi(-1); set_Receiver((char*)""); set_ReceiverZi(-1); set_TeleId((char*)""); set_TeleDesc((char*)""); set_TeleDescZi(-1); set_Line(0); set_LineZi(-1); set_HeaderType(0); set_HeaderTypeZi(-1); set_HeaderLength(0); set_HeaderLengthZi(-1); set_TotalLength(0); set_TotalLengthZi(-1); set_PrintType(0); set_PrintTypeZi(-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_EventNo(0); } T_LOV_TELE::T_LOV_TELE(long arg1) { initial(); setPrimKey (arg1); //read DB record dbAccess = true; dbMessage = readDB(); if ( dbMessage != NULL ) {dbAccess = false;} } char* T_LOV_TELE:: execute(const char* sql , long* count){ return( db.execute( sql , count ) ); } char* T_LOV_TELE:: dbCommit(){ return( db.dbCommit( ) ); } char* T_LOV_TELE:: dbRollback(){ return( db.dbRollback( ) ); } char* T_LOV_TELE::readDB(){ // DB Trace is off return( db.readDB(*this) ); } char* T_LOV_TELE::updateDB(){ // DB Trace is off return( db.updateDB(*this) ); } char* T_LOV_TELE::insertDB(){ // DB Trace is off return( db.insertDB(*this) ); } char* T_LOV_TELE::deleteDB(){ // DB Trace is off return( db.deleteDB(*this) ); } char* T_LOV_TELE::deleteDB(const char * where, long* count){ // DB Trace is off return( db.deleteDB( where , count ) ); } char* T_LOV_TELE::openSetDB(const char * where,const char* order){ // DB Trace is off return( db.openSetDB( where , order ) ); } char* T_LOV_TELE::countDB(const char * where, long* count){ // DB Trace is off return( db.countDB( where , count ) ); } char* T_LOV_TELE::getSetDB(){ // DB Trace is off return( db.getSetDB(*this) ); } char* T_LOV_TELE::closeSetDB(){ // DB Trace is off return( db.closeSetDB() ); } char* T_LOV_TELE::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_TELE // // this methode stores the unique key attributes // void T_LOV_TELE::setPrimKey( long arg1 ){ l_k_EventNo = arg1; } // end of methode void T_LOV_TELE::initInsertKeys( long arg1 ){ setPrimKey ( arg1); l_EventNo = arg1; } // end of methode void T_LOV_TELE::setKeysFromRecord(){ set_k_EventNo( EventNo() ); } // end of methode // //O P E R A T O R + //=================== // T_LOV_TELE T_LOV_TELE::operator+(const T_LOV_TELE &inst) const{ T_LOV_TELE ptrT_LOV_TELE(*this); //---------------------------------------------------------- ptrT_LOV_TELE.set_EventNo(inst.EventNo()); //---------------------------------------------------------- if(inst.SenderZi() != -1){ ptrT_LOV_TELE.set_Sender(inst.Sender()); ptrT_LOV_TELE.set_SenderZi(inst.SenderZi()); } //---------------------------------------------------------- if(inst.ReceiverZi() != -1){ ptrT_LOV_TELE.set_Receiver(inst.Receiver()); ptrT_LOV_TELE.set_ReceiverZi(inst.ReceiverZi()); } //---------------------------------------------------------- ptrT_LOV_TELE.set_TeleId(inst.TeleId()); //---------------------------------------------------------- if(inst.TeleDescZi() != -1){ ptrT_LOV_TELE.set_TeleDesc(inst.TeleDesc()); ptrT_LOV_TELE.set_TeleDescZi(inst.TeleDescZi()); } //---------------------------------------------------------- if(inst.LineZi() != -1){ ptrT_LOV_TELE.set_Line(inst.Line()); ptrT_LOV_TELE.set_LineZi(inst.LineZi()); } //---------------------------------------------------------- if(inst.HeaderTypeZi() != -1){ ptrT_LOV_TELE.set_HeaderType(inst.HeaderType()); ptrT_LOV_TELE.set_HeaderTypeZi(inst.HeaderTypeZi()); } //---------------------------------------------------------- if(inst.HeaderLengthZi() != -1){ ptrT_LOV_TELE.set_HeaderLength(inst.HeaderLength()); ptrT_LOV_TELE.set_HeaderLengthZi(inst.HeaderLengthZi()); } //---------------------------------------------------------- if(inst.TotalLengthZi() != -1){ ptrT_LOV_TELE.set_TotalLength(inst.TotalLength()); ptrT_LOV_TELE.set_TotalLengthZi(inst.TotalLengthZi()); } //---------------------------------------------------------- if(inst.PrintTypeZi() != -1){ ptrT_LOV_TELE.set_PrintType(inst.PrintType()); ptrT_LOV_TELE.set_PrintTypeZi(inst.PrintTypeZi()); } //---------------------------------------------------------- if(inst.tocZi() != -1){ ptrT_LOV_TELE.set_toc(inst.toc()); ptrT_LOV_TELE.set_tocZi(inst.tocZi()); } //---------------------------------------------------------- if(inst.tomZi() != -1){ ptrT_LOV_TELE.set_tom(inst.tom()); ptrT_LOV_TELE.set_tomZi(inst.tomZi()); } //---------------------------------------------------------- if(inst.mopZi() != -1){ ptrT_LOV_TELE.set_mop(inst.mop()); ptrT_LOV_TELE.set_mopZi(inst.mopZi()); } //---------------------------------------------------------- if(inst.mouZi() != -1){ ptrT_LOV_TELE.set_mou(inst.mou()); ptrT_LOV_TELE.set_mouZi(inst.mouZi()); } return (ptrT_LOV_TELE); } // //O P E R A T O R = //=================== // const T_LOV_TELE& T_LOV_TELE::operator=(const T_LOV_TELE &inst){ //---------------------------------------------------------- this->set_EventNo(inst.EventNo()); //---------------------------------------------------------- this->set_Sender(inst.Sender()); this->set_SenderZi(inst.SenderZi()); //---------------------------------------------------------- this->set_Receiver(inst.Receiver()); this->set_ReceiverZi(inst.ReceiverZi()); //---------------------------------------------------------- this->set_TeleId(inst.TeleId()); //---------------------------------------------------------- this->set_TeleDesc(inst.TeleDesc()); this->set_TeleDescZi(inst.TeleDescZi()); //---------------------------------------------------------- this->set_Line(inst.Line()); this->set_LineZi(inst.LineZi()); //---------------------------------------------------------- this->set_HeaderType(inst.HeaderType()); this->set_HeaderTypeZi(inst.HeaderTypeZi()); //---------------------------------------------------------- this->set_HeaderLength(inst.HeaderLength()); this->set_HeaderLengthZi(inst.HeaderLengthZi()); //---------------------------------------------------------- this->set_TotalLength(inst.TotalLength()); this->set_TotalLengthZi(inst.TotalLengthZi()); //---------------------------------------------------------- this->set_PrintType(inst.PrintType()); this->set_PrintTypeZi(inst.PrintTypeZi()); //---------------------------------------------------------- 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_TELE::T_LOV_TELE(const T_LOV_TELE &inst){ //---------------------------------------------------------- this->set_EventNo(inst.EventNo()); //---------------------------------------------------------- this->set_Sender(inst.Sender()); this->set_SenderZi(inst.SenderZi()); //---------------------------------------------------------- this->set_Receiver(inst.Receiver()); this->set_ReceiverZi(inst.ReceiverZi()); //---------------------------------------------------------- this->set_TeleId(inst.TeleId()); //---------------------------------------------------------- this->set_TeleDesc(inst.TeleDesc()); this->set_TeleDescZi(inst.TeleDescZi()); //---------------------------------------------------------- this->set_Line(inst.Line()); this->set_LineZi(inst.LineZi()); //---------------------------------------------------------- this->set_HeaderType(inst.HeaderType()); this->set_HeaderTypeZi(inst.HeaderTypeZi()); //---------------------------------------------------------- this->set_HeaderLength(inst.HeaderLength()); this->set_HeaderLengthZi(inst.HeaderLengthZi()); //---------------------------------------------------------- this->set_TotalLength(inst.TotalLength()); this->set_TotalLengthZi(inst.TotalLengthZi()); //---------------------------------------------------------- this->set_PrintType(inst.PrintType()); this->set_PrintTypeZi(inst.PrintTypeZi()); //---------------------------------------------------------- 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_TELE::EventNo() const{ return((long)l_EventNo ); } void T_LOV_TELE::set_EventNo( long arg ){ l_EventNo = arg; return; } char* T_LOV_TELE::Sender() const{ return((char*)c_Sender ); } short T_LOV_TELE::SenderZi() const{ return( s_SenderZi); } void T_LOV_TELE::set_Sender( const char* arg ){ strncpy((char*)c_Sender , arg , sizeof(c_Sender)); c_Sender[sizeof(c_Sender)-1] = '\0'; s_SenderZi= 0; return; } void T_LOV_TELE::set_SenderZi( short arg ) { s_SenderZi = arg; } char* T_LOV_TELE::Receiver() const{ return((char*)c_Receiver ); } short T_LOV_TELE::ReceiverZi() const{ return( s_ReceiverZi); } void T_LOV_TELE::set_Receiver( const char* arg ){ strncpy((char*)c_Receiver , arg , sizeof(c_Receiver)); c_Receiver[sizeof(c_Receiver)-1] = '\0'; s_ReceiverZi= 0; return; } void T_LOV_TELE::set_ReceiverZi( short arg ) { s_ReceiverZi = arg; } char* T_LOV_TELE::TeleId() const{ return((char*)c_TeleId ); } void T_LOV_TELE::set_TeleId( const char* arg ){ strncpy((char*)c_TeleId , arg , sizeof(c_TeleId)); c_TeleId[sizeof(c_TeleId)-1] = '\0'; return; } char* T_LOV_TELE::TeleDesc() const{ return((char*)c_TeleDesc ); } short T_LOV_TELE::TeleDescZi() const{ return( s_TeleDescZi); } void T_LOV_TELE::set_TeleDesc( const char* arg ){ strncpy((char*)c_TeleDesc , arg , sizeof(c_TeleDesc)); c_TeleDesc[sizeof(c_TeleDesc)-1] = '\0'; s_TeleDescZi= 0; return; } void T_LOV_TELE::set_TeleDescZi( short arg ) { s_TeleDescZi = arg; } long T_LOV_TELE::Line() const{ return((long)l_Line ); } short T_LOV_TELE::LineZi() const{ return( s_LineZi); } void T_LOV_TELE::set_Line( long arg ){ l_Line = arg; s_LineZi= 0; return; } void T_LOV_TELE::set_LineZi( short arg ) { s_LineZi = arg; } long T_LOV_TELE::HeaderType() const{ return((long)l_HeaderType ); } short T_LOV_TELE::HeaderTypeZi() const{ return( s_HeaderTypeZi); } void T_LOV_TELE::set_HeaderType( long arg ){ l_HeaderType = arg; s_HeaderTypeZi= 0; return; } void T_LOV_TELE::set_HeaderTypeZi( short arg ) { s_HeaderTypeZi = arg; } long T_LOV_TELE::HeaderLength() const{ return((long)l_HeaderLength ); } short T_LOV_TELE::HeaderLengthZi() const{ return( s_HeaderLengthZi); } void T_LOV_TELE::set_HeaderLength( long arg ){ l_HeaderLength = arg; s_HeaderLengthZi= 0; return; } void T_LOV_TELE::set_HeaderLengthZi( short arg ) { s_HeaderLengthZi = arg; } long T_LOV_TELE::TotalLength() const{ return((long)l_TotalLength ); } short T_LOV_TELE::TotalLengthZi() const{ return( s_TotalLengthZi); } void T_LOV_TELE::set_TotalLength( long arg ){ l_TotalLength = arg; s_TotalLengthZi= 0; return; } void T_LOV_TELE::set_TotalLengthZi( short arg ) { s_TotalLengthZi = arg; } long T_LOV_TELE::PrintType() const{ return((long)l_PrintType ); } short T_LOV_TELE::PrintTypeZi() const{ return( s_PrintTypeZi); } void T_LOV_TELE::set_PrintType( long arg ){ l_PrintType = arg; s_PrintTypeZi= 0; return; } void T_LOV_TELE::set_PrintTypeZi( short arg ) { s_PrintTypeZi = arg; } char* T_LOV_TELE::toc() const{ return((char*)c_toc ); } short T_LOV_TELE::tocZi() const{ return( s_tocZi); } void T_LOV_TELE::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_TELE::set_tocZi( short arg ){ s_tocZi = arg; } char* T_LOV_TELE::tom() const{ return((char*)c_tom ); } short T_LOV_TELE::tomZi() const{ return( s_tomZi); } void T_LOV_TELE::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_TELE::set_tomZi( short arg ){ s_tomZi = arg; } char* T_LOV_TELE::mop() const{ return((char*)c_mop ); } short T_LOV_TELE::mopZi() const{ return( s_mopZi); } void T_LOV_TELE::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_TELE::set_mopZi( short arg ){ s_mopZi = arg; } char* T_LOV_TELE::mou() const{ return((char*)c_mou ); } short T_LOV_TELE::mouZi() const{ return( s_mouZi); } void T_LOV_TELE::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_TELE::set_mouZi( short arg ){ s_mouZi = arg; } // methodes for Primary key long T_LOV_TELE::k_EventNo(){ return((long)l_k_EventNo ); } void T_LOV_TELE::set_k_EventNo( long arg ){ l_k_EventNo = arg; return; } // // public methode fillStructure // // this methode filles the classstructue with the private attributes // void T_LOV_TELE::fillStructure(){ structTable.EventNo = EventNo(); strncpy ( structTable.Sender , Sender(),sizeof(structTable.Sender)); strncpy ( structTable.Receiver , Receiver(),sizeof(structTable.Receiver)); strncpy ( structTable.TeleId , TeleId(),sizeof(structTable.TeleId)); strncpy ( structTable.TeleDesc , TeleDesc(),sizeof(structTable.TeleDesc)); structTable.Line = Line(); structTable.HeaderType = HeaderType(); structTable.HeaderLength = HeaderLength(); structTable.TotalLength = TotalLength(); structTable.PrintType = PrintType(); 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_TELE::fillStructureZi(){ structTableZi.SenderZi = SenderZi(); structTableZi.ReceiverZi = ReceiverZi(); structTableZi.TeleDescZi = TeleDescZi(); structTableZi.LineZi = LineZi(); structTableZi.HeaderTypeZi = HeaderTypeZi(); structTableZi.HeaderLengthZi = HeaderLengthZi(); structTableZi.TotalLengthZi = TotalLengthZi(); structTableZi.PrintTypeZi = PrintTypeZi(); structTableZi.tocZi = tocZi(); structTableZi.tomZi = tomZi(); structTableZi.mopZi = mopZi(); structTableZi.mouZi = mouZi(); return; } /////////////////////////////////////////////////// void T_LOV_TELE::setStructure() { set_Sender( structTable.Sender); set_Receiver( structTable.Receiver); set_TeleId( structTable.TeleId); set_TeleDesc( structTable.TeleDesc); set_Line( structTable.Line); set_HeaderType( structTable.HeaderType); set_HeaderLength( structTable.HeaderLength); set_TotalLength( structTable.TotalLength); set_PrintType( structTable.PrintType); set_toc(structTable.toc); set_tom(structTable.tom); set_mop(structTable.mop); set_mou(structTable.mou); return; } /////////////////////////////////////////////////// void T_LOV_TELE::setStructureZi() { set_SenderZi( structTableZi.SenderZi); set_ReceiverZi( structTableZi.ReceiverZi); set_TeleDescZi( structTableZi.TeleDescZi); set_LineZi( structTableZi.LineZi); set_HeaderTypeZi( structTableZi.HeaderTypeZi); set_HeaderLengthZi( structTableZi.HeaderLengthZi); set_TotalLengthZi( structTableZi.TotalLengthZi); set_PrintTypeZi( structTableZi.PrintTypeZi); set_tocZi(structTableZi.tocZi); set_tomZi(structTableZi.tomZi); set_mopZi(structTableZi.mopZi); set_mouZi(structTableZi.mouZi); return; } /////////////////////////////////////////////////// char* T_LOV_TELE::getName(){ return((char*)"T_LOV_TELE"); } /////////////////////////////////////////////////// int T_LOV_TELE::getSqlCode(){ return( db.dbSqlCode); } int T_LOV_TELE::getRowsProcessed(){ return( db.dbRowsProcessed); }