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

            db.ComReply.Remove(comReply);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 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));
 }
Example #3
0
        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();
        }
Example #4
0
        // 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));
        }
Example #5
0
        // 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));
        }