Exemplo n.º 1
0
 public ActionResult ReplyComments(int icid)
 {
     if (ModelState.IsValid)
     {
         string          replytext = Request.Form["textarea1"];
         InfoCommentBack icbmodel  = new InfoCommentBack();
         if (replytext == null)
         {
             return(Content("<script>;alert('回复内容不为空');</script>"));
         }
         else
         {
             icbmodel.ICB_Content = replytext;
             icbmodel.ICB_Time    = System.DateTime.Now;
             icbmodel.IC_ID       = icid;
             icbmodel.UserInfo_ID = Convert.ToInt32(Session["user_ID"]);
             var success = InfoCommentBackBll.Add(icbmodel);
             if (success == true)
             {
                 return(Content("<script>;alert('回复成功!');</script>"));
             }
         }
     }
     return(View());
 }
Exemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            InfoCommentBack infoCommentBack = db.InfoCommentBack.Find(id);

            db.InfoCommentBack.Remove(infoCommentBack);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
        // GET: InfoCommentBacks/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InfoCommentBack infoCommentBack = db.InfoCommentBack.Find(id);

            if (infoCommentBack == null)
            {
                return(HttpNotFound());
            }
            return(View(infoCommentBack));
        }