// GET: Admin/Slide public ActionResult Index(string searchString, int page = 1, int pagesize = 10) { var dao = new SlideDAO(); var listslide = dao.ListAll(searchString, page, pagesize); return(View(listslide)); }
public ActionResult Edit(Slide slide, string tempstatus, int id) { slide.SlideID = id; SlideDAO slideDAO = new SlideDAO(); if (ModelState.IsValid) { if (tempstatus == "Kích Hoạt") { slide.Status = true; } else { slide.Status = false; } var check = slideDAO.Edit(slide); if (check > 0) { TempData["msg"] = MessageBox.Show("Edit successfully"); return(RedirectToAction("Index", "Slide")); } else { ModelState.AddModelError("", "Edit fail"); } } return(View(slideDAO.GetSlide(tempSlideID))); }
// GET: Home public ActionResult Index() { TempData["slides"] = new SlideDAO().SelectAll().ToList(); TempData["listnewproduct"] = new ProductDAO().ListNewProduct(4); TempData["listhotproduct"] = new ProductDAO().ListHotProduct(4); return(View()); }
public ActionResult _Slide() { var dao = new SlideDAO(); var model = dao.GetAllSlide(); return(PartialView(model)); }
// GET: Admin/Slide public ActionResult Index(int page = 1, int pagesize = 10) { var dao = new SlideDAO(); var model = dao.ListAllPage(page, pagesize); return(View(model)); }
// GET: Admin/Slide public ActionResult Index() { var dao = new SlideDAO(); var model = dao.ListAllSlides(); return(View(model)); }
public ActionResult Index() { var model = new SlideDAO().GetSlideView(1); ViewBag.slide = model; return(View()); }
public ActionResult SlideShow() { SlideDAO slideDAO = new SlideDAO(); List <Slider> list = slideDAO.getList("slideshow"); return(View("SlideShow", list)); }
public ActionResult Remove(int SlideID) { SlideDAO slideDAO = new SlideDAO(); slideDAO.Remove(SlideID); return(RedirectToAction("Index", "Slide")); }
public ActionResult Sua(Slide sl) { SetViewBag(); if (ModelState.IsValid) { var dao = new SlideDAO(); var result = dao.Sua(sl); if (result) { SetAlert("Cập nhật slide " + sl.Id + " thành công!", "success"); logger.Info("Cập nhật slide " + sl.Id + " thành công!"); if (Session["returnUrl"] == null) { return(RedirectToAction("Them")); } else { return(Redirect(Session["returnUrl"].ToString())); } } else { SetAlert("Cập nhật slide " + sl.Id + " không thành công!", "error"); logger.Error("Cập nhật slide " + sl.Id + " không thành công!"); ModelState.AddModelError("", "Sửa không thành công!"); } } return(View()); }
public ActionResult Create(Slide slide, string tempstatus) { if (ModelState.IsValid) { if (tempstatus == "Kích Hoạt") { slide.Status = true; } else { slide.Status = false; } SlideDAO slideDAO = new SlideDAO(); var check = slideDAO.Create(slide); if (check > 0) { TempData["msg"] = MessageBox.Show("Create successfully"); return(RedirectToAction("Create", "Slide")); } else { ModelState.AddModelError("", "Create fail"); } } return(View()); }
public ActionResult xacnhanxoa(int ID) { var result = new SlideDAO().Delete(ID); SetAlert("Xóa thông tin thành công", "success"); return(RedirectToAction("Index", "Slide")); }
public ActionResult Edit(long id) { setViewBag(); var model = new SlideDAO().Detail(id); return(View(model)); }
// GET: Admin/TinTuc/AllTin public ActionResult AllSlide(string tukhoa, int page = 1, int pageSize = 20) { var dao = new SlideDAO(); var model = dao.DsSlide(tukhoa, page, pageSize); ViewBag.TuKhoa = tukhoa; return(View(model)); }
public ActionResult Edit(long id) { var dao = new SlideDAO(); var content = dao.GetByID(id); return(View(content)); }
// GET: Admin/Slide public ActionResult Index(string searchString, int page = 1, int pageSize = 5) { var dao = new SlideDAO(); var model = dao.ListAllPaging(searchString, page, pageSize); ViewBag.SearchString = searchString; return(View(model)); }
public ActionResult Edit(int id) { tempSlideID = id; SlideDAO slideDAO = new SlideDAO(); var Slide = slideDAO.GetSlide(id); return(View(Slide)); }
// GET: Admin/Slide public ActionResult Index(int?page) { var model = new SlideDAO().GetAll(); int pageSize = 10; int pageNumber = (page ?? 1); return(View(model.ToPagedList(pageNumber, pageSize))); }
public JsonResult ChangeStatus(long id) { var result = new SlideDAO().ChangeStatus(id); return(Json(new { status = result })); }
public ActionResult Edit(int id) { //SetViewBag(); var dao = new SlideDAO(); var slide = dao.GetSlideByID(id); return(View(slide)); }
// GET: Admin/Slide public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { var DAO = new SlideDAO(); var model = DAO.ListAllSlide(searchString, page, pageSize); ViewBag.SearchString = searchString; return(View(model)); }
public JsonResult Delete(long id) { var dao = new SlideDAO().Delete(id);//xóa trong db return(Json(new { status = dao//trả về giá trị cho ajax true false })); }
public JsonResult ChangeStatus(int SlideID) { SlideDAO slideDAO = new SlideDAO(); var tempstatus = slideDAO.ChangeStatus(SlideID); return(Json(new { status = tempstatus })); }
public JsonResult ThayDoiTrangThai(long id) { var result = new SlideDAO().ThayDoiTrangThai(id); return(Json(new { trangthai = result })); }
public JsonResult ChangeSlideStatus(long?slideID) { var result = new SlideDAO().ChangeSlideStatus(slideID); return(Json(new { status = result })); }
public ActionResult Index() { var slides = new SlideDAO().ListAll(); var productDao = new ProductDAO(); ViewBag.NewProduct = productDao.ListNewProduct(4); ViewBag.FeatureProduct = productDao.ListFeatureProduct(4); ViewBag.Slides = slides; return(View()); }
public ActionResult Sua(int id) { SetViewBag(); if (Request["returnUrl"] != null) { Session["returnUrl"] = Request["returnUrl"]; } var slide = new SlideDAO().ViewDetailByID(id); return(View(slide)); }
// // GET: /Home/ public ActionResult Index() { var slides = new SlideDAO().GetAllSlide(); var newProducts = new ProductDAO().GetListNewProduct(); var topProducts = new ProductDAO().GetListFeatureProduct(); ViewBag.Slide = slides; ViewBag.NewProduct = newProducts; ViewBag.TopProduct = topProducts; return View(); }
public ActionResult Delete(long id) { bool success = new SlideDAO().Delete(id); if (success) { SetAlert("Xóa slide thành công", "success"); } else { SetAlert("Xóa slide thất bại", "warning"); } return(RedirectToAction("Index", "Slide")); }
public ActionResult Index() { var productdao = new ProductDAO(); var slidedao = new SlideDAO(); var productcategorydao = new ProductCategoryDAO(); ViewBag.slide = slidedao.List(); ViewBag.KhuyenMaiHot = productdao.KhuyenMaiHot(4); ViewBag.SanPhamNoiBat = productdao.SanPhamNoiBat(4); ViewBag.XemNhieuNhat = productdao.XemNhieuNhat(); ViewBag.SanPhamMoi = productdao.SanPhamMoi(4); ViewBag.DanhMucNoiBat = productcategorydao.Danhmucnoibat(6); return(View()); }