private void Fetch(TipoAuditoria source) { try { SessionCode = source.SessionCode; _base.CopyValues(source); CriteriaEx criteria = Criterio.GetCriteria(Session()); criteria.AddEq("OidTipoAuditoria", this.Oid); _criterios = Criterios.GetChildList(criteria.List <Criterio>()); criteria = Auditoria_Area.GetCriteria(Session()); criteria.AddEq("OidAuditoria", this.Oid); _areas = Auditorias_Areas.GetChildList(criteria.List <Auditoria_Area>()); criteria = Cuestion.GetCriteria(Session()); criteria.AddEq("OidTipoAuditoria", this.Oid); _cuestiones = Cuestiones.GetChildList(criteria.List <Cuestion>()); criteria = Plan_Tipo.GetCriteria(Session()); criteria.AddEq("OidTipo", this.Oid); _planes_tipos = Planes_Tipos.GetChildList(criteria.List <Plan_Tipo>()); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
public void CopyValues(Criterio source) { if (source == null) { return; } _record.CopyValues(source.Base.Record); }
// called to retrieve data from the database private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { TipoAuditoria.LOCK(); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { Criterio.LOCK(AppContext.ActiveSchema.Code); string query = Criterios.SELECT_BY_TIPO_AUDITORIA(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _criterios = Criterios.GetChildList(reader); Auditoria_Area.LOCK(AppContext.ActiveSchema.Code); query = Auditorias_Areas.SELECT_BY_AUDITORIA(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _areas = Auditorias_Areas.GetChildList(reader); Cuestion.LOCK(AppContext.ActiveSchema.Code); query = Cuestiones.SELECT_BY_TIPO_AUDITORIA(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _cuestiones = Cuestiones.GetChildList(criteria.SessionCode, reader); Plan_Tipo.LOCK(AppContext.ActiveSchema.Code); query = Planes_Tipos.SELECT_BY_FIELD("OidTipo", this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _planes_tipos = Planes_Tipos.GetChildList(reader); } } } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }
/// <summary> /// Builds a CriterioList /// </summary> /// <param name="list"></param> /// <returns>CriterioList</returns> public static CriterioList GetList(bool childs) { CriteriaEx criteria = Criterio.GetCriteria(Criterio.OpenSession()); criteria.Childs = childs; criteria.Query = CriterioList.SELECT(); CriterioList list = DataPortal.Fetch <CriterioList>(criteria); CloseSession(criteria.SessionCode); return(list); }
// called to copy objects data from list private void Fetch(IDataReader reader) { this.RaiseListChangedEvents = false; IsReadOnly = false; while (reader.Read()) { this.AddItem(Criterio.GetChild(reader).GetInfo()); } IsReadOnly = true; this.RaiseListChangedEvents = true; }
private void Fetch(int session_code, IDataReader source) { try { _base.CopyValues(source); if (Childs) { Criterio.LOCK(AppContext.ActiveSchema.Code); string query = Criterios.SELECT_BY_TIPO_AUDITORIA(this.Oid); IDataReader reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code)); _criterios = Criterios.GetChildList(reader); Auditoria_Area.LOCK(AppContext.ActiveSchema.Code); query = Auditorias_Areas.SELECT_BY_AUDITORIA(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code)); _areas = Auditorias_Areas.GetChildList(reader); Cuestion.LOCK(AppContext.ActiveSchema.Code); query = Cuestiones.SELECT_BY_TIPO_AUDITORIA(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code)); _cuestiones = Cuestiones.GetChildList(session_code, reader); Plan_Tipo.LOCK(AppContext.ActiveSchema.Code); query = Planes_Tipos.SELECT_BY_FIELD("OidTipo", this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session(session_code)); _planes_tipos = Planes_Tipos.GetChildList(reader); } } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
public static string SELECT() { return(Criterio.SELECT(new QueryConditions(), false)); }
public void CopyFrom(Criterio source) { _base.CopyValues(source); }