Exemplo n.º 1
0
        internal BusinessObjectActionReport <DataRepositoryActionStatus> DeleteTemporaryFile(int fileId, int userId)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);
            int num = 0;

            try
            {
                using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                {
                    num = dataStoreContext.cms_FilesTemp_Delete(fileId, userId);
                }
            }
            catch (Exception ex)
            {
                _Log.Error("Error at cms_FilesTemp_Delete", ex);
                throw new DataStoreException(ex, true);
            }
            if (num != -1002)
            {
                if (num != 0)
                {
                    businessObjectActionReport.Status = DataRepositoryActionStatus.SqlError;
                    _Log.ErrorFormat("Temporary CMSFile with id {0} was not deleted from the database (ErrorCode: {1}).", fileId, num);
                }
            }
            else
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.NoRecordRowAffected;
                _Log.InfoFormat("Temporary CMSFile with id {0} was not deleted from the database (ErrorCode: {1}).", fileId, num);
            }
            return(businessObjectActionReport);
        }