eis/src/dbax/T_LOV_EXLPTEN.cpp

503 lines
12 KiB
C++

// Version: 2014.9.2 16:30:15
// File: T_LOV_EXLPTEN.cpp
#include "T_LOV_EXLPTEN.h"
T_LOV_EXLPTEN::T_LOV_EXLPTEN(){
// initialise all membervariables
initial();
}
T_LOV_EXLPTEN::~T_LOV_EXLPTEN(){
}
void T_LOV_EXLPTEN::initial(){
// initialise all membervariables
set_SGCode(0);
set_ThickMax(0);
set_ThickMin(0);
set_WidthMax(0);
set_WidthMin(0);
set_Value(0);
set_ValueZi(-1);
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_SGCode(0);
set_k_ThickMax(0);
set_k_ThickMin(0);
set_k_WidthMax(0);
set_k_WidthMin(0);
}
T_LOV_EXLPTEN::T_LOV_EXLPTEN(long arg1,long arg2,long arg3,long arg4,long arg5)
{
initial();
setPrimKey (arg1, arg2, arg3, arg4, arg5);
//read DB record
dbAccess = true;
dbMessage = readDB();
if ( dbMessage != NULL ) {dbAccess = false;}
}
char* T_LOV_EXLPTEN:: execute(const char* sql , long* count){
return( db.execute( sql , count ) );
}
char* T_LOV_EXLPTEN:: dbCommit(){
return( db.dbCommit( ) );
}
char* T_LOV_EXLPTEN:: dbRollback(){
return( db.dbRollback( ) );
}
char* T_LOV_EXLPTEN::readDB(){
// DB Trace is off
return( db.readDB(*this) );
}
char* T_LOV_EXLPTEN::updateDB(){
// DB Trace is off
return( db.updateDB(*this) );
}
char* T_LOV_EXLPTEN::insertDB(){
// DB Trace is off
return( db.insertDB(*this) );
}
char* T_LOV_EXLPTEN::deleteDB(){
// DB Trace is off
return( db.deleteDB(*this) );
}
char* T_LOV_EXLPTEN::deleteDB(const char * where, long* count){
// DB Trace is off
return( db.deleteDB( where , count ) );
}
char* T_LOV_EXLPTEN::openSetDB(const char * where,const char* order){
// DB Trace is off
return( db.openSetDB( where , order ) );
}
char* T_LOV_EXLPTEN::countDB(const char * where, long* count){
// DB Trace is off
return( db.countDB( where , count ) );
}
char* T_LOV_EXLPTEN::getSetDB(){
// DB Trace is off
return( db.getSetDB(*this) );
}
char* T_LOV_EXLPTEN::closeSetDB(){
// DB Trace is off
return( db.closeSetDB() );
}
char* T_LOV_EXLPTEN::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_EXLPTEN
//
// this methode stores the unique key attributes
//
void T_LOV_EXLPTEN::setPrimKey( long arg1 , long arg2 , long arg3 , long arg4 , long arg5 ){
l_k_SGCode = arg1;
l_k_ThickMax = arg2;
l_k_ThickMin = arg3;
l_k_WidthMax = arg4;
l_k_WidthMin = arg5;
} // end of methode
void T_LOV_EXLPTEN::initInsertKeys( long arg1 , long arg2 , long arg3 , long arg4 , long arg5 ){
setPrimKey ( arg1 , arg2 , arg3 , arg4 , arg5);
l_SGCode = arg1;
l_ThickMax = arg2;
l_ThickMin = arg3;
l_WidthMax = arg4;
l_WidthMin = arg5;
} // end of methode
void T_LOV_EXLPTEN::setKeysFromRecord(){
set_k_SGCode( SGCode() );
set_k_ThickMax( ThickMax() );
set_k_ThickMin( ThickMin() );
set_k_WidthMax( WidthMax() );
set_k_WidthMin( WidthMin() );
} // end of methode
//
//O P E R A T O R +
//===================
//
T_LOV_EXLPTEN T_LOV_EXLPTEN::operator+(const T_LOV_EXLPTEN &inst) const{
T_LOV_EXLPTEN ptrT_LOV_EXLPTEN(*this);
//----------------------------------------------------------
ptrT_LOV_EXLPTEN.set_SGCode(inst.SGCode());
//----------------------------------------------------------
ptrT_LOV_EXLPTEN.set_ThickMax(inst.ThickMax());
//----------------------------------------------------------
ptrT_LOV_EXLPTEN.set_ThickMin(inst.ThickMin());
//----------------------------------------------------------
ptrT_LOV_EXLPTEN.set_WidthMax(inst.WidthMax());
//----------------------------------------------------------
ptrT_LOV_EXLPTEN.set_WidthMin(inst.WidthMin());
//----------------------------------------------------------
if(inst.ValueZi() != -1){
ptrT_LOV_EXLPTEN.set_Value(inst.Value());
ptrT_LOV_EXLPTEN.set_ValueZi(inst.ValueZi());
}
//----------------------------------------------------------
if(inst.tocZi() != -1){
ptrT_LOV_EXLPTEN.set_toc(inst.toc());
ptrT_LOV_EXLPTEN.set_tocZi(inst.tocZi());
}
//----------------------------------------------------------
if(inst.tomZi() != -1){
ptrT_LOV_EXLPTEN.set_tom(inst.tom());
ptrT_LOV_EXLPTEN.set_tomZi(inst.tomZi());
}
//----------------------------------------------------------
if(inst.mopZi() != -1){
ptrT_LOV_EXLPTEN.set_mop(inst.mop());
ptrT_LOV_EXLPTEN.set_mopZi(inst.mopZi());
}
//----------------------------------------------------------
if(inst.mouZi() != -1){
ptrT_LOV_EXLPTEN.set_mou(inst.mou());
ptrT_LOV_EXLPTEN.set_mouZi(inst.mouZi());
}
return (ptrT_LOV_EXLPTEN);
}
//
//O P E R A T O R =
//===================
//
const T_LOV_EXLPTEN& T_LOV_EXLPTEN::operator=(const T_LOV_EXLPTEN &inst){
//----------------------------------------------------------
this->set_SGCode(inst.SGCode());
//----------------------------------------------------------
this->set_ThickMax(inst.ThickMax());
//----------------------------------------------------------
this->set_ThickMin(inst.ThickMin());
//----------------------------------------------------------
this->set_WidthMax(inst.WidthMax());
//----------------------------------------------------------
this->set_WidthMin(inst.WidthMin());
//----------------------------------------------------------
this->set_Value(inst.Value());
this->set_ValueZi(inst.ValueZi());
//----------------------------------------------------------
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_EXLPTEN::T_LOV_EXLPTEN(const T_LOV_EXLPTEN &inst){
//----------------------------------------------------------
this->set_SGCode(inst.SGCode());
//----------------------------------------------------------
this->set_ThickMax(inst.ThickMax());
//----------------------------------------------------------
this->set_ThickMin(inst.ThickMin());
//----------------------------------------------------------
this->set_WidthMax(inst.WidthMax());
//----------------------------------------------------------
this->set_WidthMin(inst.WidthMin());
//----------------------------------------------------------
this->set_Value(inst.Value());
this->set_ValueZi(inst.ValueZi());
//----------------------------------------------------------
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_EXLPTEN::SGCode() const{
return((long)l_SGCode );
}
void T_LOV_EXLPTEN::set_SGCode( long arg ){
l_SGCode = arg;
return;
}
long T_LOV_EXLPTEN::ThickMax() const{
return((long)l_ThickMax );
}
void T_LOV_EXLPTEN::set_ThickMax( long arg ){
l_ThickMax = arg;
return;
}
long T_LOV_EXLPTEN::ThickMin() const{
return((long)l_ThickMin );
}
void T_LOV_EXLPTEN::set_ThickMin( long arg ){
l_ThickMin = arg;
return;
}
long T_LOV_EXLPTEN::WidthMax() const{
return((long)l_WidthMax );
}
void T_LOV_EXLPTEN::set_WidthMax( long arg ){
l_WidthMax = arg;
return;
}
long T_LOV_EXLPTEN::WidthMin() const{
return((long)l_WidthMin );
}
void T_LOV_EXLPTEN::set_WidthMin( long arg ){
l_WidthMin = arg;
return;
}
long T_LOV_EXLPTEN::Value() const{
return((long)l_Value );
}
short T_LOV_EXLPTEN::ValueZi() const{
return( s_ValueZi);
}
void T_LOV_EXLPTEN::set_Value( long arg ){
l_Value = arg;
s_ValueZi= 0;
return;
}
void T_LOV_EXLPTEN::set_ValueZi( short arg ) {
s_ValueZi = arg;
}
char* T_LOV_EXLPTEN::toc() const{
return((char*)c_toc );
}
short T_LOV_EXLPTEN::tocZi() const{
return( s_tocZi);
}
void T_LOV_EXLPTEN::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_EXLPTEN::set_tocZi( short arg ){
s_tocZi = arg;
}
char* T_LOV_EXLPTEN::tom() const{
return((char*)c_tom );
}
short T_LOV_EXLPTEN::tomZi() const{
return( s_tomZi);
}
void T_LOV_EXLPTEN::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_EXLPTEN::set_tomZi( short arg ){
s_tomZi = arg;
}
char* T_LOV_EXLPTEN::mop() const{
return((char*)c_mop );
}
short T_LOV_EXLPTEN::mopZi() const{
return( s_mopZi);
}
void T_LOV_EXLPTEN::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_EXLPTEN::set_mopZi( short arg ){
s_mopZi = arg;
}
char* T_LOV_EXLPTEN::mou() const{
return((char*)c_mou );
}
short T_LOV_EXLPTEN::mouZi() const{
return( s_mouZi);
}
void T_LOV_EXLPTEN::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_EXLPTEN::set_mouZi( short arg ){
s_mouZi = arg;
}
// methodes for Primary key
long T_LOV_EXLPTEN::k_SGCode(){
return((long)l_k_SGCode );
}
void T_LOV_EXLPTEN::set_k_SGCode( long arg ){
l_k_SGCode = arg;
return;
}
long T_LOV_EXLPTEN::k_ThickMax(){
return((long)l_k_ThickMax );
}
void T_LOV_EXLPTEN::set_k_ThickMax( long arg ){
l_k_ThickMax = arg;
return;
}
long T_LOV_EXLPTEN::k_ThickMin(){
return((long)l_k_ThickMin );
}
void T_LOV_EXLPTEN::set_k_ThickMin( long arg ){
l_k_ThickMin = arg;
return;
}
long T_LOV_EXLPTEN::k_WidthMax(){
return((long)l_k_WidthMax );
}
void T_LOV_EXLPTEN::set_k_WidthMax( long arg ){
l_k_WidthMax = arg;
return;
}
long T_LOV_EXLPTEN::k_WidthMin(){
return((long)l_k_WidthMin );
}
void T_LOV_EXLPTEN::set_k_WidthMin( long arg ){
l_k_WidthMin = arg;
return;
}
//
// public methode fillStructure
//
// this methode filles the classstructue with the private attributes
//
void T_LOV_EXLPTEN::fillStructure(){
structTable.SGCode = SGCode();
structTable.ThickMax = ThickMax();
structTable.ThickMin = ThickMin();
structTable.WidthMax = WidthMax();
structTable.WidthMin = WidthMin();
structTable.Value = Value();
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_EXLPTEN::fillStructureZi(){
structTableZi.ValueZi = ValueZi();
structTableZi.tocZi = tocZi();
structTableZi.tomZi = tomZi();
structTableZi.mopZi = mopZi();
structTableZi.mouZi = mouZi();
return;
}
///////////////////////////////////////////////////
void T_LOV_EXLPTEN::setStructure() {
set_Value( structTable.Value);
set_toc(structTable.toc);
set_tom(structTable.tom);
set_mop(structTable.mop);
set_mou(structTable.mou);
return;
}
///////////////////////////////////////////////////
void T_LOV_EXLPTEN::setStructureZi() {
set_ValueZi( structTableZi.ValueZi);
set_tocZi(structTableZi.tocZi);
set_tomZi(structTableZi.tomZi);
set_mopZi(structTableZi.mopZi);
set_mouZi(structTableZi.mouZi);
return;
}
///////////////////////////////////////////////////
char* T_LOV_EXLPTEN::getName(){
return("T_LOV_EXLPTEN");
}
///////////////////////////////////////////////////
int T_LOV_EXLPTEN::getSqlCode(){
return( db.dbSqlCode);
}
int T_LOV_EXLPTEN::getRowsProcessed(){
return( db.dbRowsProcessed);
}