// Version: 2014.7.30 16:47:28 // File: T_SCH_DUM.cpp #include "T_SCH_DUM.h" T_SCH_DUM::T_SCH_DUM(){ // initialise all membervariables initial(); } T_SCH_DUM::~T_SCH_DUM(){ } void T_SCH_DUM::initial(){ // initialise all membervariables set_EnCoilId(""); set_CheckStatus(0); set_CheckStatusZi(-1); set_ScheduleNo(""); set_ScheduleNoZi(-1); set_SeqNo(0); set_toc(""); set_tocZi(-1); set_tom(""); set_tomZi(-1); set_mop(""); set_mopZi(-1); set_mou(""); set_mouZi(-1); // initialies Primary key members set_k_EnCoilId(""); } T_SCH_DUM::T_SCH_DUM(const char* arg1) { initial(); setPrimKey (arg1); //read DB record dbAccess = true; dbMessage = readDB(); if ( dbMessage != NULL ) {dbAccess = false;} } char* T_SCH_DUM:: execute(const char* sql , long* count){ return( db.execute( sql , count ) ); } char* T_SCH_DUM:: dbCommit(){ return( db.dbCommit( ) ); } char* T_SCH_DUM:: dbRollback(){ return( db.dbRollback( ) ); } char* T_SCH_DUM::readDB(){ // DB Trace is off return( db.readDB(*this) ); } char* T_SCH_DUM::updateDB(){ // DB Trace is off return( db.updateDB(*this) ); } char* T_SCH_DUM::insertDB(){ // DB Trace is off return( db.insertDB(*this) ); } char* T_SCH_DUM::deleteDB(){ // DB Trace is off return( db.deleteDB(*this) ); } char* T_SCH_DUM::deleteDB(const char * where, long* count){ // DB Trace is off return( db.deleteDB( where , count ) ); } char* T_SCH_DUM::openSetDB(const char * where,const char* order){ // DB Trace is off return( db.openSetDB( where , order ) ); } char* T_SCH_DUM::countDB(const char * where, long* count){ // DB Trace is off return( db.countDB( where , count ) ); } char* T_SCH_DUM::getSetDB(){ // DB Trace is off return( db.getSetDB(*this) ); } char* T_SCH_DUM::closeSetDB(){ // DB Trace is off return( db.closeSetDB() ); } char* T_SCH_DUM::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_SCH_DUM // // this methode stores the unique key attributes // void T_SCH_DUM::setPrimKey( const char* arg1 ){ strncpy( (char*)c_k_EnCoilId , arg1 , sizeof(c_k_EnCoilId) ); c_k_EnCoilId[sizeof(c_k_EnCoilId)-1] = '\0'; } // end of methode void T_SCH_DUM::initInsertKeys( const char* arg1 ){ setPrimKey ( arg1); strncpy( (char*)c_EnCoilId , arg1 , sizeof(c_EnCoilId) ); c_EnCoilId[sizeof(c_EnCoilId)-1] = '\0'; } // end of methode void T_SCH_DUM::setKeysFromRecord(){ set_k_EnCoilId( EnCoilId() ); } // end of methode // //O P E R A T O R + //=================== // T_SCH_DUM T_SCH_DUM::operator+(const T_SCH_DUM &inst) const{ T_SCH_DUM ptrT_SCH_DUM(*this); //---------------------------------------------------------- ptrT_SCH_DUM.set_EnCoilId(inst.EnCoilId()); //---------------------------------------------------------- if(inst.CheckStatusZi() != -1){ ptrT_SCH_DUM.set_CheckStatus(inst.CheckStatus()); ptrT_SCH_DUM.set_CheckStatusZi(inst.CheckStatusZi()); } //---------------------------------------------------------- if(inst.ScheduleNoZi() != -1){ ptrT_SCH_DUM.set_ScheduleNo(inst.ScheduleNo()); ptrT_SCH_DUM.set_ScheduleNoZi(inst.ScheduleNoZi()); } //---------------------------------------------------------- ptrT_SCH_DUM.set_SeqNo(inst.SeqNo()); //---------------------------------------------------------- if(inst.tocZi() != -1){ ptrT_SCH_DUM.set_toc(inst.toc()); ptrT_SCH_DUM.set_tocZi(inst.tocZi()); } //---------------------------------------------------------- if(inst.tomZi() != -1){ ptrT_SCH_DUM.set_tom(inst.tom()); ptrT_SCH_DUM.set_tomZi(inst.tomZi()); } //---------------------------------------------------------- if(inst.mopZi() != -1){ ptrT_SCH_DUM.set_mop(inst.mop()); ptrT_SCH_DUM.set_mopZi(inst.mopZi()); } //---------------------------------------------------------- if(inst.mouZi() != -1){ ptrT_SCH_DUM.set_mou(inst.mou()); ptrT_SCH_DUM.set_mouZi(inst.mouZi()); } return (ptrT_SCH_DUM); } // //O P E R A T O R = //=================== // const T_SCH_DUM& T_SCH_DUM::operator=(const T_SCH_DUM &inst){ //---------------------------------------------------------- this->set_EnCoilId(inst.EnCoilId()); //---------------------------------------------------------- this->set_CheckStatus(inst.CheckStatus()); this->set_CheckStatusZi(inst.CheckStatusZi()); //---------------------------------------------------------- this->set_ScheduleNo(inst.ScheduleNo()); this->set_ScheduleNoZi(inst.ScheduleNoZi()); //---------------------------------------------------------- this->set_SeqNo(inst.SeqNo()); //---------------------------------------------------------- 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_SCH_DUM::T_SCH_DUM(const T_SCH_DUM &inst){ //---------------------------------------------------------- this->set_EnCoilId(inst.EnCoilId()); //---------------------------------------------------------- this->set_CheckStatus(inst.CheckStatus()); this->set_CheckStatusZi(inst.CheckStatusZi()); //---------------------------------------------------------- this->set_ScheduleNo(inst.ScheduleNo()); this->set_ScheduleNoZi(inst.ScheduleNoZi()); //---------------------------------------------------------- this->set_SeqNo(inst.SeqNo()); //---------------------------------------------------------- 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_SCH_DUM::EnCoilId() const{ return((char*)c_EnCoilId ); } void T_SCH_DUM::set_EnCoilId( const char* arg ){ strncpy((char*)c_EnCoilId , arg , sizeof(c_EnCoilId)); c_EnCoilId[sizeof(c_EnCoilId)-1] = '\0'; return; } long T_SCH_DUM::CheckStatus() const{ return((long)l_CheckStatus ); } short T_SCH_DUM::CheckStatusZi() const{ return( s_CheckStatusZi); } void T_SCH_DUM::set_CheckStatus( long arg ){ l_CheckStatus = arg; s_CheckStatusZi= 0; return; } void T_SCH_DUM::set_CheckStatusZi( short arg ) { s_CheckStatusZi = arg; } char* T_SCH_DUM::ScheduleNo() const{ return((char*)c_ScheduleNo ); } short T_SCH_DUM::ScheduleNoZi() const{ return( s_ScheduleNoZi); } void T_SCH_DUM::set_ScheduleNo( const char* arg ){ strncpy((char*)c_ScheduleNo , arg , sizeof(c_ScheduleNo)); c_ScheduleNo[sizeof(c_ScheduleNo)-1] = '\0'; s_ScheduleNoZi= 0; return; } void T_SCH_DUM::set_ScheduleNoZi( short arg ) { s_ScheduleNoZi = arg; } long T_SCH_DUM::SeqNo() const{ return((long)l_SeqNo ); } void T_SCH_DUM::set_SeqNo( long arg ){ l_SeqNo = arg; return; } char* T_SCH_DUM::toc() const{ return((char*)c_toc ); } short T_SCH_DUM::tocZi() const{ return( s_tocZi); } void T_SCH_DUM::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_SCH_DUM::set_tocZi( short arg ){ s_tocZi = arg; } char* T_SCH_DUM::tom() const{ return((char*)c_tom ); } short T_SCH_DUM::tomZi() const{ return( s_tomZi); } void T_SCH_DUM::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_SCH_DUM::set_tomZi( short arg ){ s_tomZi = arg; } char* T_SCH_DUM::mop() const{ return((char*)c_mop ); } short T_SCH_DUM::mopZi() const{ return( s_mopZi); } void T_SCH_DUM::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_SCH_DUM::set_mopZi( short arg ){ s_mopZi = arg; } char* T_SCH_DUM::mou() const{ return((char*)c_mou ); } short T_SCH_DUM::mouZi() const{ return( s_mouZi); } void T_SCH_DUM::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_SCH_DUM::set_mouZi( short arg ){ s_mouZi = arg; } // methodes for Primary key char* T_SCH_DUM::k_EnCoilId(){ return((char*)c_k_EnCoilId ); } void T_SCH_DUM::set_k_EnCoilId( char* arg ){ strncpy((char*)c_k_EnCoilId , arg , sizeof(c_k_EnCoilId)); c_k_EnCoilId[sizeof(c_k_EnCoilId)-1] = '\0'; return; } // // public methode fillStructure // // this methode filles the classstructue with the private attributes // void T_SCH_DUM::fillStructure(){ strncpy ( structTable.EnCoilId , EnCoilId(),sizeof(structTable.EnCoilId)); structTable.CheckStatus = CheckStatus(); strncpy ( structTable.ScheduleNo , ScheduleNo(),sizeof(structTable.ScheduleNo)); structTable.SeqNo = SeqNo(); 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_SCH_DUM::fillStructureZi(){ structTableZi.CheckStatusZi = CheckStatusZi(); structTableZi.ScheduleNoZi = ScheduleNoZi(); structTableZi.tocZi = tocZi(); structTableZi.tomZi = tomZi(); structTableZi.mopZi = mopZi(); structTableZi.mouZi = mouZi(); return; } /////////////////////////////////////////////////// void T_SCH_DUM::setStructure() { set_CheckStatus( structTable.CheckStatus); set_ScheduleNo( structTable.ScheduleNo); set_SeqNo( structTable.SeqNo); set_toc(structTable.toc); set_tom(structTable.tom); set_mop(structTable.mop); set_mou(structTable.mou); return; } /////////////////////////////////////////////////// void T_SCH_DUM::setStructureZi() { set_CheckStatusZi( structTableZi.CheckStatusZi); set_ScheduleNoZi( structTableZi.ScheduleNoZi); set_tocZi(structTableZi.tocZi); set_tomZi(structTableZi.tomZi); set_mopZi(structTableZi.mopZi); set_mouZi(structTableZi.mouZi); return; } /////////////////////////////////////////////////// char* T_SCH_DUM::getName(){ return("T_SCH_DUM"); } /////////////////////////////////////////////////// int T_SCH_DUM::getSqlCode(){ return( db.dbSqlCode); } int T_SCH_DUM::getRowsProcessed(){ return( db.dbRowsProcessed); }