/// <summary> /// 返回特定咨询页面 /// </summary> /// <returns></returns> public ActionResult Consult() { if (Session["username"] == null) { return(View("loginremind")); } string userName = Session["username"].ToString(); LoginStatusConfig();//配置登录状态 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; List <ExpertUserConsult_model> expertUserConsult_modelList = user_bll.GetExpertConsult(); //获取专家的ExpertUserConsult_model数据,用户填写特定咨询时,需要选择专家 User_model user_model = new User_model(); try { user_model = user_bll.GetUserDataConsult(userName);//用户的个人数据 } catch (Exception e) { return(Content(e.ToString())); } ViewData["user_model"] = user_model; return(View(expertUserConsult_modelList)); }
/// <summary> /// 遍历我的特定咨询过的帖子 /// Creator:Simple /// </summary> /// <returns></returns> public ActionResult MySpecialConsult() { 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(); //去除空格 if (rankNameDB != "普通用户") { return(Content("错误提示:您不是普通用户")); } 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"] = "MySpecialConsult"; //当前action名 SpecialConsult_bll specialConsult_bll = new SpecialConsult_bll(); List <SpecialConsult_model> specialConsult_modelList = specialConsult_bll.GetMyConsultData(userId); //通过userId获取该用户的特定咨询数据 return(View(specialConsult_modelList)); }
/// <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)); }
public ActionResult Change_Data() { LoginStatusConfig();//配置登录状态 if (Session["userName"] == null) { return(RedirectToAction("LoginRemind", "Topic")); } 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; return(View()); }
/// <summary> ///遍历我的提问过的帖子 /// </summary> /// <returns></returns> public ActionResult myAsks() { 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; Post_bll post_bll = new Post_bll(); List <Post_model> post_modelList = post_bll.GetShortPostData(userId);//获取用户的提问过的贴子 return(View(post_modelList)); }
/// <summary> /// 遍历我的特定咨询过的帖子 /// </summary> /// <returns></returns> public ActionResult MySpecialConsult() { 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; SpecialConsult_bll specialConsult_bll = new SpecialConsult_bll(); List <SpecialConsult_model> specialConsult_modelList = specialConsult_bll.GetMyConsultData(userId); //通过userId获取该用户的特定咨询数据 return(View(specialConsult_modelList)); }
/// <summary> /// 模板页,查看我的 “回答 提问 收藏 ” 帖子, /// </summary> /// <returns></returns> public ActionResult MyPostTemplate() { LoginStatusConfig();//配置登录状态 if (Session["userName"] == null) { return(RedirectToAction("LoginRemind", "Topic")); } string userName = Session["userName"].ToString(); User_bll user_bll = new User_bll(); int userId = Convert.ToInt32(user_bll.GetUserId(userName));//通过用户名获取userId ////获取用户等级名 Rank_bll rank_bll = new Rank_bll(); string rankNameDB = rank_bll.GetRankName(userName); //该用户数据库里的等级名 rankNameDB = rankNameDB.Trim(); //去除空格 CountUser_model countUser_model = user_bll.GetCountUser(userId, rankNameDB); //获取用户的CountUser_model 数据:点赞数 关注数 粉丝数 收藏数 提问数 回帖数 特定咨询数 等 ViewData["countUser_model"] = countUser_model; return(View()); }
public ActionResult Index() { if (Session["userName"] == null) { return(RedirectToAction("LoginRemind", "Topic")); } LoginStatusConfig();//配置登录状态 People_bll user = new People_bll(); string userName = Session["userName"].ToString(); //检测姓名是否为空 if (user.CheckRealName(userName) == null) { ViewData["realName"] = "请输入您的真实姓名"; } else { ViewData["realName"] = user.CheckRealName(userName); } // 检测出生年月是否为空 if (user.CheckBirthDate(userName) == null) { ViewData["BirthDate"] = "请输入您的出生年月"; } else { ViewData["BirthDate"] = user.CheckBirthDate(userName); } //检测职业是否为空 if (user.CheckProfession(userName) == null) { ViewData["Profession"] = "请输入您的职业"; } else { ViewData["Profession"] = user.CheckProfession(userName); } // 检测手机号是否为空 if (user.CheckPhoneNumber(userName) == null) { ViewData["PhoneNumber"] = "请输入您的手机号"; } else { ViewData["PhoneNumber"] = user.CheckPhoneNumber(userName); } //检测学历是否为空 if (user.CheckEducationalBackground(userName) == null) { ViewData["CheckEducationalBackground"] = "请输入您的手机号"; } else { ViewData["CheckEducationalBackground"] = user.CheckEducationalBackground(userName); } //检测爱好是否为空 if (user.CheckInterest(userName) == null) { ViewData["Interest"] = "请输入您的兴趣"; } else { ViewData["Interest"] = user.CheckInterest(userName); } //检测肤色是否为空 if (user.GetSkinColor(userName) == null) { ViewData["SkinColor"] = "请输入您的肤色"; } else { ViewData["SkinColor"] = user.GetSkinColor(userName); } //检测体重是否为空 if (user.GetWeight(userName) == -1) { ViewData["Weight"] = "请输入您的体重"; } else { ViewData["Weight"] = user.GetWeight(userName); } //检测臀围是否为空 if (user.GetTunWei(userName) == -1) { ViewData["TunWei"] = "请输入您的臀围"; } else { ViewData["TunWei"] = user.GetTunWei(userName); } //检测胸围是否为空 if (user.GetXiongWei(userName) == -1) { ViewData["XiongWei"] = "请输入您的胸围"; } else { ViewData["XiongWei"] = user.GetXiongWei(userName); } //检测腰围是否为空 if (user.GetYaoWei(userName) == -1) { ViewData["YaoWei"] = "请输入您的腰围"; } else { ViewData["YaoWei"] = user.GetYaoWei(userName); } //检测身高是否为空 if (user.GetHeight(userName) == -1) { ViewData["Height"] = "请输入您的身高"; } else { ViewData["Height"] = user.GetHeight(userName); } //检测腿长是否为空 if (user.GetThighGirth(userName) == -1) { ViewData["LegLength"] = "请输入您的腿长"; } else { ViewData["LegLength"] = user.GetLegLength(userName); } //检测大腿围是否为空 if (user.GetThighGirth(userName) == -1) { ViewData["ThighGirth"] = "请输入您的大腿围"; } else { ViewData["ThighGirth"] = user.GetThighGirth(userName); } //检测小腿围是否为空 if (user.GetCalfGirth(userName) == -1) { ViewData["CalfGirth"] = "请输入您的小腿围"; } else { ViewData["CalfGirth"] = user.GetCalfGirth(userName); } //检测手臂围是否为空 if (user.GetArmGirth(userName) == -1) { ViewData["ArmGirth"] = "请输入您的手臂围"; } else { ViewData["ArmGirth"] = user.GetArmGirth(userName); } //检测手臂围是否为空 if (user.GetQuanShenZhao(userName) == "1") { ViewData["QuanShenZhao"] = "请输入您的手臂围"; } else { ViewData["QuanShenZhao"] = user.GetQuanShenZhao(userName); } //获取用户的CountUser_model 数据:点赞数 关注数 粉丝数 收藏数 提问数 回帖数 特定咨询数 等 User_bll user_bll = new User_bll(); int userId = user_bll.GetUserId(userName); CountUser_model countUser_model = user_bll.GetCountUser(userId); ViewData["countUser_model"] = countUser_model; return(View()); }