Exemple #1
0
        public IActionResult ManagerSearchCustomer(Int32 FlightID, Boolean isRoundTrip, Int32 NumPassengers, Int32 cityToID, Int32 cityFromID, DateTime returnDate)
        {
            ManagerCustomerSearch mcs = new ManagerCustomerSearch
            {
                FlightID      = FlightID,
                isRoundTrip   = isRoundTrip,
                NumPassengers = NumPassengers,
                cityToID      = cityToID,
                cityFromID    = cityFromID,
                returnDate    = returnDate
            };

            return(View(mcs));
        }
Exemple #2
0
        public IActionResult ManagerSearchCustomer(ManagerCustomerSearch mcs)
        {
            var query = from c in _context.Users
                        select c;

            if (mcs.LastName != null && mcs.LastName != "")
            {
                query = query.Where(c => c.LastName.Contains(mcs.LastName));
            }
            if (mcs.AdvantageNumber != null)
            {
                query = query.Where(c => c.AdvantageNumber == (mcs.AdvantageNumber));
            }
            List <AppUser> SelectedUsers = query.ToList();

            ViewBag.FlightID      = mcs.FlightID;
            ViewBag.isRoundTrip   = mcs.isRoundTrip;
            ViewBag.NumPassengers = mcs.NumPassengers;
            ViewBag.cityToID      = mcs.cityToID;
            ViewBag.cityFromID    = mcs.cityFromID;
            ViewBag.returnDate    = mcs.returnDate;
            return(View("ReservationCustomersList", SelectedUsers));
        }