Beispiel #1
0
        private void Fetch(Documento source)
        {
            _base.CopyValues(source);

            if (Childs)
            {
                string      query = string.Empty;
                IDataReader reader;

                AgenteDocumento.DoLOCK(Session());
                query              = AgenteDocumentos.SELECT(this);
                reader             = nHManager.Instance.SQLNativeSelect(query, Session());
                _agente_documentos = AgenteDocumentos.GetChildList(reader);
            }

            MarkOld();
        }
Beispiel #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);
        }
Beispiel #3
0
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                _base.Record.Oid = 0;;
                SessionCode      = criteria.SessionCode;
                Childs           = criteria.Childs;

                if (nHMng.UseDirectSQL)
                {
                    Agente.DoLOCK(Session());
                    IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session());

                    if (reader.Read())
                    {
                        _base.CopyValues(reader);
                    }

                    if (Childs)
                    {
                        string query = string.Empty;

                        Documento.DoLOCK(Session());

                        query       = AgenteDocumentos.SELECT(this);
                        reader      = nHManager.Instance.SQLNativeSelect(query, Session());
                        _documentos = AgenteDocumentos.GetChildList(reader);
                    }
                }
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex, new object[] { criteria.Query });
            }
        }