private void DataPortal_Create(CriteriaCs criteria) { Random r = new Random(); Oid = (long)r.Next(); GetNewCode(); //_plan_clases = Planes_Clases.NewChildList(); _tipoauditorias = TipoAuditorias.NewChildList(); }
/// <summary> /// Retrieve the complete list from db /// </summary> /// <returns>TipoAuditoriaList</returns> public static TipoAuditoriaList GetClaseList(long oid_clase) { CriteriaEx criteria = TipoAuditoria.GetCriteria(TipoAuditoria.OpenSession()); //No criteria. Retrieve all de List criteria.Query = TipoAuditorias.SELECT_BY_CLASE_AUDITORIA(oid_clase); TipoAuditoriaList list = DataPortal.Fetch <TipoAuditoriaList>(criteria); CloseSession(criteria.SessionCode); return(list); }
private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { ClaseAuditoria.DoLOCK(Session()); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { string query = string.Empty; TipoAuditoria.DoLOCK(Session()); query = TipoAuditorias.SELECT_BY_CLASE_AUDITORIA(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _tipoauditorias = TipoAuditorias.GetChildList(criteria.SessionCode, reader); } } } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }