452 lines
11 KiB
C++
452 lines
11 KiB
C++
|
|
// Version: 2014.7.30 16:47:28
|
||
|
|
|
||
|
|
// File: T_LOV_TURN.cpp
|
||
|
|
|
||
|
|
#include "T_LOV_TURN.h"
|
||
|
|
|
||
|
|
T_LOV_TURN::T_LOV_TURN(){
|
||
|
|
// initialise all membervariables
|
||
|
|
initial();
|
||
|
|
}
|
||
|
|
T_LOV_TURN::~T_LOV_TURN(){
|
||
|
|
}
|
||
|
|
void T_LOV_TURN::initial(){
|
||
|
|
// initialise all membervariables
|
||
|
|
set_Turn("");
|
||
|
|
set_ShiftLeaderNO("");
|
||
|
|
set_ShiftLeaderNOZi(-1);
|
||
|
|
set_ShiftLeaderName("");
|
||
|
|
set_ShiftLeaderNameZi(-1);
|
||
|
|
set_Desp("");
|
||
|
|
set_DespZi(-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_Turn("");
|
||
|
|
}
|
||
|
|
T_LOV_TURN::T_LOV_TURN(const char* arg1)
|
||
|
|
{
|
||
|
|
initial();
|
||
|
|
setPrimKey (arg1);
|
||
|
|
//read DB record
|
||
|
|
dbAccess = true;
|
||
|
|
dbMessage = readDB();
|
||
|
|
if ( dbMessage != NULL ) {dbAccess = false;}
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN:: execute(const char* sql , long* count){
|
||
|
|
return( db.execute( sql , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN:: dbCommit(){
|
||
|
|
return( db.dbCommit( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN:: dbRollback(){
|
||
|
|
return( db.dbRollback( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::readDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.readDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::updateDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.updateDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::insertDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.insertDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::deleteDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::deleteDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::openSetDB(const char * where,const char* order){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.openSetDB( where , order ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::countDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.countDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::getSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.getSetDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::closeSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.closeSetDB() );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::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_TURN
|
||
|
|
//
|
||
|
|
// this methode stores the unique key attributes
|
||
|
|
//
|
||
|
|
void T_LOV_TURN::setPrimKey( const char* arg1 ){
|
||
|
|
strncpy( (char*)c_k_Turn , arg1 , sizeof(c_k_Turn) );
|
||
|
|
c_k_Turn[sizeof(c_k_Turn)-1] = '\0';
|
||
|
|
} // end of methode
|
||
|
|
|
||
|
|
void T_LOV_TURN::initInsertKeys( const char* arg1 ){
|
||
|
|
setPrimKey ( arg1);
|
||
|
|
strncpy( (char*)c_Turn , arg1 , sizeof(c_Turn) );
|
||
|
|
c_Turn[sizeof(c_Turn)-1] = '\0';
|
||
|
|
} // end of methode
|
||
|
|
void T_LOV_TURN::setKeysFromRecord(){
|
||
|
|
set_k_Turn( Turn() );
|
||
|
|
} // end of methode
|
||
|
|
//
|
||
|
|
//O P E R A T O R +
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
T_LOV_TURN T_LOV_TURN::operator+(const T_LOV_TURN &inst) const{
|
||
|
|
T_LOV_TURN ptrT_LOV_TURN(*this);
|
||
|
|
//----------------------------------------------------------
|
||
|
|
ptrT_LOV_TURN.set_Turn(inst.Turn());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.ShiftLeaderNOZi() != -1){
|
||
|
|
ptrT_LOV_TURN.set_ShiftLeaderNO(inst.ShiftLeaderNO());
|
||
|
|
ptrT_LOV_TURN.set_ShiftLeaderNOZi(inst.ShiftLeaderNOZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.ShiftLeaderNameZi() != -1){
|
||
|
|
ptrT_LOV_TURN.set_ShiftLeaderName(inst.ShiftLeaderName());
|
||
|
|
ptrT_LOV_TURN.set_ShiftLeaderNameZi(inst.ShiftLeaderNameZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.DespZi() != -1){
|
||
|
|
ptrT_LOV_TURN.set_Desp(inst.Desp());
|
||
|
|
ptrT_LOV_TURN.set_DespZi(inst.DespZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.tocZi() != -1){
|
||
|
|
ptrT_LOV_TURN.set_toc(inst.toc());
|
||
|
|
ptrT_LOV_TURN.set_tocZi(inst.tocZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.tomZi() != -1){
|
||
|
|
ptrT_LOV_TURN.set_tom(inst.tom());
|
||
|
|
ptrT_LOV_TURN.set_tomZi(inst.tomZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.mopZi() != -1){
|
||
|
|
ptrT_LOV_TURN.set_mop(inst.mop());
|
||
|
|
ptrT_LOV_TURN.set_mopZi(inst.mopZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.mouZi() != -1){
|
||
|
|
ptrT_LOV_TURN.set_mou(inst.mou());
|
||
|
|
ptrT_LOV_TURN.set_mouZi(inst.mouZi());
|
||
|
|
}
|
||
|
|
return (ptrT_LOV_TURN);
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
//O P E R A T O R =
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
const T_LOV_TURN& T_LOV_TURN::operator=(const T_LOV_TURN &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Turn(inst.Turn());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_ShiftLeaderNO(inst.ShiftLeaderNO());
|
||
|
|
this->set_ShiftLeaderNOZi(inst.ShiftLeaderNOZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_ShiftLeaderName(inst.ShiftLeaderName());
|
||
|
|
this->set_ShiftLeaderNameZi(inst.ShiftLeaderNameZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Desp(inst.Desp());
|
||
|
|
this->set_DespZi(inst.DespZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
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_TURN::T_LOV_TURN(const T_LOV_TURN &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Turn(inst.Turn());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_ShiftLeaderNO(inst.ShiftLeaderNO());
|
||
|
|
this->set_ShiftLeaderNOZi(inst.ShiftLeaderNOZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_ShiftLeaderName(inst.ShiftLeaderName());
|
||
|
|
this->set_ShiftLeaderNameZi(inst.ShiftLeaderNameZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Desp(inst.Desp());
|
||
|
|
this->set_DespZi(inst.DespZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
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_LOV_TURN::Turn() const{
|
||
|
|
return((char*)c_Turn );
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void T_LOV_TURN::set_Turn( const char* arg ){
|
||
|
|
strncpy((char*)c_Turn , arg , sizeof(c_Turn));
|
||
|
|
c_Turn[sizeof(c_Turn)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
char* T_LOV_TURN::ShiftLeaderNO() const{
|
||
|
|
return((char*)c_ShiftLeaderNO );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_TURN::ShiftLeaderNOZi() const{
|
||
|
|
return( s_ShiftLeaderNOZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::set_ShiftLeaderNO( const char* arg ){
|
||
|
|
strncpy((char*)c_ShiftLeaderNO , arg , sizeof(c_ShiftLeaderNO));
|
||
|
|
c_ShiftLeaderNO[sizeof(c_ShiftLeaderNO)-1] = '\0';
|
||
|
|
s_ShiftLeaderNOZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::set_ShiftLeaderNOZi( short arg ) {
|
||
|
|
s_ShiftLeaderNOZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::ShiftLeaderName() const{
|
||
|
|
return((char*)c_ShiftLeaderName );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_TURN::ShiftLeaderNameZi() const{
|
||
|
|
return( s_ShiftLeaderNameZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::set_ShiftLeaderName( const char* arg ){
|
||
|
|
strncpy((char*)c_ShiftLeaderName , arg , sizeof(c_ShiftLeaderName));
|
||
|
|
c_ShiftLeaderName[sizeof(c_ShiftLeaderName)-1] = '\0';
|
||
|
|
s_ShiftLeaderNameZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::set_ShiftLeaderNameZi( short arg ) {
|
||
|
|
s_ShiftLeaderNameZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::Desp() const{
|
||
|
|
return((char*)c_Desp );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_TURN::DespZi() const{
|
||
|
|
return( s_DespZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::set_Desp( const char* arg ){
|
||
|
|
strncpy((char*)c_Desp , arg , sizeof(c_Desp));
|
||
|
|
c_Desp[sizeof(c_Desp)-1] = '\0';
|
||
|
|
s_DespZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::set_DespZi( short arg ) {
|
||
|
|
s_DespZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::toc() const{
|
||
|
|
return((char*)c_toc );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_TURN::tocZi() const{
|
||
|
|
return( s_tocZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::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_TURN::set_tocZi( short arg ){
|
||
|
|
s_tocZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::tom() const{
|
||
|
|
return((char*)c_tom );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_TURN::tomZi() const{
|
||
|
|
return( s_tomZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::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_TURN::set_tomZi( short arg ){
|
||
|
|
s_tomZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::mop() const{
|
||
|
|
return((char*)c_mop );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_TURN::mopZi() const{
|
||
|
|
return( s_mopZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::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_TURN::set_mopZi( short arg ){
|
||
|
|
s_mopZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_LOV_TURN::mou() const{
|
||
|
|
return((char*)c_mou );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_LOV_TURN::mouZi() const{
|
||
|
|
return( s_mouZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::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_TURN::set_mouZi( short arg ){
|
||
|
|
s_mouZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
// methodes for Primary key
|
||
|
|
char* T_LOV_TURN::k_Turn(){
|
||
|
|
return((char*)c_k_Turn );
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_LOV_TURN::set_k_Turn( char* arg ){
|
||
|
|
strncpy((char*)c_k_Turn , arg , sizeof(c_k_Turn));
|
||
|
|
c_k_Turn[sizeof(c_k_Turn)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
// public methode fillStructure
|
||
|
|
//
|
||
|
|
// this methode filles the classstructue with the private attributes
|
||
|
|
//
|
||
|
|
void T_LOV_TURN::fillStructure(){
|
||
|
|
strncpy ( structTable.Turn , Turn(),sizeof(structTable.Turn));
|
||
|
|
strncpy ( structTable.ShiftLeaderNO , ShiftLeaderNO(),sizeof(structTable.ShiftLeaderNO));
|
||
|
|
strncpy ( structTable.ShiftLeaderName , ShiftLeaderName(),sizeof(structTable.ShiftLeaderName));
|
||
|
|
strncpy ( structTable.Desp , Desp(),sizeof(structTable.Desp));
|
||
|
|
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_TURN::fillStructureZi(){
|
||
|
|
structTableZi.ShiftLeaderNOZi = ShiftLeaderNOZi();
|
||
|
|
structTableZi.ShiftLeaderNameZi = ShiftLeaderNameZi();
|
||
|
|
structTableZi.DespZi = DespZi();
|
||
|
|
structTableZi.tocZi = tocZi();
|
||
|
|
structTableZi.tomZi = tomZi();
|
||
|
|
structTableZi.mopZi = mopZi();
|
||
|
|
structTableZi.mouZi = mouZi();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_LOV_TURN::setStructure() {
|
||
|
|
set_ShiftLeaderNO( structTable.ShiftLeaderNO);
|
||
|
|
set_ShiftLeaderName( structTable.ShiftLeaderName);
|
||
|
|
set_Desp( structTable.Desp);
|
||
|
|
set_toc(structTable.toc);
|
||
|
|
set_tom(structTable.tom);
|
||
|
|
set_mop(structTable.mop);
|
||
|
|
set_mou(structTable.mou);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_LOV_TURN::setStructureZi() {
|
||
|
|
set_ShiftLeaderNOZi( structTableZi.ShiftLeaderNOZi);
|
||
|
|
set_ShiftLeaderNameZi( structTableZi.ShiftLeaderNameZi);
|
||
|
|
set_DespZi( structTableZi.DespZi);
|
||
|
|
set_tocZi(structTableZi.tocZi);
|
||
|
|
set_tomZi(structTableZi.tomZi);
|
||
|
|
set_mopZi(structTableZi.mopZi);
|
||
|
|
set_mouZi(structTableZi.mouZi);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
char* T_LOV_TURN::getName(){
|
||
|
|
return("T_LOV_TURN");
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
int T_LOV_TURN::getSqlCode(){
|
||
|
|
return( db.dbSqlCode);
|
||
|
|
}
|
||
|
|
int T_LOV_TURN::getRowsProcessed(){
|
||
|
|
return( db.dbRowsProcessed);
|
||
|
|
}
|