/// <summary>
        /// 获取haojima用户id   如果没有则创建用户
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        private int GetUserId(string userName)
        {
            BlogUsersSetBLL user        = new BlogUsersSetBLL();
            var             blogtagmode = user.GetList(t => t.UserName == userName);

            if (blogtagmode.Count() >= 1)
            {
                return(blogtagmode.FirstOrDefault().Id);
            }
            else
            {
                user.Add(new ModelDB.BlogUsersSet()
                {
                    UserName     = userName,
                    IsDel        = false,
                    UserPass     = "******".MD5().MD5(),
                    UserNickname = string.IsNullOrEmpty(blogName.Trim()) ? userName : blogName,
                    IsLock       = false,
                    UserMail     = "无效",
                    UserInfo     = new UserInfo()
                });
                try
                {
                    user.save(false);
                }
                catch (Exception ex)
                {
                    throw;
                }

                return(GetUserId(userName));
            }
        }
        /// <summary>
        /// 迁移cnblog评论
        /// </summary>
        /// <param name="BlogsId">嗨博客 博客id</param>
        /// <param name="BlogUsersId">嗨博客  评论博客用户id(因为迁移评论者 没有id 所以都默认为1)</param>
        /// <param name="postId">cnblog 博客id</param>int BlogUsersId = 1,
        /// <param name="blogApp">cnblog 博客用户名</param>
        public string testJumonyParser(int BlogsId = 1, string postId = "4368417", string blogApp = "zhaopei")
        {
            bool isNext = true;
            int  i      = 0;

            var BlogUsersId = 1;

            BLL.BlogUsersSetBLL userbll = new BlogUsersSetBLL();
            var usertemp = GetDataHelper.GetAllUser().Where(t => t.UserName == " ").FirstOrDefault();

            if (null == usertemp)
            {
                var user = new Blogs.ModelDB.BlogUsersSet()
                {
                    UserName   = "******",
                    UserPass   = "******",
                    IsDel      = false,
                    IsLock     = false,
                    UserMail   = "无效",
                    CreateTime = DateTime.Now,
                    UserInfo   = new ModelDB.UserInfo()
                };
                userbll.Add(user);
                userbll.save(false);
                BlogUsersId = user.Id;
            }
            else
            {
                BlogUsersId = usertemp.Id;
            }

            //List<BlogCommentSet> blogcommen = new List<BlogCommentSet>();
            BlogCommentSetBLL blogcommenbll = new BlogCommentSetBLL();

            while (isNext)
            {
                i++;
                var url        = "http://www.cnblogs.com/mvc/blog/GetComments.aspx?postId=" + postId + "&blogApp=" + blogApp + "&pageIndex=" + i;
                var jumony     = new JumonyParser();
                var htmlSource = jumony.LoadDocument(url).InnerHtml();

                JavaScriptSerializer _jsSerializer = new JavaScriptSerializer();
                CnBlogComments       comm          = _jsSerializer.Deserialize <CnBlogComments>(htmlSource);
                var commentsHtml = jumony.Parse(comm.commentsHtml);
                var pager        = commentsHtml.Find("div.pager").FirstOrDefault();
                if (null != pager)
                {
                    var Next = pager.Find("*").LastOrDefault().InnerText();
                    if (Next != "Next >")
                    {
                        isNext = false;
                    }
                }
                else
                {
                    isNext = false;
                }

                var listComment = commentsHtml.Find("div.feedbackItem").ToList();
                foreach (var item in listComment)
                {
                    var commentDataNode = item.Find("div.feedbackListSubtitle span.comment_date").FirstOrDefault();  //
                    var commentData     = DateTime.Parse(commentDataNode.InnerText());
                    var commentUserNode = item.Find("div.feedbackListSubtitle a[target='_blank']").FirstOrDefault();
                    var commentUser     = commentUserNode.InnerText();
                    var Content         = item.Find("div.blog_comment_body").FirstOrDefault().InnerText();

                    blogcommenbll.Add(
                        new BlogCommentSet()
                    {
                        BlogsId       = BlogsId,
                        CommentID     = -1,
                        IsDel         = false,
                        Content       = Content,
                        CreateTime    = commentData,
                        ReplyUserName = commentUser,
                        BlogUsersId   = BlogUsersId,
                        IsInitial     = true
                    }
                        );
                }
            }

            try
            {
                blogcommenbll.save(false);
            }
            catch (Exception)
            { }
            return("ok");
        }
        /// <summary>
        /// 获取haojima用户id   如果没有则创建用户
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        private int GetUserId(string userName)
        {
            BlogUsersSetBLL user = new BlogUsersSetBLL();
            var blogtagmode = user.GetList(t => t.UserName == userName);
            if (blogtagmode.Count() >= 1)
                return blogtagmode.FirstOrDefault().Id;
            else
            {
                user.Add(new ModelDB.BlogUsersSet()
                {
                    UserName = userName,
                    IsDel = false,
                    UserPass = "******".MD5().MD5(),
                    UserNickname = string.IsNullOrEmpty(blogName.Trim()) ? userName : blogName,
                    IsLock = false,
                    UserMail = "无效",
                    UserInfo = new UserInfo()
                });
                try
                {
                    user.save(false);
                }
                catch (Exception ex)
                {

                    throw;
                }

                return GetUserId(userName);
            }
        }
        /// <summary>
        /// 迁移cnblog评论
        /// </summary>
        /// <param name="BlogsId">嗨博客 博客id</param>
        /// <param name="BlogUsersId">嗨博客  评论博客用户id(因为迁移评论者 没有id 所以都默认为1)</param>
        /// <param name="postId">cnblog 博客id</param>int BlogUsersId = 1,
        /// <param name="blogApp">cnblog 博客用户名</param>
        public string testJumonyParser(int BlogsId = 1, string postId = "4368417", string blogApp = "zhaopei")
        {
            bool isNext = true;
            int i = 0;

            var BlogUsersId = 1;
            BLL.BlogUsersSetBLL userbll = new BlogUsersSetBLL();
            var usertemp = GetDataHelper.GetAllUser().Where(t => t.UserName == " ").FirstOrDefault();
            if (null == usertemp)
            {
                var user = new Blogs.ModelDB.BlogUsersSet()
                {
                    UserName = "******",
                    UserPass = "******",
                    IsDel = false,
                    IsLock = false,
                    UserMail = "无效",
                    CreateTime = DateTime.Now,
                    UserInfo = new ModelDB.UserInfo()
                };
                userbll.Add(user);
                userbll.save(false);
                BlogUsersId = user.Id;
            }
            else
                BlogUsersId = usertemp.Id;

            //List<BlogCommentSet> blogcommen = new List<BlogCommentSet>();
            BlogCommentSetBLL blogcommenbll = new BlogCommentSetBLL();
            while (isNext)
            {
                i++;
                var url = "http://www.cnblogs.com/mvc/blog/GetComments.aspx?postId=" + postId + "&blogApp=" + blogApp + "&pageIndex=" + i;
                var jumony = new JumonyParser();
                var htmlSource = jumony.LoadDocument(url).InnerHtml();

                JavaScriptSerializer _jsSerializer = new JavaScriptSerializer();
                CnBlogComments comm = _jsSerializer.Deserialize<CnBlogComments>(htmlSource);
                var commentsHtml = jumony.Parse(comm.commentsHtml);
                var pager = commentsHtml.Find("div.pager").FirstOrDefault();
                if (null != pager)
                {
                    var Next = pager.Find("*").LastOrDefault().InnerText();
                    if (Next != "Next >")
                        isNext = false;
                }
                else
                    isNext = false;

                var listComment = commentsHtml.Find("div.feedbackItem").ToList();
                foreach (var item in listComment)
                {
                    var commentDataNode = item.Find("div.feedbackListSubtitle span.comment_date").FirstOrDefault();  //
                    var commentData = DateTime.Parse(commentDataNode.InnerText());
                    var commentUserNode = item.Find("div.feedbackListSubtitle a[target='_blank']").FirstOrDefault();
                    var commentUser = commentUserNode.InnerText();
                    var Content = item.Find("div.blog_comment_body").FirstOrDefault().InnerText();

                    blogcommenbll.Add(
                        new BlogCommentSet()
                        {
                            BlogsId = BlogsId,
                            CommentID = -1,
                            IsDel = false,
                            Content = Content,
                            CreateTime = commentData,
                            ReplyUserName = commentUser,
                            BlogUsersId = BlogUsersId,
                            IsInitial = true
                        }
                        );
                }
            }

            try
            {
                blogcommenbll.save(false);
            }
            catch (Exception)
            { }
            return "ok";
        }