Exemple #1
0
        private void Fetch(IDataReader source)
        {
            _base.CopyValues(source);

            if (Childs)
            {
                if (nHMng.UseDirectSQL)
                {
                    string      query;
                    IDataReader reader;

                    Payroll.DoLOCK(Session());
                    query    = Payrolls.SELECT(this);
                    reader   = nHMng.SQLNativeSelect(query);
                    _nominas = Payrolls.GetChildList(SessionCode, reader, false);

                    Expense.DoLOCK(Session());
                    query   = Expenses.SELECT(this);
                    reader  = nHMng.SQLNativeSelect(query);
                    _gastos = Expenses.GetChildList(SessionCode, reader, false);
                }
            }

            MarkOld();
        }
Exemple #2
0
        private void DataPortal_Fetch(CriteriaEx criteria)
        {
            string query = string.Empty;

            try
            {
                _base.Record.Oid = 0;
                SessionCode      = criteria.SessionCode;
                Childs           = criteria.Childs;
                query            = criteria.Query;

                if (nHMng.UseDirectSQL)
                {
                    PayrollBatch.DoLOCK(Session());
                    IDataReader reader = nHMng.SQLNativeSelect(query, Session());

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

                    if (Childs)
                    {
                        Payroll.DoLOCK(Session());
                        query    = Payrolls.SELECT(this);
                        reader   = nHMng.SQLNativeSelect(query);
                        _nominas = Payrolls.GetChildList(SessionCode, reader);

                        Expense.DoLOCK(Session());
                        query   = Expenses.SELECT(this);
                        reader  = nHMng.SQLNativeSelect(query);
                        _gastos = Expenses.GetChildList(SessionCode, reader);
                    }
                }

                CalculateTotal();

                MarkOld();
            }
            catch (Exception ex)
            {
                if (Transaction() != null)
                {
                    Transaction().Rollback();
                }
                iQExceptionHandler.TreatException(ex, new object[] { query });
            }
        }