Example #1
0
        /// <summary>
        /// Gets a page of entity rows with a <see cref="TList{VJobCandidateEducation}" /> from the DataSource with a where clause and order by clause.
        /// </summary>
        /// <param name="whereClause">Specifies the condition for the rows returned by a query (Name='John Doe', Name='John Doe' AND Id='1', Name='John Doe' OR Id='1').</param>
        /// <param name="orderBy">Specifies the sort criteria for the rows in the DataSource (Name ASC; BirthDay DESC, Name ASC).</param>
        /// <param name="start">Row number at which to start reading.</param>
        /// <param name="pageLength">Number of rows to return.</param>
        /// <param name="totalCount">Out Parameter, Number of rows in the DataSource.</param>
        /// <remarks></remarks>
        /// <returns>Returns a typed collection of <c>VJobCandidateEducation</c> objects.</returns>
        public override VList <VJobCandidateEducation> GetPaged(string whereClause, string orderBy, int start, int pageLength, out int totalCount)
        {
            // throws security exception if not authorized
            //SecurityContext.IsAuthorized("GetPaged");

            // get this data
            VList <VJobCandidateEducation> list = null;

            totalCount = -1;
            TransactionManager transactionManager = null;

            try
            {
                //since this is a read operation, don't create a tran by default, only use tran if provided to us for custom isolation level
                transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
                NetTiersProvider dataProvider = ConnectionScope.Current.DataProvider;

                //Access repository
                list = dataProvider.VJobCandidateEducationProvider.GetPaged(transactionManager, whereClause, orderBy, start, pageLength, out totalCount);

                //if borrowed tran, leave open for next call
            }
            catch (Exception exc)
            {
                //if open, rollback, it's possible this is part of a larger commit
                if (transactionManager != null && transactionManager.IsOpen)
                {
                    transactionManager.Rollback();
                }

                //Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
                {
                    throw;
                }
            }
            return(list);
        }
Example #2
0
        /// <summary>
        ///     Returns rows from the DataSource that meet the parameter conditions.
        /// </summary>
        /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
        /// <param name="orderBy">Specifies the sort criteria for the rows in the DataSource (Name ASC; BirthDay DESC, Name ASC);</param>
        /// <param name="start">Row number at which to start reading.</param>
        /// <param name="pageLength">Number of rows to return.</param>
        /// <param name="count">out. The number of rows that match this query.</param>
        /// <returns>Returns a typed collection of <c>VProductModelInstructions</c> objects.</returns>
        public override VList <VProductModelInstructions> Find(IFilterParameterCollection parameters, string orderBy, int start, int pageLength, out int count)
        {
            // throws security exception if not authorized
            //SecurityContext.IsAuthorized("Find");

            // get this data
            TransactionManager transactionManager  = null;
            VList <VProductModelInstructions> list = null;

            count = -1;

            try
            {
                //since this is a read operation, don't create a tran by default, only use tran if provided to us for custom isolation level
                transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
                NetTiersProvider dataProvider = ConnectionScope.Current.DataProvider;

                //Access repository
                list = dataProvider.VProductModelInstructionsProvider.Find(transactionManager, parameters, orderBy, start, pageLength, out count);
            }
            catch (Exception exc)
            {
                //if open, rollback, it's possible this is part of a larger commit
                if (transactionManager != null && transactionManager.IsOpen)
                {
                    transactionManager.Rollback();
                }

                //Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
                {
                    throw;
                }
            }

            return(list);
        }