コード例 #1
0
        // GET: SouvenirRequest
        public ActionResult Index()
        {
            UserViewModel currentuser = SouvenirRequestRepo.GetIdByName(User.Identity.Name);

            if (currentuser.Role == "Staff" || currentuser.Role == "Admin")
            {
                return(View(SouvenirRequestRepo.Get()));
            }
            else
            {
                return(new RedirectToRouteResult(new RouteValueDictionary(new { controller = "AccessDenied", action = "Index" })));
            }
        }
コード例 #2
0
 public ActionResult List()
 {
     return(PartialView("_List", SouvenirRequestRepo.Get()));
 }