Esempio n. 1
0
        public void Update(Framework.DataServices.Model.EntityBaseData entry, string compareQuery, object objToCompare)
        {
            int    errorNumber      = 0;
            string errorDescription = null;

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

            if (result == false)
            {
                throw new AssertTestException("Couldn't update 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 (string.Compare(objToCompare.ToString(), objResult.ToString()) != 0)
            {
                throw new AssertTestException("Incompatible results between database and object.");
            }
        }
Esempio n. 2
0
        public bool Update()
        {
            int    errorNumber      = 0;
            string errorDescription = null;

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

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

            return(result);
        }