Пример #1
0
        internal BusinessObjectActionReport <DataRepositoryActionStatus> Delete(int fileId)
        {
            BusinessObjectActionReport <DataRepositoryActionStatus> businessObjectActionReport = new BusinessObjectActionReport <DataRepositoryActionStatus>(DataRepositoryActionStatus.Success);

            int num = 0;

            try
            {
                using (IDataStoreContext dataStoreContext = this._DataStore.CreateContext())
                {
                    num = dataStoreContext.cms_Files_Delete(fileId);
                }
            }
            catch (Exception ex)
            {
                _Log.Error("Error at cms_Files_Delete", ex);
                throw new DataStoreException(ex, true);
            }

            if (num == 0)
            {
                businessObjectActionReport.Status = DataRepositoryActionStatus.SqlError;
                _Log.ErrorFormat("CMSFile {0} was not deleted from the database (ErrorCode: {1}).", fileId, num);
            }

            return(businessObjectActionReport);
        }