377 lines
8.5 KiB
C++
377 lines
8.5 KiB
C++
|
|
// Version: 2019.4.4 10:22:45
|
||
|
|
|
||
|
|
// File: T_TRK_CUT.cpp
|
||
|
|
|
||
|
|
#include "T_TRK_CUT.h"
|
||
|
|
|
||
|
|
T_TRK_CUT::T_TRK_CUT(){
|
||
|
|
// initialise all membervariables
|
||
|
|
initial();
|
||
|
|
}
|
||
|
|
T_TRK_CUT::~T_TRK_CUT(){
|
||
|
|
}
|
||
|
|
void T_TRK_CUT::initial(){
|
||
|
|
// initialise all membervariables
|
||
|
|
set_extId((char*)"");
|
||
|
|
set_entId((char*)"");
|
||
|
|
set_entIdZi(-1);
|
||
|
|
set_mode(0);
|
||
|
|
set_modeZi(-1);
|
||
|
|
set_start(0);
|
||
|
|
set_startZi(-1);
|
||
|
|
set_end(0);
|
||
|
|
set_endZi(-1);
|
||
|
|
set_TC((char*)"");
|
||
|
|
set_TCZi(-1);
|
||
|
|
// initialies Primary key members
|
||
|
|
set_k_extId((char*)"");
|
||
|
|
}
|
||
|
|
T_TRK_CUT::T_TRK_CUT(const char* arg1)
|
||
|
|
{
|
||
|
|
initial();
|
||
|
|
setPrimKey (arg1);
|
||
|
|
//read DB record
|
||
|
|
dbAccess = true;
|
||
|
|
dbMessage = readDB();
|
||
|
|
if ( dbMessage != NULL ) {dbAccess = false;}
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT:: execute(const char* sql , long* count){
|
||
|
|
return( db.execute( sql , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT:: dbCommit(){
|
||
|
|
return( db.dbCommit( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT:: dbRollback(){
|
||
|
|
return( db.dbRollback( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::readDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.readDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::updateDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.updateDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::insertDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.insertDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::deleteDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::deleteDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::openSetDB(const char * where,const char* order){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.openSetDB( where , order ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::countDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.countDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::getSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.getSetDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::closeSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.closeSetDB() );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::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_TRK_CUT
|
||
|
|
//
|
||
|
|
// this methode stores the unique key attributes
|
||
|
|
//
|
||
|
|
void T_TRK_CUT::setPrimKey( const char* arg1 ){
|
||
|
|
strncpy( (char*)c_k_extId , arg1 , sizeof(c_k_extId) );
|
||
|
|
c_k_extId[sizeof(c_k_extId)-1] = '\0';
|
||
|
|
} // end of methode
|
||
|
|
|
||
|
|
void T_TRK_CUT::initInsertKeys( const char* arg1 ){
|
||
|
|
setPrimKey ( arg1);
|
||
|
|
strncpy( (char*)c_extId , arg1 , sizeof(c_extId) );
|
||
|
|
c_extId[sizeof(c_extId)-1] = '\0';
|
||
|
|
} // end of methode
|
||
|
|
void T_TRK_CUT::setKeysFromRecord(){
|
||
|
|
set_k_extId( extId() );
|
||
|
|
} // end of methode
|
||
|
|
//
|
||
|
|
//O P E R A T O R +
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
T_TRK_CUT T_TRK_CUT::operator+(const T_TRK_CUT &inst) const{
|
||
|
|
T_TRK_CUT ptrT_TRK_CUT(*this);
|
||
|
|
//----------------------------------------------------------
|
||
|
|
ptrT_TRK_CUT.set_extId(inst.extId());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.entIdZi() != -1){
|
||
|
|
ptrT_TRK_CUT.set_entId(inst.entId());
|
||
|
|
ptrT_TRK_CUT.set_entIdZi(inst.entIdZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.modeZi() != -1){
|
||
|
|
ptrT_TRK_CUT.set_mode(inst.mode());
|
||
|
|
ptrT_TRK_CUT.set_modeZi(inst.modeZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.startZi() != -1){
|
||
|
|
ptrT_TRK_CUT.set_start(inst.start());
|
||
|
|
ptrT_TRK_CUT.set_startZi(inst.startZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.endZi() != -1){
|
||
|
|
ptrT_TRK_CUT.set_end(inst.end());
|
||
|
|
ptrT_TRK_CUT.set_endZi(inst.endZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.TCZi() != -1){
|
||
|
|
ptrT_TRK_CUT.set_TC(inst.TC());
|
||
|
|
ptrT_TRK_CUT.set_TCZi(inst.TCZi());
|
||
|
|
}
|
||
|
|
return (ptrT_TRK_CUT);
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
//O P E R A T O R =
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
const T_TRK_CUT& T_TRK_CUT::operator=(const T_TRK_CUT &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_extId(inst.extId());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_entId(inst.entId());
|
||
|
|
this->set_entIdZi(inst.entIdZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_mode(inst.mode());
|
||
|
|
this->set_modeZi(inst.modeZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_start(inst.start());
|
||
|
|
this->set_startZi(inst.startZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_end(inst.end());
|
||
|
|
this->set_endZi(inst.endZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_TC(inst.TC());
|
||
|
|
this->set_TCZi(inst.TCZi());
|
||
|
|
return (*this);
|
||
|
|
}
|
||
|
|
//
|
||
|
|
//C O P Y - C O N S T R U C T O R
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
T_TRK_CUT::T_TRK_CUT(const T_TRK_CUT &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_extId(inst.extId());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_entId(inst.entId());
|
||
|
|
this->set_entIdZi(inst.entIdZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_mode(inst.mode());
|
||
|
|
this->set_modeZi(inst.modeZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_start(inst.start());
|
||
|
|
this->set_startZi(inst.startZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_end(inst.end());
|
||
|
|
this->set_endZi(inst.endZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_TC(inst.TC());
|
||
|
|
this->set_TCZi(inst.TCZi());
|
||
|
|
}
|
||
|
|
char* T_TRK_CUT::extId() const{
|
||
|
|
return((char*)c_extId );
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_extId( const char* arg ){
|
||
|
|
strncpy((char*)c_extId , arg , sizeof(c_extId));
|
||
|
|
c_extId[sizeof(c_extId)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
char* T_TRK_CUT::entId() const{
|
||
|
|
return((char*)c_entId );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_CUT::entIdZi() const{
|
||
|
|
return( s_entIdZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_entId( const char* arg ){
|
||
|
|
strncpy((char*)c_entId , arg , sizeof(c_entId));
|
||
|
|
c_entId[sizeof(c_entId)-1] = '\0';
|
||
|
|
s_entIdZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_entIdZi( short arg ) {
|
||
|
|
s_entIdZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
long T_TRK_CUT::mode() const{
|
||
|
|
return((long)l_mode );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_CUT::modeZi() const{
|
||
|
|
return( s_modeZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_mode( long arg ){
|
||
|
|
l_mode = arg;
|
||
|
|
s_modeZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_modeZi( short arg ) {
|
||
|
|
s_modeZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
long T_TRK_CUT::start() const{
|
||
|
|
return((long)l_start );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_CUT::startZi() const{
|
||
|
|
return( s_startZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_start( long arg ){
|
||
|
|
l_start = arg;
|
||
|
|
s_startZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_startZi( short arg ) {
|
||
|
|
s_startZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
long T_TRK_CUT::end() const{
|
||
|
|
return((long)l_end );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_CUT::endZi() const{
|
||
|
|
return( s_endZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_end( long arg ){
|
||
|
|
l_end = arg;
|
||
|
|
s_endZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_endZi( short arg ) {
|
||
|
|
s_endZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_TRK_CUT::TC() const{
|
||
|
|
return((char*)c_TC );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_TRK_CUT::TCZi() const{
|
||
|
|
return( s_TCZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_TC( char* arg ){
|
||
|
|
strncpy((char*)c_TC , arg , sizeof(c_TC));
|
||
|
|
c_TC[sizeof(c_TC)-1] = '\0';
|
||
|
|
s_TCZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_TCZi( short arg ) {
|
||
|
|
s_TCZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
// methodes for Primary key
|
||
|
|
char* T_TRK_CUT::k_extId(){
|
||
|
|
return((char*)c_k_extId );
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_TRK_CUT::set_k_extId( char* arg ){
|
||
|
|
strncpy((char*)c_k_extId , arg , sizeof(c_k_extId));
|
||
|
|
c_k_extId[sizeof(c_k_extId)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
// public methode fillStructure
|
||
|
|
//
|
||
|
|
// this methode filles the classstructue with the private attributes
|
||
|
|
//
|
||
|
|
void T_TRK_CUT::fillStructure(){
|
||
|
|
strncpy ( structTable.extId , extId(),sizeof(structTable.extId));
|
||
|
|
strncpy ( structTable.entId , entId(),sizeof(structTable.entId));
|
||
|
|
structTable.mode = mode();
|
||
|
|
structTable.start = start();
|
||
|
|
structTable.end = end();
|
||
|
|
strncpy ( structTable.TC , TC(),sizeof(structTable.TC));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_TRK_CUT::fillStructureZi(){
|
||
|
|
structTableZi.entIdZi = entIdZi();
|
||
|
|
structTableZi.modeZi = modeZi();
|
||
|
|
structTableZi.startZi = startZi();
|
||
|
|
structTableZi.endZi = endZi();
|
||
|
|
structTableZi.TCZi = TCZi();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_TRK_CUT::setStructure() {
|
||
|
|
set_entId( structTable.entId);
|
||
|
|
set_mode( structTable.mode);
|
||
|
|
set_start( structTable.start);
|
||
|
|
set_end( structTable.end);
|
||
|
|
set_TC( structTable.TC);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_TRK_CUT::setStructureZi() {
|
||
|
|
set_entIdZi( structTableZi.entIdZi);
|
||
|
|
set_modeZi( structTableZi.modeZi);
|
||
|
|
set_startZi( structTableZi.startZi);
|
||
|
|
set_endZi( structTableZi.endZi);
|
||
|
|
set_TCZi( structTableZi.TCZi);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
char* T_TRK_CUT::getName(){
|
||
|
|
return((char*)"T_TRK_CUT");
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
int T_TRK_CUT::getSqlCode(){
|
||
|
|
return( db.dbSqlCode);
|
||
|
|
}
|
||
|
|
int T_TRK_CUT::getRowsProcessed(){
|
||
|
|
return( db.dbRowsProcessed);
|
||
|
|
}
|