Exemple #1
0
        // GET: Admin/Home
        public ActionResult Index()
        {
            double totalEarning = 0;
            var    book         = _booksManagement.Get(d => d.ID == 7);
            var    booksList    = _booksManagement.GetAll(b => DateTime.Equals(b.ArrivalDate, DateTime.Today) && !b.IsCancelled && !b.IsCheckIn).OrderBy(m => m.BookingDate).ToList();
            var    allBooksList = _booksManagement.GetAll(d => !d.IsCancelled).ToList();

            foreach (var item in allBooksList)
            {
                totalEarning += ((float)item.Price * (1 - item.Discount) * item.Night);
            }

            HomeViewModel model = new HomeViewModel
            {
                ContactFormsList = _contactFormsManagement.GetAll().OrderByDescending(m => m.SendedAt).Take(8).ToList(),
                BooksList        = booksList.ToList(),
                CustomerCount    = _customersManagement.GetAll().Count(),
                BookingCount     = _booksManagement.GetAll().Count(),
                RoomCount        = _roomsManagement.GetAll().Count(),
                TotalEarning     = totalEarning,
                RoomTypeList     = _roomTypesManagement.GetAll().ToList(),
                TestimonialList  = _testimonialsManagement.GetAll(t => t.IsShow == true).OrderBy(t => t.OrderSort).ToList()
            };

            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));
        }
        // GET: Admin/TestimonialManagement
        public ActionResult Index()
        {
            ShowTestimonialViewModel model = new ShowTestimonialViewModel
            {
                TestimonialList = _testimonialsManagement.GetAll().OrderBy(t => t.OrderSort).ToList()
            };

            return(View(model));
        }
        public ActionResult Index()
        {
            AboutViewModel model = new AboutViewModel
            {
                ServicesList     = _servicesManagement.GetAll().OrderBy(m => m.OrderSort).ToList(),                         //Get All Additional Services
                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
            };

            return(View(model));
        }