451 lines
12 KiB
C++
451 lines
12 KiB
C++
|
|
// Version: 2021.3.3 10:24:15
|
||
|
|
|
||
|
|
// File: T_RULE_RESULT.cpp
|
||
|
|
|
||
|
|
#include "T_RULE_RESULT.h"
|
||
|
|
|
||
|
|
T_RULE_RESULT::T_RULE_RESULT(){
|
||
|
|
// initialise all membervariables
|
||
|
|
initial();
|
||
|
|
}
|
||
|
|
T_RULE_RESULT::~T_RULE_RESULT(){
|
||
|
|
}
|
||
|
|
void T_RULE_RESULT::initial(){
|
||
|
|
// initialise all membervariables
|
||
|
|
set_RuleBTime((char*)"");
|
||
|
|
set_RuleId((char*)"");
|
||
|
|
set_RuleGroup((char*)"");
|
||
|
|
set_RuleName((char*)"");
|
||
|
|
set_RuleNameZi(-1);
|
||
|
|
set_Result((char*)"");
|
||
|
|
set_ResultZi(-1);
|
||
|
|
set_DealResult(0);
|
||
|
|
set_DealResultZi(-1);
|
||
|
|
set_RuleETime((char*)"");
|
||
|
|
set_RuleETimeZi(-1);
|
||
|
|
set_DealTime((char*)"");
|
||
|
|
set_DealTimeZi(-1);
|
||
|
|
// initialies Primary key members
|
||
|
|
set_k_RuleBTime((char*)"");
|
||
|
|
set_k_RuleId((char*)"");
|
||
|
|
set_k_RuleGroup((char*)"");
|
||
|
|
}
|
||
|
|
T_RULE_RESULT::T_RULE_RESULT(char* arg1,const char* arg2,const char* arg3)
|
||
|
|
{
|
||
|
|
initial();
|
||
|
|
setPrimKey (arg1, arg2, arg3);
|
||
|
|
//read DB record
|
||
|
|
dbAccess = true;
|
||
|
|
dbMessage = readDB();
|
||
|
|
if ( dbMessage != NULL ) {dbAccess = false;}
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT:: execute(const char* sql , long* count){
|
||
|
|
return( db.execute( sql , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT:: dbCommit(){
|
||
|
|
return( db.dbCommit( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT:: dbRollback(){
|
||
|
|
return( db.dbRollback( ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::readDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.readDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::updateDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.updateDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::insertDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.insertDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::deleteDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::deleteDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.deleteDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::openSetDB(const char * where,const char* order){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.openSetDB( where , order ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::countDB(const char * where, long* count){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.countDB( where , count ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::getSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.getSetDB(*this) );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::closeSetDB(){
|
||
|
|
// DB Trace is off
|
||
|
|
return( db.closeSetDB() );
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::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_RULE_RESULT
|
||
|
|
//
|
||
|
|
// this methode stores the unique key attributes
|
||
|
|
//
|
||
|
|
void T_RULE_RESULT::setPrimKey( char* arg1 , const char* arg2 , const char* arg3 ){
|
||
|
|
strncpy( (char*)c_k_RuleBTime , arg1 , sizeof(c_k_RuleBTime) );
|
||
|
|
c_k_RuleBTime[sizeof(c_k_RuleBTime)-1] = '\0';
|
||
|
|
strncpy( (char*)c_k_RuleId , arg2 , sizeof(c_k_RuleId) );
|
||
|
|
c_k_RuleId[sizeof(c_k_RuleId)-1] = '\0';
|
||
|
|
strncpy( (char*)c_k_RuleGroup , arg3 , sizeof(c_k_RuleGroup) );
|
||
|
|
c_k_RuleGroup[sizeof(c_k_RuleGroup)-1] = '\0';
|
||
|
|
} // end of methode
|
||
|
|
|
||
|
|
void T_RULE_RESULT::initInsertKeys( char* arg1 , const char* arg2 , const char* arg3 ){
|
||
|
|
setPrimKey ( arg1 , arg2 , arg3);
|
||
|
|
strncpy( (char*)c_RuleBTime , arg1 , sizeof(c_RuleBTime) );
|
||
|
|
c_RuleBTime[sizeof(c_RuleBTime)-1] = '\0';
|
||
|
|
strncpy( (char*)c_RuleId , arg2 , sizeof(c_RuleId) );
|
||
|
|
c_RuleId[sizeof(c_RuleId)-1] = '\0';
|
||
|
|
strncpy( (char*)c_RuleGroup , arg3 , sizeof(c_RuleGroup) );
|
||
|
|
c_RuleGroup[sizeof(c_RuleGroup)-1] = '\0';
|
||
|
|
} // end of methode
|
||
|
|
void T_RULE_RESULT::setKeysFromRecord(){
|
||
|
|
set_k_RuleBTime( RuleBTime() );
|
||
|
|
set_k_RuleId( RuleId() );
|
||
|
|
set_k_RuleGroup( RuleGroup() );
|
||
|
|
} // end of methode
|
||
|
|
//
|
||
|
|
//O P E R A T O R +
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
T_RULE_RESULT T_RULE_RESULT::operator+(const T_RULE_RESULT &inst) const{
|
||
|
|
T_RULE_RESULT ptrT_RULE_RESULT(*this);
|
||
|
|
//----------------------------------------------------------
|
||
|
|
ptrT_RULE_RESULT.set_RuleBTime(inst.RuleBTime());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
ptrT_RULE_RESULT.set_RuleId(inst.RuleId());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
ptrT_RULE_RESULT.set_RuleGroup(inst.RuleGroup());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.RuleNameZi() != -1){
|
||
|
|
ptrT_RULE_RESULT.set_RuleName(inst.RuleName());
|
||
|
|
ptrT_RULE_RESULT.set_RuleNameZi(inst.RuleNameZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.ResultZi() != -1){
|
||
|
|
ptrT_RULE_RESULT.set_Result(inst.Result());
|
||
|
|
ptrT_RULE_RESULT.set_ResultZi(inst.ResultZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.DealResultZi() != -1){
|
||
|
|
ptrT_RULE_RESULT.set_DealResult(inst.DealResult());
|
||
|
|
ptrT_RULE_RESULT.set_DealResultZi(inst.DealResultZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.RuleETimeZi() != -1){
|
||
|
|
ptrT_RULE_RESULT.set_RuleETime(inst.RuleETime());
|
||
|
|
ptrT_RULE_RESULT.set_RuleETimeZi(inst.RuleETimeZi());
|
||
|
|
}
|
||
|
|
//----------------------------------------------------------
|
||
|
|
if(inst.DealTimeZi() != -1){
|
||
|
|
ptrT_RULE_RESULT.set_DealTime(inst.DealTime());
|
||
|
|
ptrT_RULE_RESULT.set_DealTimeZi(inst.DealTimeZi());
|
||
|
|
}
|
||
|
|
return (ptrT_RULE_RESULT);
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
//O P E R A T O R =
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
const T_RULE_RESULT& T_RULE_RESULT::operator=(const T_RULE_RESULT &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleBTime(inst.RuleBTime());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleId(inst.RuleId());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleGroup(inst.RuleGroup());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleName(inst.RuleName());
|
||
|
|
this->set_RuleNameZi(inst.RuleNameZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Result(inst.Result());
|
||
|
|
this->set_ResultZi(inst.ResultZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_DealResult(inst.DealResult());
|
||
|
|
this->set_DealResultZi(inst.DealResultZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleETime(inst.RuleETime());
|
||
|
|
this->set_RuleETimeZi(inst.RuleETimeZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_DealTime(inst.DealTime());
|
||
|
|
this->set_DealTimeZi(inst.DealTimeZi());
|
||
|
|
return (*this);
|
||
|
|
}
|
||
|
|
//
|
||
|
|
//C O P Y - C O N S T R U C T O R
|
||
|
|
//===================
|
||
|
|
//
|
||
|
|
T_RULE_RESULT::T_RULE_RESULT(const T_RULE_RESULT &inst){
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleBTime(inst.RuleBTime());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleId(inst.RuleId());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleGroup(inst.RuleGroup());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleName(inst.RuleName());
|
||
|
|
this->set_RuleNameZi(inst.RuleNameZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_Result(inst.Result());
|
||
|
|
this->set_ResultZi(inst.ResultZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_DealResult(inst.DealResult());
|
||
|
|
this->set_DealResultZi(inst.DealResultZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_RuleETime(inst.RuleETime());
|
||
|
|
this->set_RuleETimeZi(inst.RuleETimeZi());
|
||
|
|
//----------------------------------------------------------
|
||
|
|
this->set_DealTime(inst.DealTime());
|
||
|
|
this->set_DealTimeZi(inst.DealTimeZi());
|
||
|
|
}
|
||
|
|
char* T_RULE_RESULT::RuleBTime() const{
|
||
|
|
return((char*)c_RuleBTime );
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_RuleBTime( char* arg ){
|
||
|
|
strncpy((char*)c_RuleBTime , arg , sizeof(c_RuleBTime));
|
||
|
|
c_RuleBTime[sizeof(c_RuleBTime)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::RuleId() const{
|
||
|
|
return((char*)c_RuleId );
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_RuleId( const char* arg ){
|
||
|
|
strncpy((char*)c_RuleId , arg , sizeof(c_RuleId));
|
||
|
|
c_RuleId[sizeof(c_RuleId)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::RuleGroup() const{
|
||
|
|
return((char*)c_RuleGroup );
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_RuleGroup( const char* arg ){
|
||
|
|
strncpy((char*)c_RuleGroup , arg , sizeof(c_RuleGroup));
|
||
|
|
c_RuleGroup[sizeof(c_RuleGroup)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::RuleName() const{
|
||
|
|
return((char*)c_RuleName );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_RULE_RESULT::RuleNameZi() const{
|
||
|
|
return( s_RuleNameZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_RuleName( const char* arg ){
|
||
|
|
strncpy((char*)c_RuleName , arg , sizeof(c_RuleName));
|
||
|
|
c_RuleName[sizeof(c_RuleName)-1] = '\0';
|
||
|
|
s_RuleNameZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_RuleNameZi( short arg ) {
|
||
|
|
s_RuleNameZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::Result() const{
|
||
|
|
return((char*)c_Result );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_RULE_RESULT::ResultZi() const{
|
||
|
|
return( s_ResultZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_Result( const char* arg ){
|
||
|
|
strncpy((char*)c_Result , arg , sizeof(c_Result));
|
||
|
|
c_Result[sizeof(c_Result)-1] = '\0';
|
||
|
|
s_ResultZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_ResultZi( short arg ) {
|
||
|
|
s_ResultZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
long T_RULE_RESULT::DealResult() const{
|
||
|
|
return((long)l_DealResult );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_RULE_RESULT::DealResultZi() const{
|
||
|
|
return( s_DealResultZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_DealResult( long arg ){
|
||
|
|
l_DealResult = arg;
|
||
|
|
s_DealResultZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_DealResultZi( short arg ) {
|
||
|
|
s_DealResultZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::RuleETime() const{
|
||
|
|
return((char*)c_RuleETime );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_RULE_RESULT::RuleETimeZi() const{
|
||
|
|
return( s_RuleETimeZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_RuleETime( char* arg ){
|
||
|
|
strncpy((char*)c_RuleETime , arg , sizeof(c_RuleETime));
|
||
|
|
c_RuleETime[sizeof(c_RuleETime)-1] = '\0';
|
||
|
|
s_RuleETimeZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_RuleETimeZi( short arg ) {
|
||
|
|
s_RuleETimeZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::DealTime() const{
|
||
|
|
return((char*)c_DealTime );
|
||
|
|
}
|
||
|
|
|
||
|
|
short T_RULE_RESULT::DealTimeZi() const{
|
||
|
|
return( s_DealTimeZi);
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_DealTime( char* arg ){
|
||
|
|
strncpy((char*)c_DealTime , arg , sizeof(c_DealTime));
|
||
|
|
c_DealTime[sizeof(c_DealTime)-1] = '\0';
|
||
|
|
s_DealTimeZi= 0;
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_DealTimeZi( short arg ) {
|
||
|
|
s_DealTimeZi = arg;
|
||
|
|
}
|
||
|
|
|
||
|
|
// methodes for Primary key
|
||
|
|
char* T_RULE_RESULT::k_RuleBTime(){
|
||
|
|
return((char*)c_k_RuleBTime );
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_k_RuleBTime( char* arg ){
|
||
|
|
strncpy((char*)c_k_RuleBTime , arg , sizeof(c_k_RuleBTime));
|
||
|
|
c_k_RuleBTime[sizeof(c_k_RuleBTime)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::k_RuleId(){
|
||
|
|
return((char*)c_k_RuleId );
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_k_RuleId( char* arg ){
|
||
|
|
strncpy((char*)c_k_RuleId , arg , sizeof(c_k_RuleId));
|
||
|
|
c_k_RuleId[sizeof(c_k_RuleId)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
char* T_RULE_RESULT::k_RuleGroup(){
|
||
|
|
return((char*)c_k_RuleGroup );
|
||
|
|
}
|
||
|
|
|
||
|
|
void T_RULE_RESULT::set_k_RuleGroup( char* arg ){
|
||
|
|
strncpy((char*)c_k_RuleGroup , arg , sizeof(c_k_RuleGroup));
|
||
|
|
c_k_RuleGroup[sizeof(c_k_RuleGroup)-1] = '\0';
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
// public methode fillStructure
|
||
|
|
//
|
||
|
|
// this methode filles the classstructue with the private attributes
|
||
|
|
//
|
||
|
|
void T_RULE_RESULT::fillStructure(){
|
||
|
|
strncpy ( structTable.RuleBTime , RuleBTime(),sizeof(structTable.RuleBTime));
|
||
|
|
strncpy ( structTable.RuleId , RuleId(),sizeof(structTable.RuleId));
|
||
|
|
strncpy ( structTable.RuleGroup , RuleGroup(),sizeof(structTable.RuleGroup));
|
||
|
|
strncpy ( structTable.RuleName , RuleName(),sizeof(structTable.RuleName));
|
||
|
|
strncpy ( structTable.Result , Result(),sizeof(structTable.Result));
|
||
|
|
structTable.DealResult = DealResult();
|
||
|
|
strncpy ( structTable.RuleETime , RuleETime(),sizeof(structTable.RuleETime));
|
||
|
|
strncpy ( structTable.DealTime , DealTime(),sizeof(structTable.DealTime));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_RULE_RESULT::fillStructureZi(){
|
||
|
|
structTableZi.RuleNameZi = RuleNameZi();
|
||
|
|
structTableZi.ResultZi = ResultZi();
|
||
|
|
structTableZi.DealResultZi = DealResultZi();
|
||
|
|
structTableZi.RuleETimeZi = RuleETimeZi();
|
||
|
|
structTableZi.DealTimeZi = DealTimeZi();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_RULE_RESULT::setStructure() {
|
||
|
|
set_RuleName( structTable.RuleName);
|
||
|
|
set_Result( structTable.Result);
|
||
|
|
set_DealResult( structTable.DealResult);
|
||
|
|
set_RuleETime( structTable.RuleETime);
|
||
|
|
set_DealTime( structTable.DealTime);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
void T_RULE_RESULT::setStructureZi() {
|
||
|
|
set_RuleNameZi( structTableZi.RuleNameZi);
|
||
|
|
set_ResultZi( structTableZi.ResultZi);
|
||
|
|
set_DealResultZi( structTableZi.DealResultZi);
|
||
|
|
set_RuleETimeZi( structTableZi.RuleETimeZi);
|
||
|
|
set_DealTimeZi( structTableZi.DealTimeZi);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
char* T_RULE_RESULT::getName(){
|
||
|
|
return((char*)"T_RULE_RESULT");
|
||
|
|
}
|
||
|
|
///////////////////////////////////////////////////
|
||
|
|
int T_RULE_RESULT::getSqlCode(){
|
||
|
|
return( db.dbSqlCode);
|
||
|
|
}
|
||
|
|
int T_RULE_RESULT::getRowsProcessed(){
|
||
|
|
return( db.dbRowsProcessed);
|
||
|
|
}
|