public ActionResult DeleteConfirmed(int id)
        {
            feed_back feed_back = db.feed_back.Find(id);

            db.feed_back.Remove(feed_back);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,customer_Name,mail,message")] feed_back feed_back)
 {
     if (ModelState.IsValid)
     {
         db.Entry(feed_back).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(feed_back));
 }
        public ActionResult Create([Bind(Include = "id,customer_Name,mail,message")] feed_back feed_back)
        {
            if (ModelState.IsValid)
            {
                db.feed_back.Add(feed_back);
                db.SaveChanges();
                return(RedirectToAction("Index", "home"));
            }

            return(View(feed_back));
        }
        // GET: feed_back/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            feed_back feed_back = db.feed_back.Find(id);

            if (feed_back == null)
            {
                return(HttpNotFound());
            }
            return(View(feed_back));
        }
Exemplo n.º 5
0
 public ActionResult Add_Feedback(int oID, String content)
 {
     using (OrderSystemEntities2 db = new OrderSystemEntities2())
     {
         int uid        = (Int32)(Session["id"]);
         var user_check = db.feed_back.Where(a => a.userID == uid).FirstOrDefault();
         if (user_check != null)
         {
             ViewBag.IsFeedback = "Bạn đã FeedBack";
             return(RedirectToAction("Index", "OrderList"));
         }
         else
         {
             var fb = new feed_back();
             fb.orderID     = oID;
             fb.create_time = DateTime.Now;
             fb.content     = content;
             fb.userID      = (Int32)(Session["id"]);
             db.feed_back.Add(fb);
             db.SaveChanges();
         }
     }
     return(RedirectToAction("Index", "OrderList"));
 }