internal void Insert(Submodulo parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } OidSubmodulo = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } parent.Session().Save(this.Base.Record); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
internal void Update(Submodulo 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; OidSubmodulo = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } ClaseTeoricaRecord obj = parent.Session().Get <ClaseTeoricaRecord>(Oid); obj.CopyValues(this.Base.Record); parent.Session().Update(obj); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
internal void Update(Submodulo parent) { this.RaiseListChangedEvents = false; // update (thus deleting) any deleted child objects foreach (Tema 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 (Tema obj in this) { if (obj.IsNew) { obj.Insert(parent); } else { obj.Update(parent); } } this.RaiseListChangedEvents = true; }
internal void DeleteSelf(Submodulo 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 <ClaseTeoricaRecord>(Oid)); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkNew(); }
internal void DeleteSelf(Submodulo 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 <Submodulo_Instructor_PromocionRecord>(Oid)); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkNew(); }
internal void Update(Submodulo parent) { // if we're not dirty then don't update the database if (!this.IsDirty) { return; } OidSubmodulo = parent.Oid; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } Submodulo_Instructor_PromocionRecord obj = parent.Session().Get <Submodulo_Instructor_PromocionRecord>(Oid); obj.CopyValues(this.Base.Record); parent.Session().Update(obj); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
public void CopyValues(Submodulo source) { if (source == null) { return; } _record.CopyValues(source.Base.Record); }
public static ClaseTeorica NewChild(Submodulo parent) { if (!CanAddObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } ClaseTeorica obj = new ClaseTeorica(); obj.OidSubmodulo = parent.Oid; return(obj); }
public static Submodulo_Instructor_Promocion NewChild(Submodulo parent) { if (!CanAddObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } Submodulo_Instructor_Promocion obj = new Submodulo_Instructor_Promocion(); obj.OidSubmodulo = parent.Oid; return(obj); }
/// <summary> /// Retrieve the complete list from db /// </summary> /// <returns>SubmoduloList</returns> public static SubmoduloList GetModuloList(long oid_modulo, bool childs) { CriteriaEx criteria = Submodulo.GetCriteria(SubmoduloList.OpenSession()); criteria.Childs = childs; criteria.Query = Submodulos.SELECT_BY_MODULO(oid_modulo); //No criteria. Retrieve all de List SubmoduloList list = DataPortal.Fetch <SubmoduloList>(criteria); CloseSession(criteria.SessionCode); return(list); }
// private SubmoduloList() { } /// <summary> /// Retrieve the complete list from db /// </summary> /// <returns>SubmoduloList</returns> public static SubmoduloList GetList(bool childs) { CriteriaEx criteria = Submodulo.GetCriteria(SubmoduloList.OpenSession()); criteria.Childs = childs; //No criteria. Retrieve all de List criteria.Query = SubmoduloList.SELECT(); SubmoduloList list = DataPortal.Fetch <SubmoduloList>(criteria); CloseSession(criteria.SessionCode); return(list); }
private void DataPortal_Fetch(CriteriaEx criteria) { try { SessionCode = criteria.SessionCode; Childs = criteria.Childs; if (nHMng.UseDirectSQL) { Modulo.DoLOCK(Session()); IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session()); if (reader.Read()) { _base.CopyValues(reader); } if (Childs) { string query = string.Empty; Submodulo.DoLOCK(Session()); query = Submodulos.SELECT_BY_MODULO(this.Oid); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _submodulos = Submodulos.GetChildList(criteria.SessionCode, reader); Material_Plan.DoLOCK(Session()); query = Material_Plans.SELECT(GetInfo(false)); reader = nHManager.Instance.SQLNativeSelect(query, Session()); _materiales = Material_Plans.GetChildList(reader); } } } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); } }
internal void Insert(Submodulo parent) { UpdateCodigoOrden(); // 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; OidSubmodulo = parent.Oid; OidModulo = parent.OidModulo; try { ValidationRules.CheckRules(); if (!IsValid) { throw new iQValidationException(moleQule.Library.Resources.Messages.GENERIC_VALIDATION_ERROR); } parent.Session().Save(this.Base.Record); //_preguntas.Update(this); //_p_examenes.Update(this); } catch (Exception ex) { iQExceptionHandler.TreatException(ex); } MarkOld(); }
public Submodulo_Instructor NewItem(Submodulo parent) { this.AddItem(Submodulo_Instructor.NewChild(parent)); return(this[Count - 1]); }
public static string SELECT() { return(Submodulo.SELECT(new QueryConditions(), false)); }
public Tema NewItem(Submodulo parent) { this.AddItem(Tema.NewChild(parent)); return(this[Count - 1]); }
public void CopyFrom(Submodulo source) { _base.CopyValues(source); }
public ClaseTeorica NewItem(Submodulo parent) { this.AddItem(ClaseTeorica.NewChild(parent)); return(this[Count - 1]); }