public ActionResult DeleteConfirmed(int id) { ReplyGoods replyGoods = db.ReplyGoods.Find(id); db.ReplyGoods.Remove(replyGoods); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ReplyGoodsID,UserID,GoodsCommentID,ReplyContent,ReplyTime")] ReplyGoods replyGoods) { if (ModelState.IsValid) { db.Entry(replyGoods).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GoodsCommentID = new SelectList(db.GoodsComments, "GoodsCommentID", "GoodsCommentContent", replyGoods.GoodsCommentID); ViewBag.UserID = new SelectList(db.Users, "UserID", "UserName", replyGoods.UserID); return(View(replyGoods)); }
// GET: ReplyGoodsManagement/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ReplyGoods replyGoods = db.ReplyGoods.Find(id); if (replyGoods == null) { return(HttpNotFound()); } return(View(replyGoods)); }
// GET: ReplyGoodsManagement/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ReplyGoods replyGoods = db.ReplyGoods.Find(id); if (replyGoods == null) { return(HttpNotFound()); } ViewBag.GoodsCommentID = new SelectList(db.GoodsComments, "GoodsCommentID", "GoodsCommentContent", replyGoods.GoodsCommentID); ViewBag.UserID = new SelectList(db.Users, "UserID", "UserName", replyGoods.UserID); return(View(replyGoods)); }
public ActionResult ReplyGoodComments(int GoodsCommentid, ReplyGoods replyGoods) { string replytext = Request.Form["textarea1"]; if (replytext == "") { return(Content("<script>;alert('回复不能为空');history.go(-1)</script>")); } else { int goodid = Convert.ToInt32(Session["goodid"]); int userid = Convert.ToInt32(Session["UserID"]); replyGoods.GoodsCommentID = GoodsCommentid; replyGoods.UserID = userid; replyGoods.ReplyContent = replytext; replyGoods.ReplyTime = DateTime.Now; replygoodmanager.InsertReplyGoods(replyGoods); //return Content("<script>alert('回复成功!');history.go(-1)</script>"); return(Content("<script>alert('回复成功');window.open('" + Url.Action("GoodsDetail", "Goods", new { goodid = goodid }) + "', '_self')</script>")); } }
public ActionResult Reply(ReplyGoods repgoods) { string reply = Request["replaygoods"]; int commid = Convert.ToInt32(Request["commendid"]); int userid = Convert.ToInt32(Session["User_id"]); var replylist = CommentGoodsManage.findallreply(commid); if (reply == null) { return(Content("<script>;alert('回复内容不能为空!');history.go(-1)</script>")); } else if (ModelState.IsValid) { repgoods.CommentGoods_id = commid; repgoods.User_id = userid; repgoods.Content = reply; repgoods.ReplyTime = DateTime.Now; CommentGoodsManage.addReplyGoods(repgoods); return(Content("<script>;alert('回复成功!');history.go(-1)</script>")); } return(RedirectToAction("Detail", "Malls")); }
public void addReplyGoods(ReplyGoods repgood) { db.ReplyGoods.Add(repgood); db.SaveChanges(); }
public void InsertReplyGoods(ReplyGoods replygoods) { ireplygoods.InsertReplyGoods(replygoods); }
public static void addReplyGoods(ReplyGoods repgood) { commgood.addReplyGoods(repgood); }
public void InsertReplyGoods(ReplyGoods replygoods) { db.ReplyGoods.Add(replygoods); db.SaveChanges(); }