Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CommentMst commentMst = db.CommentMsts.Find(id);

            db.CommentMsts.Remove(commentMst);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Review(string review, string itemCode, int userId)
        {
            CommentMst c = new CommentMst();

            c.cmtContent = review;
            c.itemCode   = itemCode;
            c.userId     = userId;
            _context.CommentMsts.Add(c);
            _context.SaveChanges();
            return(RedirectToAction("ItemDetails", "Client", new { id = itemCode }));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "cmtId,userId,itemCode,cmtContent,ratingValue")] CommentMst commentMst)
 {
     if (ModelState.IsValid)
     {
         db.Entry(commentMst).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.itemCode = new SelectList(db.ItemMsts, "itemCode", "brandId", commentMst.itemCode);
     ViewBag.userId   = new SelectList(db.UserRegMsts, "userId", "userFname", commentMst.userId);
     return(View(commentMst));
 }
Ejemplo n.º 4
0
        // GET: Admin/CommentMsts/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CommentMst commentMst = db.CommentMsts.Find(id);

            if (commentMst == null)
            {
                return(HttpNotFound());
            }
            return(View(commentMst));
        }
Ejemplo n.º 5
0
        // GET: Admin/CommentMsts/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CommentMst commentMst = db.CommentMsts.Find(id);

            if (commentMst == null)
            {
                return(HttpNotFound());
            }
            ViewBag.itemCode = new SelectList(db.ItemMsts, "itemCode", "brandId", commentMst.itemCode);
            ViewBag.userId   = new SelectList(db.UserRegMsts, "userId", "userFname", commentMst.userId);
            return(View(commentMst));
        }