Ejemplo n.º 1
0
        public void Insert(Framework.DataServices.Model.EntityBaseData entry, string compareQuery)
        {
            int    errorNumber      = 0;
            string errorDescription = null;

            bool result = _daoBase.Insert(
                _currentUser, entry, out errorNumber, out errorDescription);

            if (result == false)
            {
                throw new AssertTestException("Couldn't insert the item");
            }

            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 ((int)objResult != 1)
            {
                throw new AssertTestException("The row was not inserted in database.");
            }
        }
Ejemplo n.º 2
0
        public bool Insert()
        {
            int    errorNumber      = 0;
            string errorDescription = null;

            bool result = _daoBase.Insert(_currentLogin, this, out errorNumber, out errorDescription);

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


            return(result);
        }