コード例 #1
0
 public HomeController()
 {
     #region Общий код для всех контроллеров
     SM.TryToLoginByCookiesIfNeed();
     ViewBag.L = LayoutViewModel.GetLayoutViewModel();
     #endregion
 }
コード例 #2
0
        public AdminController()
        {
            var currentUser = SM.CurrentUser;

            if (currentUser == null || !currentUser.IsAdmin)
            {
                throw new Exception("Доступ запрещен");
            }
            #region Общий код для всех контроллеров
            SM.TryToLoginByCookiesIfNeed();
            ViewBag.L = LayoutViewModel.GetLayoutViewModel();
            #endregion
        }