Exemplo n.º 1
0
        /**
         * GET: /Home/Index
         *
         * Try to load main form
         */
        public async Task <ActionResult> Index()
        {
            var user = Session["user"] as User;

            if (user != null)
            {
                var mainText = await _mainTextRepository.GetAboutInfoAsync();

                ViewBag.Title    = "Главная";
                ViewBag.MainText = mainText;

                if (Request.IsAjaxRequest())
                {
                    return(PartialView("IndexPartial"));
                }
                else
                {
                    return(View());
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account"));
            }
        }
Exemplo n.º 2
0
 private async Task OnPageLoadAsync()
 {
     _view.TextBlock = await _mainTextRepository.GetAboutInfoAsync();
 }