예제 #1
0
        public ActionResult FeedBack(FeedBack model)
        {
            var accSession = (AccLogin)Session[Account_Session];

            if (accSession != null)
            {
                model.IDCustomer = accSession.AccID;
                model.Type       = "Thành viên";
            }
            else
            {
                model.Type = "Khách hàng";
            }
            model.DaDuyet = false;
            bool kq = new FeedBackDAO().SendFeedBack(model);

            if (!kq)
            {
                ModelState.AddModelError("", "Có lỗi xảy ra");
            }
            else
            {
                return(Redirect("/trang-chu"));
            }
            return(View(model));
        }
예제 #2
0
        public JsonResult Delete(int id)
        {
            var res = new FeedBackDAO().Delete(id);

            return(Json(new
            {
                status = res
            }));
        }
예제 #3
0
        public JsonResult ChangeActive(long id)
        {
            var dao = new FeedBackDAO().ChangeActive(id);

            return(Json(new
            {
                status = dao
            }));
        }
예제 #4
0
        public JsonResult ChangeShow(int id)
        {
            var res = new FeedBackDAO().ChangeShow(id);

            return(Json(new
            {
                status = res
            }));
        }
예제 #5
0
        // GET: Admin/Feedback
        public ActionResult Index(string q, int page = 1, int pageSize = 5)
        {
            GetViewBag_Session();
            var dao   = new FeedBackDAO();
            var model = dao.ListAll(q, page, pageSize);

            ViewBag.QueryString = q;
            return(View(model));
        }
예제 #6
0
        public JsonResult FeedBack(string strFeedback)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            Feedback             entity     = serializer.Deserialize <Feedback>(strFeedback);
            var  dao = new FeedBackDAO();
            bool res = dao.InsertFeedBack(entity);

            return(Json(new { res = res }));
        }
예제 #7
0
        public JsonResult Detail(long id)
        {
            var model = new FeedBackDAO().ViewDetail(id);

            return(Json(new
            {
                status = true,
                model = model
            }, JsonRequestBehavior.AllowGet));
        }
예제 #8
0
        public ActionResult Duyet(int idFeed)
        {
            bool kq = new FeedBackDAO().Duyet(idFeed);

            if (!kq)
            {
                ModelState.AddModelError("", "Có lỗi xảy ra");
            }
            return(Redirect("/Admin/DuyetPhanHoi/DuyetPH"));
        }
예제 #9
0
        public JsonResult ViewDetail(int id)
        {
            bool status = false;
            var  model  = new FeedBackDAO().ViewDetail(id);

            if (model.ID > 0)
            {
                status = true;
            }
            return(Json(new
            {
                data = model,
                status = status
            }));
        }
예제 #10
0
 public ActionResult Create(FeedBack feedBack)
 {
     if (ModelState.IsValid)
     {
         feedBack.CreateDate = DateTime.Now;
         var model = new FeedBackDAO().Insert(feedBack);
         if (model)
         {
             TempData["Success"] = "Gửi thành công";
             return(View("Index"));
         }
         else
         {
             TempData["Error"] = "Gửi không thành công";
             return(View("Index"));
         }
     }
     TempData["Error"] = "Gửi không thành công";
     return(View("Index"));
 }
예제 #11
0
        public ActionResult DuyetPH(int page = 1, int pagesize = 5)
        {
            var model = new FeedBackDAO().GetFeedBack(page, pagesize);

            return(View(model));
        }
예제 #12
0
        public ActionResult CustomerSays()
        {
            var model = new FeedBackDAO().CustomerFeedBack();

            return(View(model));
        }
 public static int InsertFeedback(FeedBack feedback)
 {
     return FeedBackDAO.InsertFeedBack(feedback);
 }