Ejemplo n.º 1
0
        /// <summary>
        /// 遍历我的回答过的帖子,即回帖
        /// Creator:Simple
        /// </summary>
        /// <returns></returns>
        public ActionResult myAnsweres()
        {
            if (Session["userName"] == null)
            {
                return(RedirectToAction("LoginRemind", "Topic"));
            }
            LoginStatusConfig();//配置登录状态
            string userName = Session["userName"].ToString();
            ////获取用户等级名
            Rank_bll rank_bll   = new Rank_bll();
            string   rankNameDB = rank_bll.GetRankName(userName); //该用户数据库里的等级名

            rankNameDB = rankNameDB.Trim();                       //去除空格

            User_bll        user_bll        = new User_bll();
            int             userId          = Convert.ToInt32(user_bll.GetUserId(userName)); //通过用户名获取userId
            CountUser_model countUser_model = user_bll.GetCountUser(userId, rankNameDB);     //获取用户的CountUser_model 数据:点赞数 关注数 粉丝数 收藏数 提问数 回帖数 特定咨询数 等

            ViewData["countUser_model"] = countUser_model;
            ViewData["rankName"]        = rankNameDB;
            ViewData["actionName"]      = "myAnsweres";//当前action名
            ReplyPost_bll          replyPost_bll       = new ReplyPost_bll();
            List <ReplyPost_model> replyPost_modelList = new List <ReplyPost_model>();

            replyPost_modelList = replyPost_bll.GetShortReplyPostData(userId);//获取用户的回帖数据
            return(View(replyPost_modelList));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 遍历我的回答过的帖子,即回帖
        /// </summary>
        /// <returns></returns>
        public ActionResult myAnsweres()
        {
            if (Session["userName"] == null)
            {
                return(RedirectToAction("LoginRemind", "Topic"));
            }
            LoginStatusConfig();//配置登录状态
            string          userName        = Session["userName"].ToString();
            User_bll        user_bll        = new User_bll();
            int             userId          = Convert.ToInt32(user_bll.GetUserId(userName)); //通过用户名获取userId
            CountUser_model countUser_model = user_bll.GetCountUser(userId);                 //获取用户的CountUser_model 数据:点赞数 关注数 粉丝数 收藏数 提问数 回帖数 特定咨询数 等

            ViewData["countUser_model"] = countUser_model;
            ReplyPost_bll          replyPost_bll       = new ReplyPost_bll();
            List <ReplyPost_model> replyPost_modelList = new List <ReplyPost_model>();

            replyPost_modelList = replyPost_bll.GetShortReplyPostData(userId);//获取用户的回帖数据
            return(View(replyPost_modelList));
        }