internal void DeleteSelf(Alumno_Examen parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } // if we're new then don't update the database if (this.IsNew) { return; } try { parent.Session().Delete(parent.Session().Get <Respuesta_Alumno_ExamenRecord>(Oid)); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkNew(); }
internal void Update(Alumno_Examen parent, ISession sesion) { this.RaiseListChangedEvents = false; // update (thus deleting) any deleted child objects foreach (Respuesta_Alumno_Examen obj in DeletedList) { obj.DeleteSelf(parent); } // now that they are deleted, remove them from memory too DeletedList.Clear(); // AddItem/update any current child objects foreach (Respuesta_Alumno_Examen obj in this) { if (obj.IsNew) { obj.Insert(parent, sesion); } else { obj.Update(parent, sesion); } } this.RaiseListChangedEvents = true; }
internal void Update(Alumno_Examen parent, ISession sesion) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } OidAlumnoExamen = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } Respuesta_Alumno_ExamenRecord obj = sesion.Get <Respuesta_Alumno_ExamenRecord>(Oid); obj.CopyValues(this.Base.Record); sesion.Update(obj); } 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(); }
public static string SELECT(AlumnoInfo item) { return(Alumno_Examen.SELECT(new QueryConditions() { Alumno = item }, false)); }
public void CopyValues(Alumno_Examen source) { if (source == null) { return; } _record.CopyValues(source.Base.Record); }
public static Respuesta_Alumno_Examenes GetChildList(Alumno_Examen parent, bool childs) { CriteriaEx criteria = Respuesta_Alumno_Examen.GetCriteria(parent.SessionCode); criteria.Query = Respuesta_Alumno_Examenes.SELECT_BY_ALUMNO_EXAMEN(parent.Oid); criteria.Childs = childs; return(DataPortal.Fetch <Respuesta_Alumno_Examenes>(criteria)); }
//internal void Insert(Modulo parent) //{ // // if we're not dirty then don't update the database // if (!this.IsDirty) return; // //Debe obtener la sesion del padre pq el objeto es padre a su vez // SessionCode = parent.SessionCode; // _oid_modulo = parent.Oid; // try // { // ValidationRules.CheckRules(); // if (!IsValid) // throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); // parent.Session().Save(this); // _preguntas.Update(this); // _preguntaexamens.Update(this); // _alumnos.Update(this); // } // catch (Exception ex) // { // iQExceptionHandler.TreatException(ex); // } // MarkOld(); //} //internal void Update(Modulo parent) //{ // // if we're not dirty then don't update the database // if (!this.IsDirty) return; // //Debe obtener la sesion del padre pq el objeto es padre a su vez // SessionCode = parent.SessionCode; // _oid_modulo = parent.Oid; // try // { // ValidationRules.CheckRules(); // if (!IsValid) // throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); // Examen obj = parent.Session().Get<Examen>(Oid); // obj.CopyValues(this); // parent.Session().Update(obj); // _preguntas.Update(this); // _preguntaexamens.Update(this); // _alumnos.Update(this); // } // catch (Exception ex) // { // iQExceptionHandler.TreatException(ex); // } // MarkOld(); //} //internal void DeleteSelf(Modulo parent) //{ // // if we're not dirty then don't update the database // if (!this.IsDirty) return; // // if we're new then don't update the database // if (this.IsNew) return; // try // { // SessionCode = parent.SessionCode; // Session().Delete(Session().Get<Examen>(Oid)); // } // catch (Exception ex) // { // iQExceptionHandler.TreatException(ex); // } // MarkNew(); //} #endregion #region Root Data Access // called to retrieve data from the database private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { Examen.DoLOCK(Session()); IDataReader reader = nHManager.Instance.SQLNativeSelect(criteria.Query, Session()); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { Pregunta_Examen.DoLOCK(Session()); string query = Pregunta_Examens.SELECT_BY_EXAMEN(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _preguntas = Pregunta_Examens.GetChildList(reader); PreguntaExamen.DoLOCK(Session()); query = PreguntaExamens.SELECT_BY_EXAMEN(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _preguntaexamens = PreguntaExamens.GetChildList(criteria.SessionCode, reader); Alumno_Examen.DoLOCK(Session()); query = Alumno_Examens.SELECT(GetInfo(false)); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _alumnos = Alumno_Examens.GetChildList(criteria.SessionCode, reader); ExamenPromocion.DoLOCK(Session()); query = ExamenPromociones.SELECT(this); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _promociones = ExamenPromociones.GetChildList(criteria.SessionCode, reader); } } } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }
public static string SELECT_BY_EXAMEN(long oid_examen) { QueryConditions conditions = new QueryConditions() { Examen = ExamenInfo.New() }; conditions.Examen.Oid = oid_examen; return(Alumno_Examen.SELECT(conditions, false)); }
public static Alumno_ExamenList GetChildList(AlumnoInfo parent, bool childs) { CriteriaEx criteria = Alumno_Examen.GetCriteria(Alumno_Examen.OpenSession()); criteria.Query = Alumno_ExamenList.SELECT(parent); criteria.Childs = childs; Alumno_ExamenList list = DataPortal.Fetch <Alumno_ExamenList>(criteria); CloseSession(criteria.SessionCode); return(list); }
public static Respuesta_Alumno_Examen NewChild(Alumno_Examen parent) { if (!CanAddObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } Respuesta_Alumno_Examen obj = new Respuesta_Alumno_Examen(); obj.OidAlumnoExamen = parent.Oid; return(obj); }
/// <summary> /// Retrieve the complete list from db /// </summary> /// <returns>AlumnoList</returns> public static Alumno_ExamenList GetExamenList(long oid_examen) { CriteriaEx criteria = Alumno_Examen.GetCriteria(Alumno_Examen.OpenSession()); criteria.Childs = false; QueryConditions conditions = new QueryConditions() { Examen = Examen.New().GetInfo(false) }; conditions.Examen.Oid = oid_examen; criteria.Query = Alumno_Examen.SELECT(conditions, false); //No criteria. Retrieve all de List Alumno_ExamenList list = DataPortal.Fetch <Alumno_ExamenList>(criteria); CloseSession(criteria.SessionCode); return(list); }
public void CopyFrom(Alumno_Examen source) { _base.CopyValues(source); }
public Respuesta_Alumno_Examen NewItem(Alumno_Examen parent) { this.AddItem(Respuesta_Alumno_Examen.NewChild(parent)); return(this[Count - 1]); }