public ActionResult DeleteConfirmed(int id) { ComReply comReply = db.ComReply.Find(id); db.ComReply.Remove(comReply); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ComReplyID,UserID,GoodsCommentID,RepContent,RepTime")] ComReply comReply) { if (ModelState.IsValid) { db.Entry(comReply).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GoodsCommentID = new SelectList(db.GoodsComment, "GoodsCommentID", "ComContent", comReply.GoodsCommentID); ViewBag.UserID = new SelectList(db.Users, "UserID", "Password", comReply.UserID); return(View(comReply)); }
public void AddComReply(int userid, int goodscommentid, string replycontent, DateTime replytime) { var comreply = new ComReply() { UserID = userid, GoodsCommentID = goodscommentid, RepContent = replycontent, RepTime = replytime }; db.ComReply.Add(comreply); db.SaveChanges(); }
// GET: ComReplies/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ComReply comReply = db.ComReply.Find(id); if (comReply == null) { return(HttpNotFound()); } return(View(comReply)); }
// GET: ComReplies/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ComReply comReply = db.ComReply.Find(id); if (comReply == null) { return(HttpNotFound()); } ViewBag.GoodsCommentID = new SelectList(db.GoodsComment, "GoodsCommentID", "ComContent", comReply.GoodsCommentID); ViewBag.UserID = new SelectList(db.Users, "UserID", "Password", comReply.UserID); return(View(comReply)); }