Пример #1
0
        /// <summary>
        /// Builds a AgenteDocumentoList
        /// </summary>
        /// <param name="list"></param>
        /// <returns>AgenteDocumentoList</returns>
        public static AgenteDocumentoList GetList(bool childs)
        {
            CriteriaEx criteria = AgenteDocumento.GetCriteria(AgenteDocumento.OpenSession());

            criteria.Childs = childs;

            criteria.Query = SELECT();

            AgenteDocumentoList list = DataPortal.Fetch <AgenteDocumentoList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
Пример #2
0
        public static long CountAssociations(long oid)
        {
            CriteriaEx criteria = AgenteDocumento.GetCriteria(AgenteDocumento.OpenSession());

            criteria.Childs = false;

            QueryConditions conditions = new QueryConditions()
            {
                Document = DocumentoInfo.New(oid)
            };

            criteria.Query = AgenteDocumentos.SELECT(conditions);

            AgenteDocumentoList list = DataPortal.Fetch <AgenteDocumentoList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list.Count);
        }