Exemple #1
0
        public IList <Framework.DataServices.Model.EntityBaseData> SelectPage(string condition, string order, int pageNumber, int pageSize)
        {
            int    errorNumber      = 0;
            string errorDescription = null;

            IList <Framework.DataServices.Model.EntityBaseData> list = _daoBase.SelectPage(
                _currentLogin, condition, order, pageNumber, pageSize, out errorNumber, out errorDescription);

            if (errorNumber != 0 || !string.IsNullOrEmpty(errorDescription))
            {
                return(null);
            }

            return(list);
        }
Exemple #2
0
        public void SelectPage(string condition, string order, string compareQuery)
        {
            int    errorNumber      = 0;
            string errorDescription = null;


            IList <Framework.DataServices.Model.EntityBaseData> result = _daoBase.SelectPage(
                _currentUser, condition, order, PagingPage, PagingTotalRows,
                out errorNumber, out errorDescription);

            if (result == null)
            {
                throw new AssertTestException("Couldn't load the page");
            }

            if (errorNumber != 0)
            {
                throw new AssertTestException("There is an error number = " + errorNumber);
            }

            if (!string.IsNullOrEmpty(errorDescription))
            {
                throw new AssertTestException("There is an error description = " + errorDescription);
            }

            if (result.Count > PagingTotalRows + 1)
            {
                throw new AssertTestException("There are more rows returned than allowed");
            }


            object objResult = _commonDatabase.ExecuteScalar(
                System.Data.CommandType.Text, compareQuery, false, _currentUser);

            if (result.Count > (int)objResult)
            {
                throw new AssertTestException("There are more rows returned than the specific query.");
            }
        }