Esempio n. 1
0
        public static BankAccountList GetList(bool childs)
        {
            CriteriaEx criteria = BankAccount.GetCriteria(BankAccount.OpenSession());

            criteria.Childs = childs;

            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = BankAccounts.SELECT();
            }

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
Esempio n. 2
0
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                _base.Record.Oid = 0;
                SessionCode      = criteria.SessionCode;
                Childs           = criteria.Childs;

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

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

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

                        BankAccount.DoLOCK(Session());
                        query              = BankAccounts.SELECT(this);
                        reader             = nHMng.SQLNativeSelect(query, Session());
                        _cuentas_asociadas = BankAccounts.GetChildList(SessionCode, reader, false);

                        BankAccount.DoLOCK(Session());
                        query             = BankAccounts.SELECT(this, ETipoCuenta.FondoInversion);
                        reader            = nHMng.SQLNativeSelect(query, Session());
                        _fondos_inversion = BankAccounts.GetChildList(SessionCode, reader, false);
                    }
                }
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
Esempio n. 3
0
        public static BankAccountList GetList(DateTime f_fin, bool childs)
        {
            CriteriaEx criteria = BankAccount.GetCriteria(BankAccount.OpenSession());

            criteria.Childs = childs;

            QueryConditions conditions = new QueryConditions
            {
                FechaFin = f_fin
            };

            if (nHManager.Instance.UseDirectSQL)
            {
                criteria.Query = BankAccounts.SELECT(conditions);
            }

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

            CloseSession(criteria.SessionCode);
            return(list);
        }
Esempio n. 4
0
        private void Fetch(IDataReader source)
        {
            _base.CopyValues(source);

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

                BankAccount.DoLOCK(Session());
                query              = BankAccounts.SELECT(this);
                reader             = nHMng.SQLNativeSelect(query, Session());
                _cuentas_asociadas = BankAccounts.GetChildList(SessionCode, reader, false);

                BankAccount.DoLOCK(Session());
                query             = BankAccounts.SELECT(this, ETipoCuenta.FondoInversion);
                reader            = nHMng.SQLNativeSelect(query, Session());
                _fondos_inversion = BankAccounts.GetChildList(SessionCode, reader, false);
            }

            MarkOld();
        }