Ejemplo n.º 1
0
        private Oggetto getOggettoFromKey(string key)
        {
            logger.Debug("getOggettoFromKey");
            Oggetto res         = null;
            string  queryString = "SELECT [" + Constants.JOUDES_FIELD_NAME + "] FROM " + Constants.TEWAS400_TABLE_NAME;

            queryString = queryString + " WHERE [" + Constants.KEY_FIELD_NAME + "]=" + key;
            queryString = queryString + " AND ([" + Constants.JOUCOD_FIELD_NAME + "]=" + Constants.JOUCOD_OGGETTO_VALUE;
            queryString = queryString + " OR [" + Constants.JOUCOD_FIELD_NAME + "]=" + Constants.JOUCOD_PROTO_VALUE;
            queryString = queryString + ") ORDER BY [" + Constants.JOUPRO_FIELD_NAME + "]";
            AS400Database db         = new AS400Database();
            IDataReader   dr         = db.executeReader(queryString);
            ArrayList     valuesList = new ArrayList();

            dr.Read();
            string numProt = dr.GetValue(0).ToString();

            while (dr.Read())
            {
                string temp = dr.GetValue(0).ToString();
                valuesList.Add(temp);
            }
            if (valuesList.Count > 0)
            {
                res = new Oggetto(valuesList);
                res.setNumProt(Int32.Parse(numProt).ToString());
            }
            return(res);
        }
Ejemplo n.º 2
0
        private string getCommRefFromKey(string key)
        {
            logger.Debug("getCommRefFromKey");
            string res         = null;
            string queryString = "SELECT [" + Constants.JOUDES_FIELD_NAME + "] FROM " + Constants.TEWAS400_TABLE_NAME;

            queryString = queryString + " WHERE [" + Constants.KEY_FIELD_NAME + "]=" + key;
            queryString = queryString + " AND [" + Constants.JOUCOD_FIELD_NAME + "]=" + Constants.JOUCOD_COMM_REF_VALUE;
            AS400Database db = new AS400Database();

            res = (string)db.executeScalar(queryString);
            return(res);
        }
Ejemplo n.º 3
0
        private ArrayList getUpdateKeys()
        {
            logger.Debug("getUpdateKeys");
            ArrayList res         = new ArrayList();
            string    queryString = "SELECT DISTINCT A.[" + Constants.KEY_FIELD_NAME + "] FROM " + Constants.LOGAS400_TABLE_NAME + " A," + Constants.TEWAS400_TABLE_NAME + " B";

            queryString = queryString + " WHERE A.[" + Constants.KEY_FIELD_NAME + "]=B.[" + Constants.KEY_FIELD_NAME + "]";
            queryString = queryString + " AND A.[" + Constants.FLAG_FIELD_NAME + "]=0";
            logger.Debug(queryString);
            AS400Database db = new AS400Database();
            IDataReader   dr = db.executeReader(queryString);

            logger.Debug("Query eseguita");

            while (dr.Read())
            {
                logger.Debug("Qui");
                string temp = dr.GetValue(0).ToString();
                logger.Debug("Ris: " + temp);
                res.Add(temp);
            }
            return(res);
        }