Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ReplyGoods replyGoods = db.ReplyGoods.Find(id);

            db.ReplyGoods.Remove(replyGoods);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 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));
 }
Example #3
0
        // 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));
        }
Example #4
0
        // 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));
        }
Example #5
0
        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>"));
            }
        }
Example #6
0
        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"));
        }
Example #7
0
 public void addReplyGoods(ReplyGoods repgood)
 {
     db.ReplyGoods.Add(repgood);
     db.SaveChanges();
 }
Example #8
0
 public void InsertReplyGoods(ReplyGoods replygoods)
 {
     ireplygoods.InsertReplyGoods(replygoods);
 }
Example #9
0
 public static void addReplyGoods(ReplyGoods repgood)
 {
     commgood.addReplyGoods(repgood);
 }
Example #10
0
 public void InsertReplyGoods(ReplyGoods replygoods)
 {
     db.ReplyGoods.Add(replygoods);
     db.SaveChanges();
 }