示例#1
0
        // GET: TravelAgents/Create
        public IActionResult Create()
        {
            List <SelectListItem> roleTypeList = TravelTrackerEnumHelpers.GetTravelAgentRoleTypes();

            ViewBag.RoleTypes = roleTypeList;
            return(View());
        }
示例#2
0
        // GET: TravelAgents/Edit/5
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var travelAgent = await _context.TravelAgents.SingleOrDefaultAsync(m => m.TravelAgentId == id);

            if (travelAgent == null)
            {
                return(NotFound());
            }
            List <SelectListItem> roleTypeList = TravelTrackerEnumHelpers.GetTravelAgentRoleTypes();

            ViewBag.RoleTypes = roleTypeList;
            return(View(travelAgent));
        }
        // GET: AirTravelQueries/Edit/5
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var airTravelQuery = await _context.AirTravelQuery.SingleOrDefaultAsync(m => m.RequestId == id);

            if (airTravelQuery == null)
            {
                return(NotFound());
            }
            ViewData["TravelAgentId"]  = new SelectList(_context.TravelAgents, "TravelAgentId", "AgentName", airTravelQuery.TravelAgentId);
            ViewData["TravelType"]     = TravelTrackerEnumHelpers.GetTravelTypes();
            ViewData["AirTravelClass"] = TravelTrackerEnumHelpers.GetAirTravelTypes();
            ViewData["QueryStatus"]    = TravelTrackerEnumHelpers.GetQueryStatusOptions();
            return(View(airTravelQuery));
        }