Example #1
0
        public List <Filtro> GetFiltri(string Utente, string StringaErrore)
        {
            var dtoFilters = new List <Filtro>();

            try
            {
                InitUsernameAndDomain(Utente);
                if (!CurrentUserRightsEnable())
                {
                    throw new AuthenticationException(string.Format("Utente {0} non trovato nel Dominio {1}", UserName, Domain));
                }

                var filters = WsDocmUtil.GetDictionaryFromXml(HttpContext.Current.Server.MapPath("~/Mapping/DocumentFinder.xml"), "name", "type");
                dtoFilters.AddRange(filters.Select(filter => new Filtro(filter.Key, filter.Value)));

                return(dtoFilters);
            }
            finally
            {
                NHibernateSessionManager.Instance.CloseTransactionAndSessions();
            }
        }
Example #2
0
        public List <Metadato> GetMetadati(string Utente, string StringaErrore)
        {
            var dtoMetadata = new List <Metadato>();

            try
            {
                InitUsernameAndDomain(Utente);
                if (!CurrentUserRightsEnable())
                {
                    throw new AuthenticationException(string.Format("Utente {0} non trovato nel Dominio {1}", UserName, Domain));
                }

                var metadata = WsDocmUtil.GetDictionaryFromXml(HttpContext.Current.Server.MapPath("~/Mapping/Pratica.xml"), "label", "name");
                dtoMetadata.AddRange(metadata.Select(meta => new Metadato(meta.Key, meta.Value)));

                return(dtoMetadata);
            }
            finally
            {
                NHibernateSessionManager.Instance.CloseTransactionAndSessions();
            }
        }