コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Articles_Comment articlescomment = db.Articles_Comment.Find(id);

            db.Articles_Comment.Remove(articlescomment);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Articles_Comment articlescomment = db.Articles_Comment.Find(id);

            if (articlescomment == null)
            {
                return(HttpNotFound());
            }
            return(View(articlescomment));
        }
コード例 #3
0
        public ActionResult NC_Add(Articles_Comment articles_comment)
        {
            if (Session["user_id"] != null)
            {
                string mcmes = Request["mcmes"];
                int    mu_id = Convert.ToInt32(Request["mcid"]);

                if (ModelState.IsValid)
                {
                    articles_comment.art_id  = mu_id;
                    articles_comment.user_id = Convert.ToInt32(Session["user_id"].ToString());
                    articles_comment.ac_mess = mcmes;
                    articles_comment.ac_time = System.DateTime.Now;
                    db.Articles_Comment.Add(articles_comment);
                    db.SaveChanges();
                    return(Content("<script>;alert('评论成功');history.go(-1)</script>"));
                }
                return(RedirectToAction("Details", "Articles"));
            }
            else
            {
                return(Content("<script>;alert('你还没有登录哦');history.go(-1)</script>"));
            }
        }
コード例 #4
0
 public void InsertAC(Articles_Comment AC)
 {
     iarticles_comment.InsertAC(AC);
 }
コード例 #5
0
 public void InsertAC(Articles_Comment AC)
 {
     db.Articles_Comment.Add(AC);
 }