示例#1
0
        public object SaveBookmarkAjax(string BookmarkUrl, string BookmarkName, string BookmarkDescription, string BookmarkTags, string uniqueID)
        {
            var url = UpdateURL(BookmarkUrl);

            var b = _serviceHelper.AddBookmark(url, BookmarkName, BookmarkDescription, BookmarkTags);

            b = _serviceHelper.GetBookmarkWithUserBookmarks(url);

            var displayMode = BookmarkingBusinessFactory.GetDisplayMode();

            var bookmarkString = GetBookmarkAsString(b, new Guid(uniqueID));

            if (BookmarkDisplayMode.SelectedBookmark == displayMode)
            {
                var userImage    = BookmarkingServiceHelper.GetHTMLUserAvatar();
                var userPageLink = BookmarkingServiceHelper.GetUserPageLink();
                var ub           = _serviceHelper.GetCurrentUserBookmark(b);

                var userBookmarkDescription = BookmarkingServiceHelper.GetUserBookmarkDescriptionIfChanged(ub);
                var dateAdded     = BookmarkingConverter.GetDateAsString(ub.DateAdded);
                var divID         = ub.UserID.ToString();
                var userBookmarks = _serviceHelper.GetUserBookmarks(b);
                var addedBy       = new BookmarkAddedByUserContorl().GetAddedByTableItem(userBookmarks.Count % 2 != 0, userImage, userPageLink, userBookmarkDescription, dateAdded, divID);
                return(new { BookmarkString = bookmarkString, AddedBy = addedBy, DivID = divID });
            }
            return(new { BookmarkString = bookmarkString, AddedBy = string.Empty });
        }
        public object SaveBookmarkAjax(string BookmarkUrl, string BookmarkName, string BookmarkDescription, string BookmarkTags, string uniqueID)
        {
            var url = UpdateURL(BookmarkUrl);
            var b = _serviceHelper.AddBookmark(url, BookmarkName, BookmarkDescription, BookmarkTags);

            b = _serviceHelper.GetBookmarkWithUserBookmarks(url);

            var bookmarkString = GetBookmarkAsString(b, new Guid(uniqueID));
            if (BookmarkingServiceHelper.BookmarkDisplayMode.SelectedBookmark == _serviceHelper.DisplayMode)
            {
                var userImage = BookmarkingServiceHelper.GetHTMLUserAvatar();
                var userPageLink = BookmarkingServiceHelper.GetUserPageLink();
                var ub = _serviceHelper.GetCurrentUserBookmark(b);

                var userBookmarkDescription = BookmarkingServiceHelper.GetUserBookmarkDescriptionIfChanged(ub);
                var dateAdded = BookmarkingConverter.GetDateAsString(ub.DateAdded);
                var divID = ub.UserID.ToString();
                var userBookmarks = _serviceHelper.GetUserBookmarks(b);
                var addedBy = new BookmarkAddedByUserContorl().GetAddedByTableItem(userBookmarks.Count % 2 != 0, userImage, userPageLink, userBookmarkDescription, dateAdded, divID);
                return new { BookmarkString = bookmarkString, AddedBy = addedBy, DivID = divID };
            }
            return new { BookmarkString = bookmarkString, AddedBy = string.Empty };
        }