コード例 #1
0
ファイル: DaoBase.cs プロジェクト: Thoris/bolaonet2014
        public void SelectCount(string condition, string compareQuery)
        {
            int    errorNumber      = 0;
            string errorDescription = null;

            int result = _daoBase.SelectCount(
                _currentUser, condition, out errorNumber, out errorDescription);

            if (result < 0)
            {
                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);
            }

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

            if (result != (int)objResult)
            {
                throw new AssertTestException("There are more rows returned than the specific query.");
            }
        }
コード例 #2
0
ファイル: Time.cs プロジェクト: Thoris/bolaonet2014
        public int SelectCount(string condition)
        {
            int    errorNumber      = 0;
            string errorDescription = null;

            int result = _daoBase.SelectCount(
                _currentLogin, condition, out errorNumber, out errorDescription);

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

            return(result);
        }