public ActionResult Header() { // lấy tất cả menu var model = new menu_dao().ListAll(); return(PartialView(model)); }
public ActionResult Edit(int id) { var model = new menu_dao().Get_By_Id(id); SetListType(model.menu_type_id); return(View(model)); }
public ActionResult Index(int page = 1, int page_size = 10) { var dao = new menu_dao(); var model = dao.ListAllPaging(page, page_size); return(View(model)); }
public JsonResult ChangeActive(int id) { var result = new menu_dao().ChangeActive(id); return(Json(new { status = result })); }
public ActionResult Footer() { // lấy tất cả menu var model = new menu_dao().ListAll(); // lấy thông tin giới thiệu về website ViewBag.AboutWeb = new info_dao().Get_By_Id("ABOUT"); return(PartialView(model)); }
public ActionResult DeleteAllChecked(string ids) { if (ids != "" && ids != null) { string[] array_id = ids.Split(','); var dao = new menu_dao(); foreach (var id in array_id) { var result = dao.Delete(int.Parse(id)); } } return(RedirectToAction("Index")); }
public ActionResult Edit(menu menu) { if (ModelState.IsValid) { var dao = new menu_dao(); var result = dao.Update(menu); if (result) { SetAlert(StaticResources.Resources.Pub_UpdateSucess, "success"); return(RedirectToAction("Index", "Menu")); } else { ModelState.AddModelError("", StaticResources.Resources.UpdateMenuFailed); } } SetListType(menu.menu_type_id); return(View()); }