Пример #1
0
 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);
     }
 }
Пример #2
0
        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);
            }
        }