Beispiel #1
0
        /// <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)
                {
                    string query = string.Empty;

                    if (Childs)
                    {
                        SerieFamilia.DoLOCK(Session());
                        query = SerieFamilias.SELECT(this);
                        IDataReader reader = nHManager.Instance.SQLNativeSelect(query, Session());
                        _serie_familias = SerieFamilias.GetChildList(SessionCode, reader, Childs);
                    }
                }
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Beispiel #2
0
        internal void CopyValues(SerieFamilia source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);

            _familia = source.Familia;
        }
Beispiel #3
0
        private static SerieFamiliaList GetList(string query, bool childs)
        {
            CriteriaEx criteria = SerieFamilia.GetCriteria(SerieFamilia.OpenSession());

            criteria.Childs = childs;

            criteria.Query = query;
            SerieFamiliaList list = DataPortal.Fetch <SerieFamiliaList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
Beispiel #4
0
        public static SerieFamiliaList GetList(bool childs)
        {
            CriteriaEx criteria = SerieFamilia.GetCriteria(SerieFamilia.OpenSession());

            criteria.Childs = childs;

            criteria.Query = SerieFamiliaList.SELECT();

            SerieFamiliaList list = DataPortal.Fetch <SerieFamiliaList>(criteria);

            CloseSession(criteria.SessionCode);
            return(list);
        }
Beispiel #5
0
        /// <summary>
        /// Obtiene un registro de la base de datos
        /// </summary>
        /// <param name="criteria">Criterios de consulta</param>
        /// <remarks>Lo llama el DataPortal tras generar el objeto</remarks>
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            try
            {
                _base.Record.Oid = 0;
                SessionCode      = criteria.SessionCode;
                Childs           = criteria.Childs;

                if (nHMng.UseDirectSQL)
                {
                    Serie.DoLOCK(Session());
                    IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session());

                    if (reader.Read())
                    {
                        _base.CopyValues(reader);
                    }

                    if (Childs)
                    {
                        string query = string.Empty;

                        SerieFamilia.DoLOCK(Session());
                        query           = SerieFamilias.SELECT(this);
                        reader          = nHManager.Instance.SQLNativeSelect(query, Session());
                        _serie_familias = SerieFamilias.GetChildList(SessionCode, reader, Childs);
                    }
                }

                MarkOld();
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
Beispiel #6
0
 public static string SELECT(Library.Store.QueryConditions conditions)
 {
     return(SerieFamilia.SELECT(conditions, false));
 }
 public void CopyFrom(SerieFamilia source)
 {
     _base.CopyValues(source);
 }