public ActionResult DeleteReviewReply(int id) { AnReviewReply anReviewReply = db.AnReviewReplys.Find(id); db.AnReviewReplys.Remove(anReviewReply); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult PostReviewReply(ReviewReplyViewModel obj) { int userid = 1; AnReviewReply reply = new AnReviewReply(); reply.UserId = userid; reply.ReviewReplyText = obj.AnReviewReply; if (reply.ReviewReplyText == null) { return(RedirectToAction("Error")); } reply.ReviewId = obj.AReviewId; db.AnReviewReplys.Add(reply); db.SaveChanges(); return(RedirectToAction("Index")); }