public JsonResult ChangeStatus(long id) { var result = new AboutD().ChangeStatus(id); return(Json(new { status = result })); }
// GET: Admin/About public ActionResult Index(string searchString, int page = 1, int pageSize = 10) { var dao = new AboutD(); var model = dao.ListAllPaging(searchString, page, pageSize); ViewBag.SearchString = searchString; return(View(model)); }
public ActionResult Create(About about) { if (ModelState.IsValid) { var dao = new AboutD(); long id = dao.Insert(about); if (id > 0) { SetAlert("Thêm thành công", "success"); return(RedirectToAction("Index", "About")); } else { ModelState.AddModelError("", "Thêm không thành công"); } } return(View("Index")); }
public ActionResult Edit(About about) { if (ModelState.IsValid) { var dao = new AboutD(); var result = dao.Update(about); if (result) { SetAlert("Cập Nhật thành công", "success"); return(RedirectToAction("Index", "About")); } else { ModelState.AddModelError("", "Cập Nhật không thành công"); } } return(View("Index")); }
public ActionResult Edit(int id) { var about = new AboutD().ViewDetail(id); return(View(about)); }