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); } }
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(); }