// GET: Blog
        public ActionResult Index()
        {
            BlogViewModel model = new BlogViewModel
            {
                PostsList = _postsManagement.GetAll().OrderByDescending(m => m.CreatedAt).ToList(),
                Setting   = _settingsManagement.Get(m => m.Name == "hotel.name"),
                Page      = _pagesManagement.Get(p => p.Name == "blog-banner")
            };

            return(View(model));
        }
        // GET: Home
        public ActionResult Index()
        {
            HomeViewModel model = new HomeViewModel
            {
                RoomTypesList    = _roomTypesManagement.GetAll().OrderBy(m => m.OrderSort).ToList(),                        //Get All Room Types
                ServicesList     = _servicesManagement.GetAll().OrderBy(m => m.OrderSort).ToList(),                         //Get All Additional Services
                PostsList        = _postsManagement.GetAll().OrderByDescending(m => m.CreatedAt).Take(3).ToList(),
                Page             = _pagesManagement.Get(m => m.Name == "About"),                                            //Get About Page
                TestimonialsList = _testimonialsManagement.GetAll(m => m.IsShow == true).OrderBy(m => m.OrderSort).ToList() //Get All Showable Testimonials
                                                                                                                            //TestimonialsList = _testimonialsManagement.GetAll(m => m.IsShow == true).Join(, t => t.CustomerID, c => c.ID, (t, c) => new { t, c }).OrderBy(m => m.OrderSort).ToList() //Get All Showable Testimonials
            };

            List <string> CountryList = new List <string>();

            CultureInfo[] CInfoList = CultureInfo.GetCultures(CultureTypes.SpecificCultures);
            foreach (CultureInfo CInfo in CInfoList)
            {
                RegionInfo R = new RegionInfo(CInfo.LCID);
                if (!(CountryList.Contains(R.EnglishName)))
                {
                    CountryList.Add(R.EnglishName);
                }
            }

            CountryList.Sort();
            ViewBag.CountryList = CountryList;

            return(View(model));
        }
Esempio n. 3
0
        // GET: Admin/BlogManagement
        public ActionResult Index()
        {
            ShowBlogViewModel model = new ShowBlogViewModel();

            model.PostList = _postsManagement.GetAll().OrderByDescending(p => p.CreatedAt).ToList();

            return(View(model));
        }