Esempio n. 1
0
        public ActionResult DisplayAds(string viewName = "DisplayAds_Bottom")
        {
            var isUserLoggedIn = Request.IsAuthenticated;
            var isUserCompany  = User.IsInRole(Constants.CompanyRole);
            var companyId      = -1;

            if (isUserLoggedIn && isUserCompany)
            {
                companyId = CurrentUserCompanyId;
            }

            ViewBag.Ads = Mapper.Map <IEnumerable <DisplayAdViewModel> >(_adsService.DisplayAds(12, companyId));

            return(PartialView(viewName));
        }