491 lines
8.7 KiB
C++
491 lines
8.7 KiB
C++
// Version: 2018.7.20 13:7:35
|
|
|
|
#ifndef _T_DOT_DATA_H
|
|
#define _T_DOT_DATA_H
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#ifdef _MSC_VER
|
|
#pragma warning(disable:4996)
|
|
#pragma warning(disable:4267)
|
|
#endif
|
|
#include "T_DOT_DATADBAX.h"
|
|
class T_DOT_DATA{
|
|
friend class T_DOT_DATADBAX;
|
|
private:
|
|
//aggregation to DB Class
|
|
T_DOT_DATADBAX db;
|
|
public:
|
|
//
|
|
//A T T R I B U T E S
|
|
//===================
|
|
//
|
|
bool dbAccess;
|
|
char* dbMessage;// pointer for the return values of DBAX methodes
|
|
char messageBuffer[200];// temporary message buffer
|
|
friend class PapLib;
|
|
protected:
|
|
//
|
|
//A T T R I B U T E S
|
|
//===================
|
|
//
|
|
long l_Seq;
|
|
char c_StopDate[27];
|
|
short s_StopDateZi;
|
|
char c_Shift[2+1];
|
|
short s_ShiftZi;
|
|
char c_Turn[2+1];
|
|
short s_TurnZi;
|
|
char c_StopStart[27];
|
|
short s_StopStartZi;
|
|
char c_StopEnd[27];
|
|
short s_StopEndZi;
|
|
long l_StopElapsed;
|
|
short s_StopElapsedZi;
|
|
char c_Code[4+1];
|
|
short s_CodeZi;
|
|
char c_Status[2+1];
|
|
short s_StatusZi;
|
|
char c_WorkLevel[8+1];
|
|
short s_WorkLevelZi;
|
|
char c_toc[27];
|
|
short s_tocZi;
|
|
char c_tom[27];
|
|
short s_tomZi;
|
|
char c_mop[121];
|
|
short s_mopZi;
|
|
char c_mou[31];
|
|
short s_mouZi;
|
|
// arguments for Primary key
|
|
long l_k_Seq;
|
|
public:
|
|
//
|
|
// LTA Structure
|
|
struct STR_T_DOT_DATA{
|
|
int Seq;
|
|
char StopDate[27];
|
|
char Shift[2+1];
|
|
char Turn[2+1];
|
|
char StopStart[27];
|
|
char StopEnd[27];
|
|
int StopElapsed;
|
|
char Code[4+1];
|
|
char Status[2+1];
|
|
char WorkLevel[8+1];
|
|
char toc[27];
|
|
char tom[27];
|
|
char mop[121];
|
|
char mou[31];
|
|
}structTable;
|
|
// LTA Structure Zi
|
|
struct STR_T_DOT_DATAZi{
|
|
short StopDateZi;
|
|
short ShiftZi;
|
|
short TurnZi;
|
|
short StopStartZi;
|
|
short StopEndZi;
|
|
short StopElapsedZi;
|
|
short CodeZi;
|
|
short StatusZi;
|
|
short WorkLevelZi;
|
|
short tocZi;
|
|
short tomZi;
|
|
short mopZi;
|
|
short mouZi;
|
|
}structTableZi;
|
|
//
|
|
//C O N S T R U C T O R S
|
|
//=======================
|
|
//
|
|
public:
|
|
T_DOT_DATA();
|
|
//D E S T R U C T O R S
|
|
//=======================
|
|
//
|
|
virtual ~T_DOT_DATA();
|
|
//
|
|
//C O P Y - C O N S T R U C T O R
|
|
//=======================
|
|
T_DOT_DATA(const T_DOT_DATA &inst);
|
|
// For Constructors with parameters the flag dbAccess
|
|
// informs you if the access was successfully or not
|
|
T_DOT_DATA( long arg1);
|
|
|
|
//methods
|
|
public:
|
|
char* getCreationTime() {return (char*)"2018.7.20 13:7:35";};
|
|
//initial data
|
|
void initial();
|
|
//read data
|
|
char* readDB();
|
|
//update data
|
|
char* updateDB();
|
|
//insert data
|
|
char* insertDB();
|
|
//this methode tries to update a DB record , when the update fails , the methode
|
|
//tries an insert of the failed record
|
|
char* storeDB();
|
|
//delete data
|
|
char* deleteDB();
|
|
//delete data
|
|
char* deleteDB(const char* where , long* count );
|
|
//openSetDB data
|
|
char* openSetDB(const char* where ,const char* order );
|
|
//getSetDB data
|
|
char* getSetDB();
|
|
//closeSetDB data
|
|
char* closeSetDB();
|
|
//countDB data
|
|
char* countDB(const char* where , long* count );
|
|
|
|
char* execute(const char* sql , long* count );
|
|
|
|
char* dbCommit();
|
|
|
|
char* dbRollback();
|
|
public:
|
|
//
|
|
// public methode setPrimKey
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void setPrimKey(long arg1 );
|
|
|
|
|
|
// public methode initInsertKeys
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void initInsertKeys( long arg1 );
|
|
|
|
|
|
public:
|
|
//
|
|
// public methode setKeysFromRecord
|
|
//
|
|
// this methode set the unique key attributes from the DB Record Attributes
|
|
//
|
|
void setKeysFromRecord();
|
|
|
|
//
|
|
//O P E R A T O R +
|
|
//===================
|
|
//
|
|
public:
|
|
T_DOT_DATA operator+(const T_DOT_DATA &inst) const;
|
|
|
|
//
|
|
//O P E R A T O R =
|
|
//===================
|
|
//
|
|
public:
|
|
const T_DOT_DATA& operator=(const T_DOT_DATA &inst);
|
|
long Seq() const;//{
|
|
//return((long)l_Seq );
|
|
//}
|
|
|
|
|
|
void set_Seq( long arg );//{
|
|
//l_Seq = arg;
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* StopDate() const;//{
|
|
//return((char*)c_StopDate );
|
|
//}
|
|
|
|
short StopDateZi() const;//{
|
|
//return( s_StopDateZi);
|
|
//}
|
|
|
|
void set_StopDate( char* arg );//{
|
|
//strncpy((char*)c_StopDate , arg , sizeof(c_StopDate));
|
|
//c_StopDate[sizeof(c_StopDate)-1] = '\0';
|
|
//s_StopDateZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_StopDateZi( short arg ) ;//{
|
|
//s_StopDateZi = arg;
|
|
//}
|
|
|
|
char* Shift() const;//{
|
|
//return((char*)c_Shift );
|
|
//}
|
|
|
|
short ShiftZi() const;//{
|
|
//return( s_ShiftZi);
|
|
//}
|
|
|
|
void set_Shift( const char* arg );//{
|
|
//strncpy((char*)c_Shift , arg , sizeof(c_Shift));
|
|
//c_Shift[sizeof(c_Shift)-1] = '\0';
|
|
//s_ShiftZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_ShiftZi( short arg ) ;//{
|
|
//s_ShiftZi = arg;
|
|
//}
|
|
|
|
char* Turn() const;//{
|
|
//return((char*)c_Turn );
|
|
//}
|
|
|
|
short TurnZi() const;//{
|
|
//return( s_TurnZi);
|
|
//}
|
|
|
|
void set_Turn( const char* arg );//{
|
|
//strncpy((char*)c_Turn , arg , sizeof(c_Turn));
|
|
//c_Turn[sizeof(c_Turn)-1] = '\0';
|
|
//s_TurnZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_TurnZi( short arg ) ;//{
|
|
//s_TurnZi = arg;
|
|
//}
|
|
|
|
char* StopStart() const;//{
|
|
//return((char*)c_StopStart );
|
|
//}
|
|
|
|
short StopStartZi() const;//{
|
|
//return( s_StopStartZi);
|
|
//}
|
|
|
|
void set_StopStart( char* arg );//{
|
|
//strncpy((char*)c_StopStart , arg , sizeof(c_StopStart));
|
|
//c_StopStart[sizeof(c_StopStart)-1] = '\0';
|
|
//s_StopStartZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_StopStartZi( short arg ) ;//{
|
|
//s_StopStartZi = arg;
|
|
//}
|
|
|
|
char* StopEnd() const;//{
|
|
//return((char*)c_StopEnd );
|
|
//}
|
|
|
|
short StopEndZi() const;//{
|
|
//return( s_StopEndZi);
|
|
//}
|
|
|
|
void set_StopEnd( char* arg );//{
|
|
//strncpy((char*)c_StopEnd , arg , sizeof(c_StopEnd));
|
|
//c_StopEnd[sizeof(c_StopEnd)-1] = '\0';
|
|
//s_StopEndZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_StopEndZi( short arg ) ;//{
|
|
//s_StopEndZi = arg;
|
|
//}
|
|
|
|
long StopElapsed() const;//{
|
|
//return((long)l_StopElapsed );
|
|
//}
|
|
|
|
short StopElapsedZi() const;//{
|
|
//return( s_StopElapsedZi);
|
|
//}
|
|
|
|
void set_StopElapsed( long arg );//{
|
|
//l_StopElapsed = arg;
|
|
//s_StopElapsedZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_StopElapsedZi( short arg ) ;//{
|
|
//s_StopElapsedZi = arg;
|
|
//}
|
|
|
|
char* Code() const;//{
|
|
//return((char*)c_Code );
|
|
//}
|
|
|
|
short CodeZi() const;//{
|
|
//return( s_CodeZi);
|
|
//}
|
|
|
|
void set_Code( const char* arg );//{
|
|
//strncpy((char*)c_Code , arg , sizeof(c_Code));
|
|
//c_Code[sizeof(c_Code)-1] = '\0';
|
|
//s_CodeZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_CodeZi( short arg ) ;//{
|
|
//s_CodeZi = arg;
|
|
//}
|
|
|
|
char* Status() const;//{
|
|
//return((char*)c_Status );
|
|
//}
|
|
|
|
short StatusZi() const;//{
|
|
//return( s_StatusZi);
|
|
//}
|
|
|
|
void set_Status( const char* arg );//{
|
|
//strncpy((char*)c_Status , arg , sizeof(c_Status));
|
|
//c_Status[sizeof(c_Status)-1] = '\0';
|
|
//s_StatusZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_StatusZi( short arg ) ;//{
|
|
//s_StatusZi = arg;
|
|
//}
|
|
|
|
char* WorkLevel() const;//{
|
|
//return((char*)c_WorkLevel );
|
|
//}
|
|
|
|
short WorkLevelZi() const;//{
|
|
//return( s_WorkLevelZi);
|
|
//}
|
|
|
|
void set_WorkLevel( const char* arg );//{
|
|
//strncpy((char*)c_WorkLevel , arg , sizeof(c_WorkLevel));
|
|
//c_WorkLevel[sizeof(c_WorkLevel)-1] = '\0';
|
|
//s_WorkLevelZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_WorkLevelZi( short arg ) ;//{
|
|
//s_WorkLevelZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* toc() const;//{
|
|
//return((char*)c_toc );
|
|
//}
|
|
|
|
short tocZi() const;//{
|
|
//return( s_tocZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_toc( char* arg );//{
|
|
//strncpy((char*)c_toc , arg , sizeof(c_toc));
|
|
//c_toc[sizeof(c_toc)-1] = '\0';
|
|
//s_tocZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_tocZi( short arg );//{
|
|
//s_tocZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* tom() const;//{
|
|
//return((char*)c_tom );
|
|
//}
|
|
|
|
short tomZi() const;//{
|
|
//return( s_tomZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_tom( char* arg );//{
|
|
//strncpy((char*)c_tom , arg , sizeof(c_tom));
|
|
//c_tom[sizeof(c_tom)-1] = '\0';
|
|
//s_tomZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_tomZi( short arg );//{
|
|
//s_tomZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* mop() const;//{
|
|
//return((char*)c_mop );
|
|
//}
|
|
|
|
short mopZi() const;//{
|
|
//return( s_mopZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_mop( char* arg );//{
|
|
//strncpy((char*)c_mop , arg , sizeof(c_mop));
|
|
//c_mop[sizeof(c_mop)-1] = '\0';
|
|
//s_mopZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_mopZi( short arg );//{
|
|
//s_mopZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* mou() const;//{
|
|
//return((char*)c_mou );
|
|
//}
|
|
|
|
short mouZi() const;//{
|
|
//return( s_mouZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_mou( char* arg );//{
|
|
//strncpy((char*)c_mou , arg , sizeof(c_mou));
|
|
//c_mou[sizeof(c_mou)-1] = '\0';
|
|
//s_mouZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_mouZi( short arg );//{
|
|
//s_mouZi = arg;
|
|
//}
|
|
|
|
public:
|
|
// methodes for Primary key
|
|
long k_Seq();//{
|
|
//return((long)l_k_Seq );
|
|
//}
|
|
|
|
void set_k_Seq( long arg );//{
|
|
//l_k_Seq = arg;
|
|
//return;
|
|
//}
|
|
|
|
public:
|
|
//
|
|
// public methode fillStructure
|
|
//
|
|
// this methode filles the classstructue with the private attributes
|
|
//
|
|
void fillStructure();//{
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
void fillStructureZi();//{
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
void setStructure();// {
|
|
//return;
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
void setStructureZi() ;//{
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
char* getName();//{
|
|
//return((char*)"T_DOT_DATA");
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getSqlCode();//{
|
|
//return( db.dbSqlCode);
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getRowsProcessed();//{
|
|
//return( db.dbRowsProcessed);
|
|
//}
|
|
};
|
|
#endif
|