private void Fetch(Auditoria source) { try { SessionCode = source.SessionCode; _base.CopyValues(source); CriteriaEx criteria = CuestionAuditoria.GetCriteria(Session()); criteria.AddEq("OidAuditoria", this.Oid); _cuestiones = CuestionesAuditoria.GetChildList(criteria.List <CuestionAuditoria>()); criteria = InformeDiscrepancia.GetCriteria(Session()); criteria.AddEq("OidAuditoria", this.Oid); _informes = InformesDiscrepancias.GetChildList(criteria.List <InformeDiscrepancia>()); criteria = HistoriaAuditoria.GetCriteria(Session()); criteria.AddEq("OidAuditoria", this.Oid); _historial = HistoriaAuditorias.GetChildList(criteria.List <HistoriaAuditoria>()); criteria = NotificacionInterna.GetCriteria(Session()); criteria.AddEq("OidAsociado", this.Oid); criteria.AddEq("TipoAsociado", (long)TipoNotificacionAsociado.COMUNICADO_AUDITORIA); _notificaciones = NotificacionesInternas.GetChildList(criteria.List <NotificacionInterna>()); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
private void Fetch(Examen source) { try { SessionCode = source.SessionCode; _base.CopyValues(source); CriteriaEx criteria = Pregunta_Examen.GetCriteria(Session()); criteria.AddEq("OidExamen", this.Oid); _preguntas = Pregunta_Examens.GetChildList(criteria.List <Pregunta_Examen>()); criteria = PreguntaExamen.GetCriteria(Session()); criteria.AddEq("OidExamen", this.Oid); _preguntaexamens = PreguntaExamens.GetChildList(criteria.List <PreguntaExamen>()); criteria = Alumno_Examen.GetCriteria(Session()); criteria.AddEq("OidExamen", this.Oid); _alumnos = Alumno_Examens.GetChildList(criteria.List <Alumno_Examen>()); criteria = ExamenPromocion.GetCriteria(Session()); criteria.AddEq("OidExamen", this.Oid); _promociones = ExamenPromociones.GetChildList(criteria.List <ExamenPromocion>()); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
private void Fetch(MaterialDocente source) { try { SessionCode = source.SessionCode; _base.CopyValues(source); CriteriaEx criteria = RevisionMaterial.GetCriteria(Session()); criteria.AddEq("OidMaterial", this.Oid); _revisiones = RevisionMaterials.GetChildList(criteria.List <RevisionMaterial>()); criteria = Material_Plan.GetCriteria(Session()); criteria.AddEq("OidMaterial", this.Oid); _planes = Material_Plans.GetChildList(criteria.List <Material_Plan>()); criteria = Material_Alumno.GetCriteria(Session()); criteria.AddEq("OidMaterial", this.Oid); _alumnos = Material_Alumnos.GetChildList(criteria.List <Material_Alumno>()); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
private void Fetch(InformeDiscrepancia source) { try { SessionCode = source.SessionCode; _base.CopyValues(source); CriteriaEx criteria = InformeAmpliacion.GetCriteria(Session()); criteria.AddEq("OidInformeDiscrepancia", this.Oid); _ampliaciones = InformesAmpliaciones.GetChildList(criteria.List <InformeAmpliacion>()); criteria = InformeCorrector.GetCriteria(Session()); criteria.AddEq("OidInformeDiscrepancia", this.Oid); _correctores = InformesCorrectores.GetChildList(criteria.List <InformeCorrector>()); criteria = Discrepancia.GetCriteria(Session()); criteria.AddEq("OidInformeDiscrepancia", this.Oid); _discrepancias = Discrepancias.GetChildList(criteria.List <Discrepancia>()); criteria = NotificacionInterna.GetCriteria(Session()); criteria.AddEq("OidAsociado", this.Oid); criteria.AddEq("TipoAsociado", (long)TipoNotificacionAsociado.INFORME_DISCREPANCIAS); _notificaciones = NotificacionesInternas.GetChildList(criteria.List <NotificacionInterna>()); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
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(); }
private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { PlanEstudios.DoLOCK(Session()); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { string query = string.Empty; ClaseTeorica.DoLOCK(Session()); query = ClaseTeoricas.SELECT_BY_PLAN(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _c_teoricas = ClaseTeoricas.GetChildList(reader); ClasePractica.DoLOCK(Session()); query = ClasePracticas.SELECT_BY_PLAN(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _c_practicas = ClasePracticas.GetChildList(reader); } } else { _base.Record.CopyValues((PlanEstudiosRecord)(criteria.UniqueResult())); //Session().Lock(Session().Get<PlanEstudiosRecord>(Oid), LockMode.UpgradeNoWait); if (Childs) { criteria = ClaseTeorica.GetCriteria(Session()); criteria.AddEq("OidPlan", this.Oid); _c_teoricas = ClaseTeoricas.GetChildList(criteria.List <ClaseTeorica>()); criteria = ClasePractica.GetCriteria(Session()); criteria.AddEq("OidPlan", this.Oid); _c_practicas = ClasePracticas.GetChildList(criteria.List <ClasePractica>()); } } } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }
/// <summary> /// Construye el objeto y se encarga de obtener los /// hijos si los tiene y se solicitan /// </summary> /// <param name="source">DataReader fuente</param> private void Fetch(IDataReader source) { try { _base.CopyValues(source); if (Childs) { if (nHMng.UseDirectSQL) { LineaInventario.DoLOCK(Session()); string query = LineaInventarios.SELECT(this); IDataReader reader = nHMng.SQLNativeSelect(query, Session()); _lineainventarios = LineaInventarios.GetChildList(reader, false); } else { CriteriaEx criteria = LineaInventario.GetCriteria(Session()); criteria.AddEq("OidInventario", this.Oid); _lineainventarios = LineaInventarios.GetChildList(criteria.List <LineaInventario>()); } } } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
private void Fetch(CierreCaja source) { try { SessionCode = source.SessionCode; _base.CopyValues(source); if (Childs) { if (nHMng.UseDirectSQL) { CashLine.DoLOCK(Session()); string query = CashLines.SELECT_BY_CIERRE(this.Oid); IDataReader reader = nHMng.SQLNativeSelect(query, Session()); _lineas = CashLines.GetChildList(reader, false); } else { CriteriaEx criteria = CashLine.GetCriteria(Session()); criteria.AddEq("OidCierre", this.Oid); _lineas = CashLines.GetChildList(criteria.List <CashLine>()); } UpdateSaldo(); } } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
/// <summary> /// Builds a PuertoList from IList<!--<Puerto>--> and retrieve PuertoInfo Childs from DB /// </summary> /// <param name="list"></param> /// <returns>PuertoList</returns> public static PuertoList GetChildList(IList <Puerto> list) { PuertoList flist = new PuertoList(); if (list != null) { int sessionCode = Puerto.OpenSession(); CriteriaEx criteria = null; flist.IsReadOnly = false; foreach (Puerto item in list) { criteria = PuertoDespachante.GetCriteria(sessionCode); criteria.AddEq("OidPuerto", item.Oid); criteria.AddOrder("Codigo", true); item.PuertoDespachantes = PuertoDespachantes.GetChildList(criteria.List <PuertoDespachante>()); flist.AddItem(item.GetInfo()); } flist.IsReadOnly = true; Puerto.CloseSession(sessionCode); } return(flist); }
// called to retrieve data from the database private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { Submodulo.DoLOCK(Session()); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { string query; Tema.DoLOCK(Session()); query = Temas.SELECT_BY_OID(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _temas = Temas.GetChildList(reader); } } else { _base.Record.CopyValues((SubmoduloRecord)(criteria.UniqueResult())); //Session().Lock(Session().Get<SubmoduloRecord>(Oid), LockMode.UpgradeNoWait); if (Childs) { criteria = Tema.GetCriteria(Session()); criteria.AddEq("OidSubmodulo", this.Oid); _temas = Temas.GetChildList(criteria.List <Tema>()); } } } catch (NHibernate.ADOException) { if (Transaction() != null) { Transaction().Rollback(); } throw new iQLockException(moleQule.Library.Resources.Messages.LOCK_ERROR); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }
protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; SessionCode = criteria.SessionCode; try { IList list = criteria.List(); if (list.Count > 0) { IsReadOnly = false; foreach (SchemaUser item in list) { this.Add(item.GetInfo()); } IsReadOnly = true; } } catch (Exception ex) { string msg = Resources.Errors.NO_OPERATION + System.Environment.NewLine + iQExceptionHandler.GetAllMessages(ex); throw new iQPersistentException(msg); } this.RaiseListChangedEvents = true; }
// called to retrieve data from db protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; SessionCode = criteria.SessionCode; try { IList list = criteria.List(); if (list.Count > 0) { IsReadOnly = false; foreach (ApplicationSetting item in list) { this.Add(item.GetInfo()); } IsReadOnly = true; } } catch (Exception ex) { throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } this.RaiseListChangedEvents = true; }
/// <summary> /// Builds a FacturaRecibidaList from IList<!--<FacturaRecibida>--> and retrieve FacturaRecibidaInfo Childs from DB /// </summary> /// <param name="list"></param> /// <returns>FacturaRecibidaList</returns> public static InputInvoiceList GetChildList(IList <InputInvoice> list) { InputInvoiceList flist = new InputInvoiceList(); if (list != null) { int sessionCode = InputInvoice.OpenSession(); CriteriaEx criteria = null; flist.IsReadOnly = false; foreach (InputInvoice item in list) { criteria = InputInvoiceLine.GetCriteria(sessionCode); criteria.AddEq("OidFactura", item.Oid); item.Conceptos = InputInvoiceLines.GetChildList(criteria.List <InputInvoiceLine>()); flist.AddItem(item.GetInfo()); } flist.IsReadOnly = true; InputInvoice.CloseSession(sessionCode); } return(flist); }
/// <summary> /// Builds a DocumentoList from IList<!--<Documento>--> and retrieve DocumentoInfo Childs from DB /// </summary> /// <param name="list"></param> /// <returns>DocumentoList</returns> public static DocumentoList GetChildList(IList <Documento> list) { DocumentoList flist = new DocumentoList(); if (list != null) { int sessionCode = Documento.OpenSession(); CriteriaEx criteria = null; flist.IsReadOnly = false; foreach (Documento item in list) { criteria = AgenteDocumento.GetCriteria(sessionCode); criteria.AddEq("OidDocumento", item.Oid); criteria.AddOrder("Codigo", true); item.AgenteDocumentos = AgenteDocumentos.GetChildList(criteria.List <AgenteDocumento>()); flist.Add(item.GetInfo()); } flist.IsReadOnly = true; Documento.CloseSession(sessionCode); } return(flist); }
// called to retrieve data from the database private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { IncidenciaCronograma.DoLOCK(Session()); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { IncidenciaSesionCronograma.DoLOCK(Session()); //PENDIENTE //string query = IncidenciaSesionesCronogramas.SELECT_SESIONES_PLAN(this.Oid); //reader = nHManager.Instance.SQLNativeSelect(query, Session()); //_sesiones = IncidenciaSesionesCronogramas.GetChildList(reader); } } else { _base.Record.CopyValues((IncidenciaCronogramaRecord)(criteria.UniqueResult())); //Session().Lock(Session().Get<IncidenciaCronogramaRecord>(Oid), LockMode.UpgradeNoWait); if (Childs) { criteria = IncidenciaSesionCronograma.GetCriteria(Session()); criteria.AddEq("OidIncidencia", this.Oid); _sesiones = IncidenciaSesionesCronogramas.GetChildList(criteria.List <IncidenciaSesionCronograma>()); } } } catch (NHibernate.ADOException) { if (Transaction() != null) { Transaction().Rollback(); } throw new iQLockException(moleQule.Library.Resources.Messages.LOCK_ERROR); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }
public static OutputDeliveryList GetChildList(IList <OutputDelivery> list) { OutputDeliveryList flist = new OutputDeliveryList(); if (list != null) { int sessionCode = OutputDelivery.OpenSession(); CriteriaEx criteria = null; flist.IsReadOnly = false; foreach (OutputDelivery item in list) { criteria = OutputDeliveryLine.GetCriteria(sessionCode); criteria.AddEq("OidAlbaran", item.Oid); item.Conceptos = OutputDeliveryLines.GetChildList(criteria.List <OutputDeliveryLine>()); flist.AddItem(item.GetInfo()); } flist.IsReadOnly = true; OutputDelivery.CloseSession(sessionCode); } return(flist); }
// called to retrieve data from the database private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { ClaseExtra.DoLOCK(Session()); IDataReader reader = ClaseExtra.DoSELECT(AppContext.ActiveSchema.Code, Session(), criteria.Oid); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { Sesion.DoLOCK(Session()); string query = Sesions.SELECT_BY_CLASE_EXTRA(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _sesions = Sesions.GetChildList(reader); } } else { _base.Record.CopyValues((ClaseExtraRecord)(criteria.UniqueResult())); //Session().Lock(Session().Get<ClaseExtraRecord>(Oid), LockMode.UpgradeNoWait); if (Childs) { criteria = Sesion.GetCriteria(Session()); criteria.AddEq("OidClaseExtra", this.Oid); _sesions = Sesions.GetChildList(criteria.List <Sesion>()); } } } catch (NHibernate.ADOException) { if (Transaction() != null) { Transaction().Rollback(); } throw new iQLockException(moleQule.Library.Resources.Messages.LOCK_ERROR); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }
//private void DataPortal_Fetch(CriteriaEx criteria) //{ // try // { // SessionCode = criteria.SessionCode; // CopyValues((Empresa)(criteria.UniqueResult())); // Session().Lock(Session().Get<Empresa>(Oid), LockMode.UpgradeNoWait); // criteria = ContactoE.GetCriteria(Session()); // criteria.AddEq("OidEmpresa", this.Oid); // _contactos = ContactosE.GetChildList(criteria.List<ContactoE>()); // } // catch (NHibernate.ADOException) // { // if (Transaction() != null) Transaction().Rollback(); // throw new iQLockException(Resources.Messages.LOCK_ERROR); // } // catch (Exception ex) // { // if (Transaction() != null) Transaction().Rollback(); // iQExceptionHandler.TreatException(ex); // } //} private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { Empresa.DoLOCK("COMMON", Session()); IDataReader reader = Empresa.DoSELECT("COMMON", Session(), criteria.Oid); if (reader.Read()) { CopyValues(reader); } if (Childs) { ContactoEmpresa.DoLOCK("COMMON", Session()); string query = ContactoEmpresas.SELECT_BY_FIELD("COMMON", "OidEmpresa", this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _contactos = ContactoEmpresas.GetChildList(reader); } } else { CopyValues((Empresa)(criteria.UniqueResult())); Session().Lock(Session().Get <Empresa>(Oid), LockMode.UpgradeNoWait); if (Childs) { criteria = ContactoEmpresa.GetCriteria(Session()); criteria.AddEq("OidEmpresa", this.Oid); _contactos = ContactoEmpresas.GetChildList(criteria.List <ContactoEmpresa>()); } } } catch (NHibernate.ADOException) { if (Transaction() != null) { Transaction().Rollback(); } throw new iQLockException(moleQule.Library.Resources.Messages.LOCK_ERROR); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }
private void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; SessionCode = criteria.SessionCode; try { if (nHMng.UseDirectSQL) { Instructor.DoLOCK(Session()); IDataReader reader = null; reader = Instructores.DoNativeSELECT(AppContext.ActiveSchema.Code, criteria.Session); while (reader.Read()) { Instructor item = Instructor.GetChild(reader); item.MarkItemOld(); this.AddItem(item); } } else { IList list = criteria.List(); foreach (Instructor item in list) { //Bloqueamos todos los elementos de la lista //Session().Lock(Session().Get<InstructorRecord>(item.Oid), LockMode.UpgradeNoWait); this.AddItem(Instructor.Get(item)); } } } catch (NHibernate.ADOException) { if (Transaction() != null) { Transaction().Rollback(); } throw new iQLockException(moleQule.Library.Resources.Messages.LOCK_ERROR); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } finally { this.RaiseListChangedEvents = true; } }
// called to retrieve data from db protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; Childs = criteria.Childs; SessionCode = criteria.SessionCode; try { if (nHMng.UseDirectSQL) { IDataReader reader; if (criteria.Query == string.Empty) { string query = ParteAsistenciaList.SELECT(); reader = nHManager.Instance.SQLNativeSelect(query); } else { reader = nHManager.Instance.SQLNativeSelect(criteria.Query); } IsReadOnly = false; while (reader.Read()) { this.AddItem(ParteAsistenciaInfo.Get(reader, Childs)); } IsReadOnly = true; } else { IList <ParteAsistencia> list = criteria.List <ParteAsistencia>(); if (list.Count > 0) { IsReadOnly = false; foreach (ParteAsistencia item in list) { this.AddItem(item.GetInfo()); } IsReadOnly = true; } } } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } this.RaiseListChangedEvents = true; }
// called to retrieve data from db protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; Childs = criteria.Childs; SessionCode = criteria.SessionCode; try { if (nHMng.UseDirectSQL) { if (criteria.Query == string.Empty) { criteria.Query = Horarios.SELECT(); } IDataReader reader = null; reader = nHMng.SQLNativeSelect(criteria.Query, Session()); IsReadOnly = false; while (reader.Read()) { this.AddItem(HorarioInfo.Get(reader, Childs)); } IsReadOnly = true; } else { IList <Horario> list = criteria.List <Horario>(); if (list.Count > 0) { IsReadOnly = false; foreach (Horario item in list) { this.AddItem(item.GetInfo()); } IsReadOnly = true; } } } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } this.RaiseListChangedEvents = true; }
/// <summary> /// Construye el objeto y se encarga de obtener los /// hijos si los tiene y se solicitan /// </summary> /// <param name="criteria">Criterios de la consulta</param> private void Fetch(CriteriaEx criteria) { try { this.RaiseListChangedEvents = false; SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { Incidencia.DoLOCK(Session()); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); while (reader.Read()) { this.AddItem(Incidencia.GetChild(reader, Childs)); } } else { IList list = criteria.List(); foreach (Incidencia item in list) { //Bloqueamos todos los elementos de la lista Session().Lock(Session().Get <IncidenciaRecord>(item.Oid), LockMode.UpgradeNoWait); this.AddItem(Incidencia.GetChild(item, Childs)); } } } catch (NHibernate.ADOException ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.ThrowExceptionByCode(ex); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } finally { this.RaiseListChangedEvents = true; } }
private void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; SessionCode = criteria.SessionCode; try { if (nHMng.UseDirectSQL) { TipoEntidad.DoLOCK(AppContext.CommonSchema, Session()); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); while (reader.Read()) { this.AddItem(TipoEntidad.GetChild(reader)); } } else { IList list = criteria.List(); foreach (TipoEntidad item in list) { //Bloqueamos todos los elementos de la lista Session().Lock(Session().Get <EntityTypeRecord>(item.Oid), LockMode.UpgradeNoWait); this.AddItem(TipoEntidad.GetChild(item)); } } } catch (NHibernate.ADOException) { if (Transaction() != null) { Transaction().Rollback(); } throw new iQLockException(Resources.Messages.LOCK_ERROR); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } throw new iQPersistentException(iQExceptionHandler.GetAllMessages(ex)); } finally { this.RaiseListChangedEvents = true; } }
private void Fetch(string hql_query) { this.RaiseListChangedEvents = false; try { IList list = nHMng.HQLSelect(hql_query); SessionCode = User.OpenSession(); if (list.Count > 0) { foreach (User item in list) { item.MarkItemChild(); item.SessionCode = SessionCode; CriteriaEx criteria = Privilege.GetCriteria(SessionCode); criteria.AddEq("OidUser", item.Oid); item.Licences = Privileges.GetChildList(criteria.List <Privilege>()); criteria = SchemaUser.GetCriteria(SessionCode); criteria.AddEq("OidUser", item.Oid); item.Schemas = SchemasUsers.GetChildList(criteria.List <SchemaUser>()); this.AddItem(item); } } BeginTransaction(); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } finally { this.RaiseListChangedEvents = true; } }
private void Fetch(Discrepancia source) { try { SessionCode = source.SessionCode; _base.CopyValues(source); CriteriaEx criteria = Ampliacion.GetCriteria(Session()); criteria.AddEq("OidDiscrepancia", this.Oid); _ampliaciones = Ampliaciones.GetChildList(criteria.List <Ampliacion>()); criteria = AccionCorrectora.GetCriteria(Session()); criteria.AddEq("OidDiscrepancia", this.Oid); _correctoras = AccionesCorrectoras.GetChildList(criteria.List <AccionCorrectora>()); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
// called to retrieve data from db protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; Childs = criteria.Childs; SessionCode = criteria.SessionCode; try { if (nHMng.UseDirectSQL) { //ClaseExtra.DoLOCK( Session()); IDataReader reader = null; reader = nHMng.SQLNativeSelect(criteria.Query, Session()); IsReadOnly = false; while (reader.Read()) { this.AddItem(ClaseExtraInfo.Get(reader, Childs)); } IsReadOnly = true; } else { IList <ClaseExtra> list = criteria.List <ClaseExtra>(); if (list.Count > 0) { IsReadOnly = false; foreach (ClaseExtra item in list) { this.AddItem(item.GetInfo()); } IsReadOnly = true; } } } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } this.RaiseListChangedEvents = true; }
// called to retrieve data from db protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; Childs = criteria.Childs; SessionCode = criteria.SessionCode; try { if (nHMng.UseDirectSQL) { //Promocion.DoLOCK( Session()); //IDataReader reader = Promocions.SELECT( Session()); IDataReader reader = nHManager.Instance.SQLNativeSelect(criteria.Query, Session()); IsReadOnly = false; while (reader.Read()) { this.AddItem(PromocionInfo.Get(reader, Childs)); } IsReadOnly = true; } else { IList <Promocion> list = criteria.List <Promocion>(); if (list.Count > 0) { IsReadOnly = false; foreach (Promocion item in list) { this.AddItem(item.GetInfo()); } IsReadOnly = true; } } } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } this.RaiseListChangedEvents = true; }
// called to retrieve data from db protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; SessionCode = criteria.SessionCode; Childs = criteria.Childs; try { if (nHMng.UseDirectSQL) { IDataReader reader; IEnumerable list = criteria.IterateExpressionEntries(); reader = nHMng.SQLNativeSelect(criteria.Query, Session()); IsReadOnly = false; while (reader.Read()) { this.AddItem(Submodulo_Instructor_PromocionInfo.Get(reader, Childs)); } IsReadOnly = true; } else { IList <Submodulo_Instructor_Promocion> list = criteria.List <Submodulo_Instructor_Promocion>(); if (list.Count > 0) { IsReadOnly = false; foreach (Submodulo_Instructor_Promocion item in list) { this.AddItem(item.GetInfo()); } IsReadOnly = true; } } } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } this.RaiseListChangedEvents = true; }
/// <summary> /// Construye el objeto y se encarga de obtener los /// hijos si los tiene y se solicitan /// </summary> /// <param name="criteria">Criterios de la consulta</param> protected override void Fetch(CriteriaEx criteria) { this.RaiseListChangedEvents = false; SessionCode = criteria.SessionCode; Childs = criteria.Childs; try { if (nHMng.UseDirectSQL) { IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); IsReadOnly = false; while (reader.Read()) { this.AddItem(BudgetInfo.GetChild(reader, Childs)); } IsReadOnly = true; } else { IList list = criteria.List(); if (list.Count > 0) { IsReadOnly = false; foreach (Budget item in list) { this.Add(item.GetInfo(false)); } IsReadOnly = true; } } } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } this.RaiseListChangedEvents = true; }
private void Fetch(InformeAmpliacion source) { try { SessionCode = source.SessionCode; _base.CopyValues(source); CriteriaEx criteria = Ampliacion.GetCriteria(Session()); criteria.AddEq("OidInformeAmpliacion", this.Oid); _ampliaciones = Ampliaciones.GetChildList(criteria.List <Ampliacion>()); criteria = NotificacionInterna.GetCriteria(Session()); criteria.AddEq("OidAsociado", this.Oid); criteria.AddEq("TipoAsociado", (long)TipoNotificacionAsociado.SOLICITUD_AMPLIACION); _notificaciones = NotificacionesInternas.GetChildList(criteria.List <NotificacionInterna>()); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }