Exemplo n.º 1
0
        public String Reply(ReplyRedSpots repredspots, string essaycontent, int forumid)
        {
            int userid = Convert.ToInt32(Session["User_id"]);

            //var replylist = CommentRedSpotsManage.FindRedRep(commid);
            if (essaycontent != null)
            //{
            //    return Content("<script>;alert('回复内容不能为空!');history.go(-1)</script>");
            //}
            //else

            {
                repredspots.CommentRedSpots_id = forumid;
                repredspots.User_id            = userid;
                repredspots.Content            = essaycontent;
                repredspots.ReplyTime          = DateTime.Now;
                CommentRedSpotsManage.addReplyRedSpots(repredspots);
                return("cg");
            }

            else
            {
                return("cc");
            }
        }
Exemplo n.º 2
0
        public ActionResult SelectReply(int id)
        {
            var repred = CommentRedSpotsManage.FindRedRep(id);

            ViewModels.Brave der = new Brave();
            der.Repred1 = repred;
            return(View(der));
        }
Exemplo n.º 3
0
        public ActionResult Details(int id)
        {
            var redde      = BraveManage.FindRedId(id);
            var redshare   = BraveManage.FindShareid(id);
            var gengduored = BraveManage.FindAllSpots().OrderByDescending(p => p.RedSpots_id).Take(10);
            var comred     = CommentRedSpotsManage.FindRedCom(id);

            if (redde == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            ViewModels.Brave index = new ViewModels.Brave()
            {
                spots1    = gengduored,
                redshare1 = redshare,
                redde1    = redde,
                Commred1  = comred,
            };
            ViewBag.count1 = BraveManage.findcoment(id);
            return(View(index));
        }
Exemplo n.º 4
0
        public String addComment(CommentRedSpots comredspots, string essaycontent, int forumid)
        {
            int userid = int.Parse(Session["User_id"].ToString());

            if (essaycontent != null || essaycontent.Length != 0)
            {
                comredspots.User_id     = userid;
                comredspots.RedSpots_id = forumid;
                comredspots.Content     = essaycontent;
                comredspots.CommentTime = DateTime.Now;
                CommentRedSpotsManage.AddCommentRedSpots(comredspots);
                return("cg");
            }

            else
            {
                return("cc");
            }
            //if (content == null || content.Length == 0)
            //{
            //    return Content("<script>;alert('评论内容不能为空!');history.go(-1)</script>");
            //}
            //else if (ModelState.IsValid)
            //{
            //    comredspots.User_id = userid;
            //    comredspots.RedSpots_id = redspotsid;
            //    comredspots.Content = content;
            //    comredspots.CommentTime = DateTime.Now;
            //    CommentRedSpotsManage.AddCommentRedSpots(comredspots);
            //    return Content("<script>;alert('评论成功!');history.go(-1)</script>");

            //}



            //return RedirectToAction("Details", "RedSpots");
        }