502 lines
12 KiB
C++
502 lines
12 KiB
C++
// Version: 2014.7.30 16:47:28
|
|
|
|
// File: T_LOV_SHIFT.cpp
|
|
|
|
#include "T_LOV_SHIFT.h"
|
|
|
|
T_LOV_SHIFT::T_LOV_SHIFT(){
|
|
// initialise all membervariables
|
|
initial();
|
|
}
|
|
T_LOV_SHIFT::~T_LOV_SHIFT(){
|
|
}
|
|
void T_LOV_SHIFT::initial(){
|
|
// initialise all membervariables
|
|
set_Shift("");
|
|
set_ShiftOffset(0);
|
|
set_ShiftName("");
|
|
set_ShiftDuration(0);
|
|
set_NextShift("");
|
|
set_Actual(0);
|
|
set_Turn("");
|
|
set_DayChange(0);
|
|
set_DayChangeZi(-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_Shift("");
|
|
}
|
|
T_LOV_SHIFT::T_LOV_SHIFT(const char* arg1)
|
|
{
|
|
initial();
|
|
setPrimKey (arg1);
|
|
//read DB record
|
|
dbAccess = true;
|
|
dbMessage = readDB();
|
|
if ( dbMessage != NULL ) {dbAccess = false;}
|
|
}
|
|
|
|
char* T_LOV_SHIFT:: execute(const char* sql , long* count){
|
|
return( db.execute( sql , count ) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT:: dbCommit(){
|
|
return( db.dbCommit( ) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT:: dbRollback(){
|
|
return( db.dbRollback( ) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::readDB(){
|
|
// DB Trace is off
|
|
return( db.readDB(*this) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::updateDB(){
|
|
// DB Trace is off
|
|
return( db.updateDB(*this) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::insertDB(){
|
|
// DB Trace is off
|
|
return( db.insertDB(*this) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::deleteDB(){
|
|
// DB Trace is off
|
|
return( db.deleteDB(*this) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::deleteDB(const char * where, long* count){
|
|
// DB Trace is off
|
|
return( db.deleteDB( where , count ) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::openSetDB(const char * where,const char* order){
|
|
// DB Trace is off
|
|
return( db.openSetDB( where , order ) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::countDB(const char * where, long* count){
|
|
// DB Trace is off
|
|
return( db.countDB( where , count ) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::getSetDB(){
|
|
// DB Trace is off
|
|
return( db.getSetDB(*this) );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::closeSetDB(){
|
|
// DB Trace is off
|
|
return( db.closeSetDB() );
|
|
}
|
|
|
|
char* T_LOV_SHIFT::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_SHIFT
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void T_LOV_SHIFT::setPrimKey( const char* arg1 ){
|
|
strncpy( (char*)c_k_Shift , arg1 , sizeof(c_k_Shift) );
|
|
c_k_Shift[sizeof(c_k_Shift)-1] = '\0';
|
|
} // end of methode
|
|
|
|
void T_LOV_SHIFT::initInsertKeys( const char* arg1 ){
|
|
setPrimKey ( arg1);
|
|
strncpy( (char*)c_Shift , arg1 , sizeof(c_Shift) );
|
|
c_Shift[sizeof(c_Shift)-1] = '\0';
|
|
} // end of methode
|
|
void T_LOV_SHIFT::setKeysFromRecord(){
|
|
set_k_Shift( Shift() );
|
|
} // end of methode
|
|
//
|
|
//O P E R A T O R +
|
|
//===================
|
|
//
|
|
T_LOV_SHIFT T_LOV_SHIFT::operator+(const T_LOV_SHIFT &inst) const{
|
|
T_LOV_SHIFT ptrT_LOV_SHIFT(*this);
|
|
//----------------------------------------------------------
|
|
ptrT_LOV_SHIFT.set_Shift(inst.Shift());
|
|
//----------------------------------------------------------
|
|
ptrT_LOV_SHIFT.set_ShiftOffset(inst.ShiftOffset());
|
|
//----------------------------------------------------------
|
|
ptrT_LOV_SHIFT.set_ShiftName(inst.ShiftName());
|
|
//----------------------------------------------------------
|
|
ptrT_LOV_SHIFT.set_ShiftDuration(inst.ShiftDuration());
|
|
//----------------------------------------------------------
|
|
ptrT_LOV_SHIFT.set_NextShift(inst.NextShift());
|
|
//----------------------------------------------------------
|
|
ptrT_LOV_SHIFT.set_Actual(inst.Actual());
|
|
//----------------------------------------------------------
|
|
ptrT_LOV_SHIFT.set_Turn(inst.Turn());
|
|
//----------------------------------------------------------
|
|
if(inst.DayChangeZi() != -1){
|
|
ptrT_LOV_SHIFT.set_DayChange(inst.DayChange());
|
|
ptrT_LOV_SHIFT.set_DayChangeZi(inst.DayChangeZi());
|
|
}
|
|
//----------------------------------------------------------
|
|
if(inst.tocZi() != -1){
|
|
ptrT_LOV_SHIFT.set_toc(inst.toc());
|
|
ptrT_LOV_SHIFT.set_tocZi(inst.tocZi());
|
|
}
|
|
//----------------------------------------------------------
|
|
if(inst.tomZi() != -1){
|
|
ptrT_LOV_SHIFT.set_tom(inst.tom());
|
|
ptrT_LOV_SHIFT.set_tomZi(inst.tomZi());
|
|
}
|
|
//----------------------------------------------------------
|
|
if(inst.mopZi() != -1){
|
|
ptrT_LOV_SHIFT.set_mop(inst.mop());
|
|
ptrT_LOV_SHIFT.set_mopZi(inst.mopZi());
|
|
}
|
|
//----------------------------------------------------------
|
|
if(inst.mouZi() != -1){
|
|
ptrT_LOV_SHIFT.set_mou(inst.mou());
|
|
ptrT_LOV_SHIFT.set_mouZi(inst.mouZi());
|
|
}
|
|
return (ptrT_LOV_SHIFT);
|
|
}
|
|
|
|
//
|
|
//O P E R A T O R =
|
|
//===================
|
|
//
|
|
const T_LOV_SHIFT& T_LOV_SHIFT::operator=(const T_LOV_SHIFT &inst){
|
|
//----------------------------------------------------------
|
|
this->set_Shift(inst.Shift());
|
|
//----------------------------------------------------------
|
|
this->set_ShiftOffset(inst.ShiftOffset());
|
|
//----------------------------------------------------------
|
|
this->set_ShiftName(inst.ShiftName());
|
|
//----------------------------------------------------------
|
|
this->set_ShiftDuration(inst.ShiftDuration());
|
|
//----------------------------------------------------------
|
|
this->set_NextShift(inst.NextShift());
|
|
//----------------------------------------------------------
|
|
this->set_Actual(inst.Actual());
|
|
//----------------------------------------------------------
|
|
this->set_Turn(inst.Turn());
|
|
//----------------------------------------------------------
|
|
this->set_DayChange(inst.DayChange());
|
|
this->set_DayChangeZi(inst.DayChangeZi());
|
|
//----------------------------------------------------------
|
|
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_SHIFT::T_LOV_SHIFT(const T_LOV_SHIFT &inst){
|
|
//----------------------------------------------------------
|
|
this->set_Shift(inst.Shift());
|
|
//----------------------------------------------------------
|
|
this->set_ShiftOffset(inst.ShiftOffset());
|
|
//----------------------------------------------------------
|
|
this->set_ShiftName(inst.ShiftName());
|
|
//----------------------------------------------------------
|
|
this->set_ShiftDuration(inst.ShiftDuration());
|
|
//----------------------------------------------------------
|
|
this->set_NextShift(inst.NextShift());
|
|
//----------------------------------------------------------
|
|
this->set_Actual(inst.Actual());
|
|
//----------------------------------------------------------
|
|
this->set_Turn(inst.Turn());
|
|
//----------------------------------------------------------
|
|
this->set_DayChange(inst.DayChange());
|
|
this->set_DayChangeZi(inst.DayChangeZi());
|
|
//----------------------------------------------------------
|
|
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_SHIFT::Shift() const{
|
|
return((char*)c_Shift );
|
|
}
|
|
|
|
|
|
void T_LOV_SHIFT::set_Shift( const char* arg ){
|
|
strncpy((char*)c_Shift , arg , sizeof(c_Shift));
|
|
c_Shift[sizeof(c_Shift)-1] = '\0';
|
|
return;
|
|
}
|
|
|
|
|
|
long T_LOV_SHIFT::ShiftOffset() const{
|
|
return((long)l_ShiftOffset );
|
|
}
|
|
|
|
|
|
void T_LOV_SHIFT::set_ShiftOffset( long arg ){
|
|
l_ShiftOffset = arg;
|
|
return;
|
|
}
|
|
|
|
|
|
char* T_LOV_SHIFT::ShiftName() const{
|
|
return((char*)c_ShiftName );
|
|
}
|
|
|
|
|
|
void T_LOV_SHIFT::set_ShiftName( const char* arg ){
|
|
strncpy((char*)c_ShiftName , arg , sizeof(c_ShiftName));
|
|
c_ShiftName[sizeof(c_ShiftName)-1] = '\0';
|
|
return;
|
|
}
|
|
|
|
|
|
long T_LOV_SHIFT::ShiftDuration() const{
|
|
return((long)l_ShiftDuration );
|
|
}
|
|
|
|
|
|
void T_LOV_SHIFT::set_ShiftDuration( long arg ){
|
|
l_ShiftDuration = arg;
|
|
return;
|
|
}
|
|
|
|
|
|
char* T_LOV_SHIFT::NextShift() const{
|
|
return((char*)c_NextShift );
|
|
}
|
|
|
|
|
|
void T_LOV_SHIFT::set_NextShift( const char* arg ){
|
|
strncpy((char*)c_NextShift , arg , sizeof(c_NextShift));
|
|
c_NextShift[sizeof(c_NextShift)-1] = '\0';
|
|
return;
|
|
}
|
|
|
|
|
|
long T_LOV_SHIFT::Actual() const{
|
|
return((long)l_Actual );
|
|
}
|
|
|
|
|
|
void T_LOV_SHIFT::set_Actual( long arg ){
|
|
l_Actual = arg;
|
|
return;
|
|
}
|
|
|
|
|
|
char* T_LOV_SHIFT::Turn() const{
|
|
return((char*)c_Turn );
|
|
}
|
|
|
|
|
|
void T_LOV_SHIFT::set_Turn( const char* arg ){
|
|
strncpy((char*)c_Turn , arg , sizeof(c_Turn));
|
|
c_Turn[sizeof(c_Turn)-1] = '\0';
|
|
return;
|
|
}
|
|
|
|
|
|
long T_LOV_SHIFT::DayChange() const{
|
|
return((long)l_DayChange );
|
|
}
|
|
|
|
short T_LOV_SHIFT::DayChangeZi() const{
|
|
return( s_DayChangeZi);
|
|
}
|
|
|
|
void T_LOV_SHIFT::set_DayChange( long arg ){
|
|
l_DayChange = arg;
|
|
s_DayChangeZi= 0;
|
|
return;
|
|
}
|
|
|
|
void T_LOV_SHIFT::set_DayChangeZi( short arg ) {
|
|
s_DayChangeZi = arg;
|
|
}
|
|
|
|
char* T_LOV_SHIFT::toc() const{
|
|
return((char*)c_toc );
|
|
}
|
|
|
|
short T_LOV_SHIFT::tocZi() const{
|
|
return( s_tocZi);
|
|
}
|
|
|
|
void T_LOV_SHIFT::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_SHIFT::set_tocZi( short arg ){
|
|
s_tocZi = arg;
|
|
}
|
|
|
|
char* T_LOV_SHIFT::tom() const{
|
|
return((char*)c_tom );
|
|
}
|
|
|
|
short T_LOV_SHIFT::tomZi() const{
|
|
return( s_tomZi);
|
|
}
|
|
|
|
void T_LOV_SHIFT::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_SHIFT::set_tomZi( short arg ){
|
|
s_tomZi = arg;
|
|
}
|
|
|
|
char* T_LOV_SHIFT::mop() const{
|
|
return((char*)c_mop );
|
|
}
|
|
|
|
short T_LOV_SHIFT::mopZi() const{
|
|
return( s_mopZi);
|
|
}
|
|
|
|
void T_LOV_SHIFT::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_SHIFT::set_mopZi( short arg ){
|
|
s_mopZi = arg;
|
|
}
|
|
|
|
char* T_LOV_SHIFT::mou() const{
|
|
return((char*)c_mou );
|
|
}
|
|
|
|
short T_LOV_SHIFT::mouZi() const{
|
|
return( s_mouZi);
|
|
}
|
|
|
|
void T_LOV_SHIFT::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_SHIFT::set_mouZi( short arg ){
|
|
s_mouZi = arg;
|
|
}
|
|
|
|
// methodes for Primary key
|
|
char* T_LOV_SHIFT::k_Shift(){
|
|
return((char*)c_k_Shift );
|
|
}
|
|
|
|
void T_LOV_SHIFT::set_k_Shift( char* arg ){
|
|
strncpy((char*)c_k_Shift , arg , sizeof(c_k_Shift));
|
|
c_k_Shift[sizeof(c_k_Shift)-1] = '\0';
|
|
return;
|
|
}
|
|
|
|
//
|
|
// public methode fillStructure
|
|
//
|
|
// this methode filles the classstructue with the private attributes
|
|
//
|
|
void T_LOV_SHIFT::fillStructure(){
|
|
strncpy ( structTable.Shift , Shift(),sizeof(structTable.Shift));
|
|
structTable.ShiftOffset = ShiftOffset();
|
|
strncpy ( structTable.ShiftName , ShiftName(),sizeof(structTable.ShiftName));
|
|
structTable.ShiftDuration = ShiftDuration();
|
|
strncpy ( structTable.NextShift , NextShift(),sizeof(structTable.NextShift));
|
|
structTable.Actual = Actual();
|
|
strncpy ( structTable.Turn , Turn(),sizeof(structTable.Turn));
|
|
structTable.DayChange = DayChange();
|
|
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_SHIFT::fillStructureZi(){
|
|
structTableZi.DayChangeZi = DayChangeZi();
|
|
structTableZi.tocZi = tocZi();
|
|
structTableZi.tomZi = tomZi();
|
|
structTableZi.mopZi = mopZi();
|
|
structTableZi.mouZi = mouZi();
|
|
return;
|
|
}
|
|
///////////////////////////////////////////////////
|
|
void T_LOV_SHIFT::setStructure() {
|
|
set_ShiftOffset( structTable.ShiftOffset);
|
|
set_ShiftName( structTable.ShiftName);
|
|
set_ShiftDuration( structTable.ShiftDuration);
|
|
set_NextShift( structTable.NextShift);
|
|
set_Actual( structTable.Actual);
|
|
set_Turn( structTable.Turn);
|
|
set_DayChange( structTable.DayChange);
|
|
set_toc(structTable.toc);
|
|
set_tom(structTable.tom);
|
|
set_mop(structTable.mop);
|
|
set_mou(structTable.mou);
|
|
return;
|
|
}
|
|
///////////////////////////////////////////////////
|
|
void T_LOV_SHIFT::setStructureZi() {
|
|
set_DayChangeZi( structTableZi.DayChangeZi);
|
|
set_tocZi(structTableZi.tocZi);
|
|
set_tomZi(structTableZi.tomZi);
|
|
set_mopZi(structTableZi.mopZi);
|
|
set_mouZi(structTableZi.mouZi);
|
|
return;
|
|
}
|
|
///////////////////////////////////////////////////
|
|
char* T_LOV_SHIFT::getName(){
|
|
return("T_LOV_SHIFT");
|
|
}
|
|
///////////////////////////////////////////////////
|
|
int T_LOV_SHIFT::getSqlCode(){
|
|
return( db.dbSqlCode);
|
|
}
|
|
int T_LOV_SHIFT::getRowsProcessed(){
|
|
return( db.dbRowsProcessed);
|
|
}
|