Example #1
0
        public bool updateCache(DocsPaVO.Caching.InfoFileCaching info)
        {
            bool result = true;

            DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("U_CACHE");
            q.setParam("docnumber", info.DocNumber.ToString());
            q.setParam("pathcache", "'" + info.CacheFilePath + "'");
            q.setParam("idAmministrazione", "'" + info.idAmministrazione + "'");
            q.setParam("aggiornato", info.Aggiornato.ToString());
            q.setParam("version_id", info.Version_id.ToString());
            q.setParam("loked", "'" + info.locked.ToString() + "'");
            q.setParam("comptype", "'" + info.comptype + "'");
            q.setParam("file_size", info.file_size.ToString());
            q.setParam("alternate_path", "'" + info.alternate_path + "'");
            q.setParam("var_impronta", "'" + info.var_impronta + "'");
            q.setParam("ext", "'" + info.ext.Trim() + "'");
            q.setParam("data", "'" + info.last_access + "'");
            string sql = q.getSQL();

            logger.Debug("updateCache - query:" + sql);
            if (!this.ExecuteNonQuery(sql))
            {
                result = false;
                throw new Exception();
            }

            return(result);
        }
Example #2
0
        public bool updateComponentCache(DocsPaVO.Caching.InfoFileCaching info)
        {
            bool result = true;

            DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("U_CACHE_COMPONENTS");
            q.setParam("DOCNUMBER", info.DocNumber.ToString());
            q.setParam("VERSION_ID", info.Version_id.ToString());
            q.setParam("LOCKED", "'" + info.locked.ToString() + "'");
            q.setParam("COMPTYPE", "'" + info.comptype + "'");
            q.setParam("FILE_SIZE", info.file_size.ToString());
            q.setParam("ALTERNATE_PATH", "'" + info.alternate_path + "'");
            q.setParam("VAR_IMPRONTA", "'" + info.var_impronta + "'");
            q.setParam("EXT", "'" + info.ext + "'");
            q.setParam("PATH", "'" + info.CacheFilePath + "'");

            string sql = q.getSQL();

            logger.Debug("updateComponentCache - query:" + sql);
            if (!this.ExecuteNonQuery(sql))
            {
                result = false;
                throw new Exception();
            }

            return(result);
        }
Example #3
0
        public DocsPaVO.Caching.InfoFileCaching massimaVersioneDelDocumentoComponents(string docnumber)
        {
            DocsPaVO.Caching.InfoFileCaching info = null;
            DocsPaUtils.Query sql = DocsPaUtils.InitQuery.getInstance().getQuery("S_CACHE_MAX_VESIONE_COMPONENTS");
            sql.setParam("docnumber", docnumber.ToString());

            logger.Debug("massimaVersioneDelDocumentoComponents - query:" + sql.getSQL());

            using (DocsPaDB.DBProvider dbProvider = new DocsPaDB.DBProvider())
            {
                using (System.Data.IDataReader reader = dbProvider.ExecuteReader(sql.getSQL()))
                {
                    if (reader != null)
                    {
                        while (reader.Read())
                        {
                            info = new InfoFileCaching();
                            info.CacheFilePath = reader.GetString(reader.GetOrdinal("pathcache"));
                            info.ext           = reader.GetString(reader.GetOrdinal("ext"));
                            info.Version_id    = reader.GetInt32(reader.GetOrdinal("version_id"));
                        }
                    }
                }
            }
            return(info);
        }