Exemple #1
0
        internal void CopyValues(BudgetLine source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);

            _expediente = source.Expediente;
        }
Exemple #2
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)
                {
                    if (nHMng.UseDirectSQL)
                    {
                        BudgetLine.DoLOCK(Session());
                        string      query  = BudgetLines.SELECT(this);
                        IDataReader reader = nHMng.SQLNativeSelect(query, Session());
                        _conceptos = BudgetLines.GetChildList(reader, false);
                    }
                }
            }
            catch (Exception ex) { throw ex; }

            MarkOld();
        }
Exemple #3
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)
                {
                    Budget.DoLOCK(Session());
                    IDataReader reader = nHMng.SQLNativeSelect(criteria.Query, Session());

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

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

                        BudgetLine.DoLOCK(Session());
                        query      = BudgetLines.SELECT(this);
                        reader     = nHMng.SQLNativeSelect(query, Session());
                        _conceptos = BudgetLines.GetChildList(reader);
                    }
                }

                MarkOld();
            }
            catch (Exception ex)
            {
                if (!SharedTransaction && Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex);
            }
        }
 public void CopyFrom(BudgetLine source)
 {
     _base.CopyValues(source);
 }
 public static string SELECT(QueryConditions conditions)
 {
     return(BudgetLine.SELECT(conditions, false));
 }