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)); }
public JsonResult Delete(int id) { var res = new FeedBackDAO().Delete(id); return(Json(new { status = res })); }
public JsonResult ChangeActive(long id) { var dao = new FeedBackDAO().ChangeActive(id); return(Json(new { status = dao })); }
public JsonResult ChangeShow(int id) { var res = new FeedBackDAO().ChangeShow(id); return(Json(new { status = res })); }
// 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)); }
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 })); }
public JsonResult Detail(long id) { var model = new FeedBackDAO().ViewDetail(id); return(Json(new { status = true, model = model }, JsonRequestBehavior.AllowGet)); }
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")); }
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 })); }
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")); }
public ActionResult DuyetPH(int page = 1, int pagesize = 5) { var model = new FeedBackDAO().GetFeedBack(page, pagesize); return(View(model)); }
public ActionResult CustomerSays() { var model = new FeedBackDAO().CustomerFeedBack(); return(View(model)); }
public static int InsertFeedback(FeedBack feedback) { return FeedBackDAO.InsertFeedBack(feedback); }