Esempio n. 1
0
        /// <summary>
        /// 获取一份文档
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>


        ///// <summary>
        ///// 移除一份文档
        ///// </summary>
        ///// <param name="query"></param>
        ///// <returns></returns>
        //public object RemoveDoc(string query)
        //{
        //    var res = DocManager.GetInstance().Remove(query);
        //    return res;
        //}

        public object MoveToRecycleBin(string dbName, string collectionName, string id)
        {
            var res = new object();

            RecycleBinManager.GetInstance().MoveToRecycleBin(dbName, collectionName, id);
            return(res);
        }
Esempio n. 2
0
        public List <DocItem> LoadAllDocInSubFolder(string categoryId, string protection = "{}", string sort = "{}", int pageIndex = 0, int pageSize = 50)
        {
            var           list          = RecycleBinManager.GetInstance().FindTarget(CONST.DB.DBName_DocService, CONST.DB.CollectionName_CategoryItem, categoryId);
            var           source        = list.Where((p) => { return(p.TableName == CONST.DB.CollectionName_DocItem); });
            var           query         = "{'_id':{$in:[idArray]}}";
            StringBuilder stringBuilder = new StringBuilder();

            foreach (var item in source)
            {
                stringBuilder.AppendFormat("ObjectId('{0}'),", item.ID);
            }
            query = query.Replace("idArray", stringBuilder.ToString());
            var res = this.Find(query, protection, sort, pageIndex, pageSize);

            return(res);
        }
Esempio n. 3
0
        /// <summary>
        /// 加载回收站
        /// </summary>
        /// <param name="query"></param>
        /// <param name="protection"></param>
        /// <param name="sort"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public List <RecycleBinItem> LoadRecycleBinItem(string query, string protection = "{}", string sort = "{}", int pageIndex = 0, int pageSize = 50)
        {
            var res = RecycleBinManager.GetInstance().Find(query, protection, sort, pageIndex, pageSize);

            return(res);
        }
Esempio n. 4
0
        public object RecycleBinCount(string query)
        {
            var res = RecycleBinManager.GetInstance().Count(query);

            return(res);
        }
Esempio n. 5
0
 public int Remove(string id)
 {
     RecycleBinManager.GetInstance().MoveToRecycleBin(CONST.DB.DBName_DocService, CONST.DB.CollectionName_CategoryItem, id);
     return(0);
 }