Exemple #1
0
        public IActionResult Index(EventFilter filter = null)
        {
            var testimonialValues = _testimonialRepo.getQueryable().ToList();

            ViewBag.testimonial = testimonialValues;
            var events = _eventRepo.getQueryable().Where(a => a.is_closed == false);

            ViewBag.pagerInfo = _paginatedMetaService.GetMetaData(events.Count(), filter.page, 5);
            events            = events.Skip(filter.number_of_rows * (filter.page - 1)).Take(5);
            return(View(events.OrderByDescending(a => a.event_to_date).ToList()));
        }
        public IActionResult detail(string slug)
        {
            var setupValues = _setupRepository.getQueryable().ToList();

            ViewBag.setup = setupValues;
            var testimonialValues = _testimonialRepo.getQueryable().ToList();

            ViewBag.testimonial = testimonialValues;
            var memberDetail = _membersRepo.getBySlug(slug);

            return(View(memberDetail));
        }
        public IActionResult Index(TestimonialFilter filter = null)
        {
            try
            {
                var testimonials = _testimonialRepo.getQueryable();

                if (!string.IsNullOrWhiteSpace(filter.title))
                {
                    testimonials = testimonials.Where(a => a.person_name.Contains(filter.title));
                }

                ViewBag.pagerInfo = _paginatedMetaService.GetMetaData(testimonials.Count(), filter.page, filter.number_of_rows);


                testimonials = testimonials.Skip(filter.number_of_rows * (filter.page - 1)).Take(filter.number_of_rows);
                return(View(testimonials.ToList()));
            }
            catch (Exception ex)
            {
                AlertHelper.setMessage(this, ex.Message, messageType.error);
                return(Redirect("/admin"));
            }
        }
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var testimonials = _testimonialRepo.getQueryable().Where(a => a.is_visible == true).ToList();

            return(View(testimonials));
        }
        public IActionResult Index()
        {
            var homeImage = _galleryRepo.getQueryable().Where(g => g.is_slider_image == true && g.is_enabled == true).ToList();

            ViewBag.sliderImages = homeImage;

            var setupValues = _setupRepo.getQueryable().ToList();

            ViewBag.setup             = setupValues;
            TempData["email-message"] = TempData["email-message"];

            var testimonialValues = _testimonialRepo.getQueryable().Where(a => a.is_visible == true).ToList();

            ViewBag.testimonial = testimonialValues;

            var newsValue = _newsRepository.getQueryable().Where(a => a.is_active == true).OrderByDescending(a => a.news_id).ToList().Take(4);

            ViewBag.news = newsValue;

            var serviceValue = _servicesRepository.getQueryable().Where(a => a.is_active == true).ToList();

            ViewBag.services = serviceValue;

            var partners = _partnersRepository.getQueryable().Where(a => a.is_active == true).ToList();

            ViewBag.partners = partners;


            var menus = _menuRepo.getQueryable().Where(a => a.is_enabled == true);

            ViewBag.menu = menus.ToList();
            var menuCategory = _menuCategoryRepo.getQueryable().ToList();

            ViewBag.menuCategories = menuCategory;

            var doctorValue = _doctorsRepository.getQueryable().Where(a => a.is_active == true).ToList();

            ViewBag.doctors = doctorValue;

            var memberValue = _membersRepository.getQueryable().ToList();

            ViewBag.members = memberValue;

            var blogValue = _blogRepo.getQueryable().ToList();

            ViewBag.blog = blogValue;

            var galleryValue = _galleryRepo.getQueryable().Where(n => n.is_enabled == true).ToList();

            ViewBag.gallery = galleryValue;


            var eventValue = _eventRepo.getQueryable().Where(a => a.event_from_date <= a.event_to_date).ToList();

            ViewBag.events   = eventValue;
            ViewBag.events12 = eventValue.Take(3);


            var notice = _noticeRepo.getQueryable().Where(n => n.notice_expiry_date.Date >= TimeZoneInfo.ConvertTime(DateTime.Now,
                                                                                                                     TimeZoneInfo.FindSystemTimeZoneById("Nepal Standard Time")).Date&& n.is_closed == false).ToList();

            notice = notice.Where(a => a.notice_date <= a.notice_expiry_date).ToList();

            ViewBag.notices        = notice;
            ViewBag.noticesForSide = notice.Take(3);

            var page = _pageRepo.getQueryable().Where(n => n.is_enabled == true && n.is_home_page == true).SingleOrDefault();

            ViewBag.homePage = page;

            var videoValue = _videoRepository.getQueryable().Where(n => n.is_enabled == true && n.is_home_video == true).ToList();

            ViewBag.homeVideo = videoValue;
            return(View());
        }