//public ActionResult TourList(string key)
        //{
        //    var result = db.Tours.Where(t => t.TourType.TypeName == key).ToList();
        //    var lst = new List<TourDetailViewModel>();
        //    result.ForEach(t =>
        //    {
        //        var newTD = new TourDetailViewModel()
        //        {
        //            Tour = t,
        //            SpecialTourPlan = t.TourPlans.FirstOrDefault()
        //        };
        //        lst.Add(newTD);
        //    });
        //    return PartialView("TourList", lst);
        //}
        public ActionResult ViewTourList(string key)
        {
            var result = db.Tours.Where(t => t.TourType.TypeName == key).ToList();

            var lst = new List<TourDetailViewModel>();
            result.ForEach(t =>
            {
                var newTD = new TourDetailViewModel()
                {
                    Tour = t,
                    SpecialTourPlan = t.TourPlans.FirstOrDefault()
                };
                lst.Add(newTD);
            });

            return View(lst);
        }
        //public ActionResult TourList(Guid? TourTypeId, Guid? StartLocationId, Guid? EndLocationId)
        public ActionResult TourList(Guid? TourTypeId, Guid? StartLocationId)
        {
            var result = db.Tours.Where(t =>
                (TourTypeId == null || t.TourType.TourTypeId == TourTypeId) &&
                (StartLocationId == null || t.StartLocationId == StartLocationId)
                ).ToList();

            var lst = new List<TourDetailViewModel>();
            result.ForEach(t =>
            {
                var newTD = new TourDetailViewModel()
                {
                    Tour = t,
                    SpecialTourPlan = t.TourPlans.FirstOrDefault()
                };
                lst.Add(newTD);
            });

            if (Request.IsAjaxRequest())
            {
                return PartialView(lst);
            }
            return PartialView(lst);
        }