예제 #1
0
        /// <summary>
        /// Index Action for Flight Search
        /// Return a View of Flight Search Page
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            var a = new SelectList(scheduleMgr.GetAllCity(), "CityId", "CityName");

            ViewBag.Name        = new SelectList(scheduleMgr.GetAllFlight(), "FlightID", "Name");
            ViewBag.FromCityId  = a;
            ViewBag.ToCityId    = a;
            ViewBag.TravelClass = new SelectList(scheduleMgr.GetAllTravelClass(), "TravelClassId", "TravelClassName");

            #region Creating Drop Down for No of Ticket Allowed
            List <SelectListItem> noOfPeople = new List <SelectListItem>();
            for (int i = 0; i < count; i++)
            {
                noOfPeople.Add(new SelectListItem {
                    Text = (i + 1).ToString(), Value = (i + 1).ToString()
                });
            }

            ViewBag.NoOfPeople = new SelectList(noOfPeople, "Text", "Value");
            #endregion


            return(View());
        }