// Version: 2020.10.31 16:32:23 #ifndef _T_PDI_ZONE_H #define _T_PDI_ZONE_H #include #include #include #ifdef _MSC_VER #pragma warning(disable:4996) #pragma warning(disable:4267) #endif #include "T_PDI_ZONEDBAX.h" class T_PDI_ZONE{ friend class T_PDI_ZONEDBAX; private: //aggregation to DB Class T_PDI_ZONEDBAX 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 //=================== // char c_entId[50+1]; long l_zone; char c_steelgrade[20+1]; short s_steelgradeZi; char c_alloycode[20+1]; short s_alloycodeZi; double d_thick; short s_thickZi; double d_width; short s_widthZi; char c_stime[27]; short s_stimeZi; char c_etime[27]; short s_etimeZi; // arguments for Primary key char c_k_entId[50+1]; long l_k_zone; public: // // LTA Structure struct STR_T_PDI_ZONE{ char entId[50+1]; int zone; char steelgrade[20+1]; char alloycode[20+1]; double thick; double width; char stime[27]; char etime[27]; }structTable; // LTA Structure Zi struct STR_T_PDI_ZONEZi{ short steelgradeZi; short alloycodeZi; short thickZi; short widthZi; short stimeZi; short etimeZi; }structTableZi; // //C O N S T R U C T O R S //======================= // public: T_PDI_ZONE(); //D E S T R U C T O R S //======================= // virtual ~T_PDI_ZONE(); // //C O P Y - C O N S T R U C T O R //======================= T_PDI_ZONE(const T_PDI_ZONE &inst); // For Constructors with parameters the flag dbAccess // informs you if the access was successfully or not T_PDI_ZONE( const char* arg1,long arg2); //methods public: char* getCreationTime() {return (char*)"2020.10.31 16:32:23";}; //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(const char* arg1 , long arg2 ); // public methode initInsertKeys // // this methode stores the unique key attributes // void initInsertKeys( const char* arg1 , long arg2 ); 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_PDI_ZONE operator+(const T_PDI_ZONE &inst) const; // //O P E R A T O R = //=================== // public: const T_PDI_ZONE& operator=(const T_PDI_ZONE &inst); char* entId() const;//{ //return((char*)c_entId ); //} void set_entId( const char* arg );//{ //strncpy((char*)c_entId , arg , sizeof(c_entId)); //c_entId[sizeof(c_entId)-1] = '\0'; //return; //} long zone() const;//{ //return((long)l_zone ); //} void set_zone( long arg );//{ //l_zone = arg; //return; //} char* steelgrade() const;//{ //return((char*)c_steelgrade ); //} short steelgradeZi() const;//{ //return( s_steelgradeZi); //} void set_steelgrade( const char* arg );//{ //strncpy((char*)c_steelgrade , arg , sizeof(c_steelgrade)); //c_steelgrade[sizeof(c_steelgrade)-1] = '\0'; //s_steelgradeZi= 0; //return; //} void set_steelgradeZi( short arg ) ;//{ //s_steelgradeZi = arg; //} char* alloycode() const;//{ //return((char*)c_alloycode ); //} short alloycodeZi() const;//{ //return( s_alloycodeZi); //} void set_alloycode( const char* arg );//{ //strncpy((char*)c_alloycode , arg , sizeof(c_alloycode)); //c_alloycode[sizeof(c_alloycode)-1] = '\0'; //s_alloycodeZi= 0; //return; //} void set_alloycodeZi( short arg ) ;//{ //s_alloycodeZi = arg; //} double thick() const;//{ //return((double)d_thick ); //} short thickZi() const;//{ //return( s_thickZi); //} void set_thick( double arg );//{ //d_thick = arg; //s_thickZi= 0; //return; //} void set_thickZi( short arg ) ;//{ //s_thickZi = arg; //} double width() const;//{ //return((double)d_width ); //} short widthZi() const;//{ //return( s_widthZi); //} void set_width( double arg );//{ //d_width = arg; //s_widthZi= 0; //return; //} void set_widthZi( short arg ) ;//{ //s_widthZi = arg; //} char* stime() const;//{ //return((char*)c_stime ); //} short stimeZi() const;//{ //return( s_stimeZi); //} void set_stime( char* arg );//{ //strncpy((char*)c_stime , arg , sizeof(c_stime)); //c_stime[sizeof(c_stime)-1] = '\0'; //s_stimeZi= 0; //return; //} void set_stimeZi( short arg ) ;//{ //s_stimeZi = arg; //} char* etime() const;//{ //return((char*)c_etime ); //} short etimeZi() const;//{ //return( s_etimeZi); //} void set_etime( char* arg );//{ //strncpy((char*)c_etime , arg , sizeof(c_etime)); //c_etime[sizeof(c_etime)-1] = '\0'; //s_etimeZi= 0; //return; //} void set_etimeZi( short arg ) ;//{ //s_etimeZi = arg; //} public: // methodes for Primary key char* k_entId();//{ //return((char*)c_k_entId ); //} void set_k_entId( char* arg );//{ //strncpy((char*)c_k_entId , arg , sizeof(c_k_entId)); //c_k_entId[sizeof(c_k_entId)-1] = '\0'; //return; //} long k_zone();//{ //return((long)l_k_zone ); //} void set_k_zone( long arg );//{ //l_k_zone = 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_PDI_ZONE"); //} /////////////////////////////////////////////////// int getSqlCode();//{ //return( db.dbSqlCode); //} /////////////////////////////////////////////////// int getRowsProcessed();//{ //return( db.dbRowsProcessed); //} }; #endif