Exemple #1
0
        public IActionResult Index([FromServices] Services.ICachedData cachedData)
        {
            SASSearch sasSearch = new SASSearch();

            sasSearch.Routes       = new List <SelectListItem>();
            sasSearch.ReturnRoutes = new List <SelectListItem>();
            sasSearch.Routes.Add(new SelectListItem {
                Value = "All", Text = "All"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "Europe", Text = "Scandinavia"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "ARN", Text = "Stockholm"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "CPH", Text = "Copenhagen"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "OSL", Text = "Oslo"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "Central Asia & Far East Asia", Text = "Asia"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "North & Central America", Text = "Usa"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "BOS", Text = "Boston"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "ORD", Text = "Chicago"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "LAX", Text = "Los Angeles"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "EWR", Text = "Newark"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "SFO", Text = "San Francisco"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "MIA", Text = "Miami"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "IAD", Text = "Washington"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "PEK", Text = "Beijing"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "HKG", Text = "Hong Kong"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "PVG", Text = "Shanghai"
            });
            sasSearch.Routes.Add(new SelectListItem {
                Value = "NRT", Text = "Tokyo"
            });

            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "All", Text = "All"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "Central Asia & Far East Asia", Text = "Asia"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "North & Central America", Text = "Usa"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "BOS", Text = "Boston"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "ORD", Text = "Chicago"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "LAX", Text = "Los Angeles"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "MIA", Text = "Miami"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "EWR", Text = "Newark"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "SFO", Text = "San Francisco"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "IAD", Text = "Washington"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "PEK", Text = "Beijing"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "HKG", Text = "Hong Kong"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "PVG", Text = "Shanghai"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "NRT", Text = "Tokyo"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "Europe", Text = "Scandinavia"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "ARN", Text = "Stockholm"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "CPH", Text = "Copenhagen"
            });
            sasSearch.ReturnRoutes.Add(new SelectListItem {
                Value = "OSL", Text = "Oslo"
            });
            sasSearch.Passengers = 1U;
            sasSearch.MinDays    = 0U;
            sasSearch.MaxDays    = 7U;
            sasSearch.Return     = true;
            sasSearch.CabinClass = (int)CabinClass.Business;
            sasSearch.From       = new List <string>(new string[] { "Europe" });
            sasSearch.To         = new List <string>(new string[] { "All" });


            sasSearch.Classes = new List <SelectListItem>();
            sasSearch.Classes.Add(new SelectListItem {
                Text = "Business", Value = ((int)CabinClass.Business).ToString()
            });
            sasSearch.Classes.Add(new SelectListItem {
                Text = "Plus (PE)", Value = ((int)CabinClass.Plus).ToString()
            });
            sasSearch.Classes.Add(new SelectListItem {
                Text = "GO (Economy)", Value = ((int)CabinClass.Go).ToString()
            });
            sasSearch.Classes.Add(new SelectListItem {
                Text = "Any/mixed", Value = ((int)CabinClass.All).ToString()
            });
            sasSearch.OutWeekDays   = new List <int>();
            sasSearch.InWeekDays    = new List <int>();
            sasSearch.EquipmentList = cachedData.EquipmentList.Select(s => new SelectListItem(s, s)).ToList();
            sasSearch.EquipmentList.Insert(0, new SelectListItem("All", ""));
            return(View(sasSearch));
        }
Exemple #2
0
        public IActionResult List([FromServices] Services.ICachedData cachedData)
        {
            var list = cachedData.Crawls.Where(c => c.Business > 0 && c.TravelDate > DateTime.Now && c.Route.Show);

            return(View(list));
        }
Exemple #3
0
 public ExportController(Services.ICachedData data)
 {
     this.data = data;
 }
Exemple #4
0
 public IActionResult ListResult([FromServices] Services.ICachedData cachedData, SASSearch search)
 {
     return(ViewComponent(nameof(ListResult), search));
 }
        public IActionResult List([FromServices] Services.ICachedData cachedData)
        {
            var list = cachedData.Crawls.Where(c => c.Business > 0 && c.Departure.Value.ToUniversalTime() > DateTimeOffset.UtcNow && c.Route.Show);

            return(View(list));
        }