company::company(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_extDB,     SIGNAL(editingFinished()), this, SLOT(sHandleTest()));
  connect(_extPort,   SIGNAL(editingFinished()), this, SLOT(sHandleTest()));
  connect(_extServer, SIGNAL(editingFinished()), this, SLOT(sHandleTest()));
  connect(_extTest,   SIGNAL(clicked()), this, SLOT(sTest()));
  connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave()));
  connect(_buttonBox, SIGNAL(rejected()), this, SLOT(close()));
  connect(_currency, SIGNAL(newID(int)), this, SLOT(sCurrencyChanged()));

  _number->setMaxLength(_metrics->value("GLCompanySize").toInt());
  _cachedNumber = "";
  _cachedCurrid = CurrCluster::baseId();

  _external->setVisible(_metrics->boolean("MultiCompanyFinancialConsolidation"));
  _authGroup->setVisible(_metrics->boolean("MultiCompanyFinancialConsolidation"));
  _currency->setId(CurrCluster::baseId());
  _unrlzgainloss->setType(GLCluster::cRevenue | GLCluster::cExpense);
  _unrlzgainloss->setShowExternal(true);
  _unrlzgainloss->setIgnoreCompany(true);
  _yearend->setShowExternal(true);
  _yearend->setType(GLCluster::cEquity);
  _yearend->setIgnoreCompany(true);
  _gainloss->setType(GLCluster::cExpense);
  _gainloss->setShowExternal(true);
  _gainloss->setIgnoreCompany(true);
  _discrepancy->setType(GLCluster::cExpense);
  _discrepancy->setShowExternal(true);
  _discrepancy->setIgnoreCompany(true);
}
Exemple #2
0
company::company(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_extDB,     SIGNAL(editingFinished()), this, SLOT(sHandleTest()));
  connect(_extPort,   SIGNAL(editingFinished()), this, SLOT(sHandleTest()));
  connect(_extServer, SIGNAL(editingFinished()), this, SLOT(sHandleTest()));
  connect(_extTest,           SIGNAL(clicked()), this, SLOT(sTest()));
  connect(_save,              SIGNAL(clicked()), this, SLOT(sSave()));

  _number->setMaxLength(_metrics->value("GLCompanySize").toInt());
  _cachedNumber = "";

  _external->setVisible(_metrics->boolean("MultiCompanyFinancialConsolidation"));
  _authGroup->setVisible(_metrics->boolean("MultiCompanyFinancialConsolidation"));
}
Exemple #3
0
uiforms::uiforms(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
  setupUi(this);

  connect(_new, SIGNAL(clicked()), this, SLOT(sNew()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_test, SIGNAL(clicked()), this, SLOT(sTest()));

  _uiform->addColumn(tr("Name"),   _itemColumn, Qt::AlignLeft,  true, "uiform_name");
  _uiform->addColumn(tr("Description"),     -1, Qt::AlignLeft,  true, "uiform_notes");
  _uiform->addColumn(tr("Order"),    _ynColumn, Qt::AlignCenter,true, "uiforom_order");
  _uiform->addColumn(tr("Enabled"),  _ynColumn, Qt::AlignCenter,true, "uiform_enabled");
  _uiform->addColumn(tr("Package"),_itemColumn, Qt::AlignLeft,  false,"nspname");

  sFillList();
}
Exemple #4
0
int
main( int argc, char **argv ) {
    int i1 = 0, i2 = 0, i3 = 0, i = 0;
    genQueryInp_t genQueryInp;
    int i1a[10];
    int i2a[10];
    int done = 0;
    int mode = 0;
    char *condVal[2];
    char v1[20];

    /* remove this call or change to LOG_NOTICE for more verbosity */
    rodsLogLevel( LOG_ERROR );

    /* this will cause the sql to be printed, comment this out to skip it  */
    rodsLogSqlReq( 1 );

    i1 = 7;
    i2 = 5;

    done = 0;
    mode = 0;
    if ( argc >= 2 ) {
        if ( strcmp( argv[1], "gen" ) == 0 ) {
            mode = 1;
        }
        if ( strcmp( argv[1], "ls" ) == 0 ) {
            mode = 2;
        }
        if ( strcmp( argv[1], "gen2" ) == 0 ) {
            mode = 3;
        }
        if ( strcmp( argv[1], "gen3" ) == 0 ) {
            mode = 4;
        }
        if ( strcmp( argv[1], "gen4" ) == 0 ) {
            mode = 5;
        }
        if ( strcmp( argv[1], "gen5" ) == 0 ) {
            mode = 6;
        }
        if ( strcmp( argv[1], "gen6" ) == 0 ) {
            mode = 7;
        }
        if ( strcmp( argv[1], "gen7" ) == 0 ) {
            mode = 8;
        }
        if ( strcmp( argv[1], "gen8" ) == 0 ) {
            mode = 9;
        }
        if ( strcmp( argv[1], "gen9" ) == 0 ) {
            mode = 10;
        }
        if ( strcmp( argv[1], "gen10" ) == 0 ) {
            mode = 11;
        }
        if ( strcmp( argv[1], "gen11" ) == 0 ) {
            mode = 12;
        }
        if ( strcmp( argv[1], "gen12" ) == 0 ) {
            mode = 13;
        }
        if ( strcmp( argv[1], "gen13" ) == 0 ) {
            mode = 14;
        }
        if ( strcmp( argv[1], "lsr" ) == 0 ) {
            mode = 15;
        }
        if ( strcmp( argv[1], "gen15" ) == 0 ) {
            mode = 16;
        }
    }

    if ( argc == 3 && mode == 0 ) {
        i1 = atoi( argv[1] );
        i2 = atoi( argv[2] );
        sTest( i1, i2 );
        done++;
    }

    if ( argc == 4 && mode == 0 ) {
        i1 = atoi( argv[1] );
        i2 = atoi( argv[2] );
        i3 = atoi( argv[3] );
        sTest2( i1, i2, i3 );
        done++;
    }

    if ( argc == 2 && mode == 0 ) {
        int j;
        j = atoi( argv[1] );
        if ( j >= 0 ) {
            printf( "finding cycles starting with table %d\n", j );
            i = findCycles( j );
            printf( "status = %d\n", i );
        }
        else {
            printf( "finding cycles for all tables\n" );
            printf( "last test should be -816000 if last table finished\n" );
            i = 0;
            for ( j = 0; i == 0; j++ ) {
                i = findCycles( j );
                printf( "starting with table %d status = %d\n", j, i );
            }
            if ( j > 70 && i == CAT_INVALID_ARGUMENT ) {
                printf(
                    "Success: Searched all tables (0 to %d) and no cycles found\n",
                    j - 1 );
                exit( 0 );
            }
            else {
                exit( 5 );
            }
        }
        done++;
    }

    memset( ( char* )&genQueryInp, 0, sizeof( genQueryInp ) );

    genQueryInp.maxRows = 10;
    genQueryInp.continueInx = 0;
    /*
      (another test case that could be used)
    i1a[0]=COL_R_RESC_NAME;
    i1a[1]=COL_R_ZONE_NAME;
    i1a[2]=COL_R_TYPE_NAME;
    i1a[3]=COL_R_CLASS_NAME;
    */
    /*   i1a[0]=COL_COLL_INHERITANCE; */
    i1a[0] = COL_COLL_NAME;

    genQueryInp.selectInp.inx = i1a;
    genQueryInp.selectInp.len = 1;

    i2a[0] = COL_D_DATA_PATH;
    genQueryInp.sqlCondInp.inx = i2a;
    strcpy( v1, "='b'" );
    condVal[0] = v1;
    genQueryInp.sqlCondInp.value = condVal;
    genQueryInp.sqlCondInp.len = 1;

    if ( mode == 1 ) {
        if ( argc == 3 ) {
            i1a[0] = atoi( argv[2] );
        }
    }
    if ( done == 0 ) {
        int status;
        genQueryOut_t result;
        rodsEnv myEnv;

        memset( ( char * )&result, 0, sizeof( result ) );
        memset( ( char * )&myEnv, 0, sizeof( myEnv ) );
        status = getRodsEnv( &myEnv );
        if ( status < 0 ) {
            rodsLog( LOG_ERROR, "main: getRodsEnv error. status = %d",
                     status );
            exit( 1 );
        }

        // capture server properties
        irods::server_properties::getInstance().capture();

        if ( ( status = chlOpen() ) != 0 ) {

            rodsLog( LOG_SYS_FATAL,
                     "chlopen Error. Status = %d",
                     status );
            return status;
        }


        /* This is no longer ifdef'ed GEN_QUERY_AC (since msiAclPolicy
        now used), so just do it.   */
        chlGenQueryAccessControlSetup( myEnv.rodsUserName,
                                       myEnv.rodsZone,
                                       "",
                                       LOCAL_PRIV_USER_AUTH, 1 );

        if ( strstr( myEnv.rodsDebug, "CAT" ) != NULL ) {
            chlDebug( myEnv.rodsDebug );
        }

        if ( mode == 2 ) {
            /*	 doLs(); */
            doLs2();
            exit( 0 );
        }
        if ( mode == 3 ) {
            doTest2();
            exit( 0 );
        }
        if ( mode == 4 ) {
            doTest3();
            exit( 0 );
        }
        if ( mode == 5 ) {
            doTest4();
            exit( 0 );
        }
        if ( mode == 6 ) {
            doTest5();
            exit( 0 );
        }
        if ( mode == 7 ) {
            doTest6( argv[2] );
            exit( 0 );
        }

        if ( mode == 8 ) {
            status = doTest7( argv[2], argv[3], argv[4], argv[5] );
            if ( status < 0 ) {
                exit( 1 );
            }
            exit( 0 );
        }

        if ( mode == 9 ) {
            status = doTest8( argv[2], argv[3], argv[4] );
            if ( status < 0 ) {
                exit( 2 );
            }
            exit( 0 );
        }

        if ( mode == 10 ) {
            status = doTest9( argv[2], argv[3] );
            if ( status < 0 ) {
                exit( 2 );
            }
            exit( 0 );
        }

        if ( mode == 11 ) {
            status = doTest10( argv[2], argv[3], argv[4], argv[5] );
            if ( status < 0 ) {
                exit( 2 );
            }
            exit( 0 );
        }

        if ( mode == 12 ) {
            status = doTest11( argv[2], argv[3], argv[4], argv[5], argv[6] );
            if ( status < 0 ) {
                exit( 2 );
            }
            exit( 0 );
        }
        if ( mode == 13 ) {
            status = doTest12( argv[2], argv[3], argv[4], argv[5] );
            if ( status < 0 ) {
                exit( 2 );
            }
            exit( 0 );
        }
        if ( mode == 14 ) {
            status = doTest13( argv[2], argv[3], argv[4], argv[5], argv[6] );
            if ( status < 0 ) {
                exit( 2 );
            }
            exit( 0 );
        }
        if ( mode == 15 ) {
            try {
                int reps = boost::lexical_cast<int>( argv[2] );
                reps = reps > 0 && reps <= std::numeric_limits<int>::max() ? reps : 0;
                status = doLs3( reps );
            } catch ( boost::bad_lexical_cast e ) {
                exit( 2 );
            }
            if ( status < 0 ) {
                exit( 2 );
            }
            exit( 0 );
        }
        if ( mode == 16 ) {
            status = doTest15( argv[2], argv[3], argv[4] );
            if ( status < 0 ) {
                exit( 2 );
            }
            exit( 0 );
        }

        genQueryInp.maxRows = 2;
        i = chlGenQuery( genQueryInp, &result );
        printf( "chlGenQuery status=%d\n", i );
        printf( "result.rowCnt=%d\n", result.rowCnt );
        if ( result.rowCnt > 0 ) {
            int i;
            for ( i = 0; i < result.rowCnt; i++ ) {
                printf( "result.SqlResult[%d].value=%s\n", i,
                        result.sqlResult[i].value );
            }
        }
    }
    exit( 0 );
}
Exemple #5
0
int main(int argc, char *argv[]) {
#if 0
    A *c = create(0);
    A *d = create(1);
    A *e = create(2);
        
    executeCommand(c);
    executeCommand(d);
    executeCommand(e);
    
    delete c;
    delete d;
    delete e;
#endif

#if 0
    std::vector<std::string> vecTokens;
    std::string test = "AB,,CS";
    
    tokenize(test, vecTokens, ",");
    std::cout << vecTokens.size() << std::endl;
    
    std::vector<std::string>::iterator itr;
    for (itr = vecTokens.begin(); itr != vecTokens.end(); ++itr) {
        std::cout << *itr << (*itr).length() << std::endl;
    }
#endif   
#if 0
    std::string sTest = "1234.1234";
    if (checkRegExpression("^-?[0-9]+\\.[0-9]+$"
                         , sTest)) {
        std::cout << "OK!!" << std::endl;
    } else {
        std::cout << "NOK!!" << std::endl;
    }
    
    std::map<std::string, std::string> mapTest;
    std::string sTest1 = "es";
    mapTest.insert(std::pair<std::string, std::string>("Test1", "Esto " + sTest1 + " una Prueba."));
#endif       
#if 0    
    createInstance('W');
    
    std::string sTest("Test12345");
    if (sTest.compare("Test12345") == 0) {
        std::cout << "OK!" << std::endl;    
    } else {
        std::cout << "NOK!" << std::endl;
    }
#endif
#if 0   
    std::vector<std::string> vecStrings;
    vecStrings.push_back("abc");
    vecStrings.push_back("def");
    vecStrings.push_back("fgh");
    
    if (std::find(vecStrings.begin(), vecStrings.end(), "abcd") != vecStrings.end()) {
        std::cout << "OK" << std::endl;
    } else {
        std::cout << "NOK" << std::endl;
    }
    
    C c1("test C1", "Message 1"); 
    c1.foo();
    sleep(5);
    C c2("test C2", "Message 2");
    c2.foo();
    sleep(10);
    C c3("test C3", "Message 3");
    c3.foo();
#endif

#if 0
    F *f = new G();
    f->foo();
    delete f;
    
#endif
    return 0;
}