コード例 #1
0
        public ActionResult AddComment(int id, FormCollection f)
        {
            Controllers.VerifyCodeController v = new VerifyCodeController();
            if (v.CheckCode(f["code"].Trim()) == "0")
            {
                TempData["UserName"] = f["txtUserName"];
                TempData["Content"] = f["txtContent"];
                TempData["Err"] = "��֤�벻��ȷ";
                return RedirectToAction("UserComment", new { userid = id, pageNo = 1 });
            }

            bizUserComment b = new bizUserComment();
            UserComment model = new UserComment();
            model.UserID = id;
            model.Content = f["txtContent"];
            string face=f["face1"];
            face = face == "0" ? "" : face + ".gif";
            model.Face = face;
            model.AddUserName = f["txtUserName"].Trim();
            model.AddUserID = UserID;
            b.Add(model);
            return RedirectToAction("UserComment", new { userid = id, pageNo = 1 });
        }
コード例 #2
0
 public ActionResult delComment(int id)
 {
     bizUserComment b = new bizUserComment();
     UserComment model = b.Get(id);
     if (model.UserID == UserID||UserCommon.CheckBBSAdminRight(AdminType))
     {
         b.Delete(id);
     }
     int userID = model.UserID;
     return RedirectToAction("UserComment", new { userid = userID, pageNo = 1 });
 }
コード例 #3
0
        public ActionResult UserComment(int userID, int pageNo)
        {
            bizUsers b = new bizUsers();
            Users model = b.Get(userID);
            int pageSize = 10;
            int count;

            bizUserComment buc = new bizUserComment();
            List<UserComment> list = buc.List(userID, pageSize, pageNo - 1, out count);
            ViewData["PageList"] = Page.GetPageList("/user/comment/" + userID + "_$page$.html", count, pageSize, pageNo);
            ViewData["UserComment"] = list;

            TempData["UserName"] = UserID == 0 ? "�ο�" : UserName;
            TempData["Content"] = TempData["Content"] == null ? "" : TempData["Content"].ToString();
            ViewData["AdminType"] = AdminType;
            return View(model);
        }