public JsonResult GetById(int folderId)
 {
     return(Json(new AjaxResult()
     {
         Success = true, Data = FolderBasisService.GetById(folderId)
     }, JsonRequestBehavior.AllowGet));
 }
        public JsonResult SearchDoucmentList(int folderId, int?usertag)
        {
            var folderList   = FolderBasisService.ListByParentId(folderId);
            var documentList = DocumentBasisService.ListByFolderId(folderId, usertag);
            List <DocumentComboVO> resultList = new List <DocumentComboVO>();

            if (folderList != null && folderList.Count > 0)
            {
                resultList.AddRange(folderList.Select(p => p.ToDocumentComboVO()));
            }
            if (documentList != null && documentList.Count > 0)
            {
                resultList.AddRange(documentList.Select(p => p.ToDocumentComboVO()));
            }
            //resultList.ForEach(item =>
            //{
            //    if (item.Type == DocumentEnums.File)
            //    {
            //        var temp = item.Name.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
            //        if (temp.Length > 0)
            //        {
            //            item.Name = item.Name.Replace("."+temp[temp.Length - 1], "");
            //        }
            //    }
            //});
            return(Json(new AjaxResult()
            {
                Success = true, Data = resultList
            }, JsonRequestBehavior.AllowGet));
        }
 public JsonResult FolderInsert(FolderVO folderVO)
 {
     FolderBasisService.Insert(folderVO);
     return(Json(new AjaxResult()
     {
         Success = true, Data = true
     }));
 }
 public JsonResult FolderDelete(int folderId)
 {
     FolderBasisService.Delete(folderId);
     return(Json(new AjaxResult()
     {
         Success = true, Data = true
     }, JsonRequestBehavior.AllowGet));
 }
        public JsonResult SearchTreeList()
        {
            List <FolderVO> list = FolderBasisService.List();

            if (list == null || list.Count == 0)
            {
                return(Json(new AjaxResult()
                {
                    Success = true, Data = new List <FolderVO>()
                }, JsonRequestBehavior.AllowGet));
            }
            return(Json(this.RecursiveQueryList(list), JsonRequestBehavior.AllowGet));
        }