public virtual void LoadChilds(Type type, bool get_childs, bool get_gchilds) { if (type.Equals(typeof(Submodulos))) { _submodulos = Submodulos.GetChildList(this, get_childs, get_gchilds); } else if (type.Equals(typeof(Material_Plans))) { _materiales = Material_Plans.GetChildList(this, get_childs); } }
private void DataPortal_Create(CriteriaCs criteria) { Random r = new Random(); Oid = (long)r.Next(); Codigo = (0).ToString(Resources.Defaults.MODULO_CODE_FORMAT); //_preguntas = Preguntas.NewChildList(); //_p_examenes = PreguntaExamens.NewChildList(); _submodulos = Submodulos.NewChildList(); //_examenes = Examens.NewChildList(); _materiales = Material_Plans.NewChildList(); //_plantillas = PlantillaExamenes.NewChildList(); }
/// <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); }
public HComboBoxSourceList(Submodulos lista) { AddEmptyItem(); foreach (Submodulo item in lista) { ComboBoxSource combo = new ComboBoxSource(); combo.Texto = item.Codigo; combo.Oid = item.Oid; combo.OidAjeno = item.OidModulo; this.Add(combo); } }
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); } }
public static string SELECT_BY_MODULO(long oid_modulo) { return(Submodulos.SELECT_BY_MODULO(oid_modulo, false)); }