public IActionResult Index()
        {
            AdminIndexViewModel model = new AdminIndexViewModel
            {
                CategoryCount = _categoryImageService.GetAll().Data.Count,
                GalleryCount  = _galleryService.GetAll().Data.Count,
                PageCount     = _pageService.GetAll().Data.Count,
                SlideCount    = _sliderService.GetAll().Data.Count,
                SocialCount   = _socialService.GetAll().Data.Count
            };

            return(View(model));
        }
Пример #2
0
        public IViewComponentResult Invoke()
        {
            NavbarModels model = new NavbarModels();

            try
            {
                model.Navbar = _navbarService.GetAll().Where(i => i.isApproved == true).First();
            }
            catch (Exception)
            {
                model.Navbar = null;
            }
            try
            {
                model.Social = _socialService.GetAll().Where(i => i.isApproved == true).First();
            }
            catch (Exception)
            {
                model.Social = null;
            }
            try
            {
                model.Menu = _menuService.GetAllWithMenuType().Where(i => i.isApproved).ToList();
            }
            catch (Exception)
            {
                model.Menu = null;
            }

            return(View(model));
        }
Пример #3
0
        protected virtual IEnumerable <IIntranetActivity> GetAllActivities()
        {
            var allBulletins = _bulletinsService.GetAll().Cast <IIntranetActivity>();
            var allNews      = _newsService.GetAll().Cast <IIntranetActivity>();
            var allEvents    = _eventsService.GetAll().Cast <IIntranetActivity>();

            return(allBulletins.Concat(allNews).Concat(allEvents));
        }
        public IViewComponentResult Invoke()
        {
            var result = _socialService.GetAll();

            if (result.Success)
            {
                return(View(result.Data));
            }

            return(View());
        }
Пример #5
0
        public IActionResult Social()
        {
            var model = _socialService.GetAll();

            ViewBag.items = model.Where(i => i.isApproved == true).Count();
            if (ViewBag.items == 1)
            {
                ViewBag.alert = false;
            }
            else
            {
                ViewBag.alert = true;
            }
            return(View(model));
        }