Example #1
0
        public ActionResult ShowAddFolderOrBookmarkView(long folderID)
        {
            long uid = UILoginHelper.GetUIDFromHttpContext(HttpContext);

            if (folderID == 0)
            {
                var lst = BizUserWebFolder.LoadAllByUID(uid);
                if (lst != null && lst.Count > 0)
                {
                    var firstFolder = lst.Where(folder => folder.ParentWebfolderID == 0);
                    if (firstFolder == null || firstFolder.Count() == 0)
                    {
                        return(View());
                    }
                    if (firstFolder.Count() == 1)
                    {
                        folderID = firstFolder.FirstOrDefault().UserWebFolderID;
                    }
                    else
                    {
                        BizUserWebFolder newFolderInfo = new BizUserWebFolder();
                        newFolderInfo.UserInfoID          = uid;
                        newFolderInfo.UserWebFolderID     = 0;
                        newFolderInfo.ParentWebfolderID   = 0;
                        newFolderInfo.ChildrenFolderList  = firstFolder.ToList();
                        newFolderInfo.BizBookmarkInfoList = new List <BizBookmarkInfo>();
                        return(View("ShowAddFolderOrBookmarkView", new UIWebFolderInfo(newFolderInfo)));
                    }
                }
            }
            var folderInfo = BizUserWebFolder.LoadContainsChirdrenAndBookmark(folderID);
            var model      = new UIWebFolderInfo(folderInfo);

            return(View("ShowAddFolderOrBookmarkView", model));
        }
Example #2
0
        public ActionResult ShowUserFolder(long showUserInfoID, long folderID = 0)
        {
            UIWebFolderInfo model = null;

            if (showUserInfoID != default(long))
            {
                if (folderID == 0)
                {
                    var lst = BizUserWebFolder.LoadAllByUID(showUserInfoID);
                    if (lst != null)
                    {
                        var firstFolder = lst.Where(folder => folder.ParentWebfolderID == 0);
                        if (firstFolder == null || firstFolder.Count() == 0)
                        {
                            return(View("ShowUserFolder", model));
                        }

                        folderID = firstFolder.FirstOrDefault().UserWebFolderID;
                    }
                }
                var folderInfo = BizUserWebFolder.LoadContainsChirdrenAndBookmark(folderID);
                model = new UIWebFolderInfo(folderInfo);
            }
            return(View("ShowUserFolder", model));
        }
Example #3
0
        public ActionResult ShowUserAllFolder(long folderID)
        {
            long uid = UILoginHelper.GetUIDFromHttpContext(HttpContext);

            if (folderID == 0)
            {
                var lst = BizUserWebFolder.LoadAllByUID(uid);
                if (lst != null && lst.Count > 0)
                {
                    var firstFolder = lst.Where(folder => folder.ParentWebfolderID == 0);
                    if (firstFolder == null || firstFolder.Count() == 0)
                    {
                        return(View());
                    }
                    folderID = firstFolder.FirstOrDefault().UserWebFolderID;
                }
            }
            var folderInfo = BizUserWebFolder.LoadContainsChirdrenAndBookmark(folderID);
            var model      = new UIWebFolderInfo(folderInfo);

            return(View("ShowUserAllFolder", model));
        }