示例#1
0
        public bool Delete(String sourcePath)
        {
            bool result = false;

            if (itemID == -1)
            {
                return(result);
            }

            if (sourcePath != null)
            {
                SharedFile sharedFile = new SharedFile(moduleID, itemID);
                String     filePath   = Path.Combine(sourcePath, Path.GetFileName(sharedFile.ServerFileName));
                if (File.Exists(filePath))
                {
                    File.Delete(filePath);
                }
            }

            //IndexHelper.RemoveIndexItem(moduleID, itemID);

            DBSharedFiles.DeleteHistoryByItemID(itemID);
            // this just deletes the entry from the db
            result = DBSharedFiles.DeleteSharedFile(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }


            return(result);
        }
示例#2
0
        public bool Delete()
        {
            bool result = false;

            if (itemID == -1)
            {
                return(result);
            }

            SharedFile sharedFile = new SharedFile(moduleID, itemID);

            DBSharedFiles.DeleteHistoryByItemID(itemID);

            // this just deletes the entry from the db
            result = DBSharedFiles.DeleteSharedFile(itemID);

            if (result)
            {
                ContentChangedEventArgs e = new ContentChangedEventArgs();
                e.IsDeleted = true;
                OnContentChanged(e);
            }

            return(result);
        }