private List <MenuQuyenHanModel> DocDanhSachChucNang() { if ((bool)Session[ConstantValues.SessionKeyVaiTro]) { return(MenuQuyenHanModel.SapXepMenu(xlChucNang.DocDanhSachChucNang().ToList())); } else { return(MenuQuyenHanModel.SapXepMenu(xlChucNang.DocDanhSachTatCaChucNangTuDanhSachId(currentUser.DanhSachChucNang))); } }
public ActionResult DanhSachChucNang() { if (SessionManager.CheckSession(ConstantValues.SessionKeyCurrentUser)) { var chucNangs = xlchucnang.DocDanhSachTatCaChucNang(); List <MenuQuyenHanModel> menuModel = MenuQuyenHanModel.SapXepMenu(chucNangs); return(View("DanhSachChucNang", menuModel)); } if (Request.Url != null) { SessionManager.RegisterSession(ConstantValues.SessionKeyUrl, Request.Url.AbsolutePath); } return(RedirectToAction("Index", "Login")); }
public PartialViewResult MenuQuyenHan() { List <MenuQuyenHanModel> menuModel = new List <MenuQuyenHanModel>(); if (Session[ConstantValues.SessionKeyMenu] != null) { menuModel = new List <MenuQuyenHanModel>(SessionManager.ReturnSessionObject(ConstantValues.SessionKeyMenu) as List <MenuQuyenHanModel>); } else { var user = SessionManager.ReturnSessionObject(ConstantValues.SessionKeyCurrentUser) as NguoiDung; if (user.DanhSachChucNang.Count() > 0) { //var dsPhanQuyen = user.DanhSachChucNang; var dsChucNang = xlchucnang.DocDanhSachTatCaChucNangTuDanhSachId(user.DanhSachChucNang); menuModel = MenuQuyenHanModel.SapXepMenu(dsChucNang); } SessionManager.RegisterSession(ConstantValues.SessionKeyMenu, menuModel); } return(PartialView(menuModel)); }