public async Task <IActionResult> Create([Bind("AirlineID,AirlineName,DepatureDate")] Airline airline) { if (ModelState.IsValid) { _context.Add(airline); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(airline)); }
public async Task <IActionResult> Create([Bind("StaffMemberID,StaffMemberName,ContactNumber,EmailId,AirlineName")] StaffMember staffMember) { if (ModelState.IsValid) { _context.Add(staffMember); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AirlineID"] = new SelectList(_context.Airline, "AirlineName", "AirlineName", staffMember.AirlineID); return(View(staffMember)); }
public async Task <IActionResult> Create([Bind("TravellerID,TravellerName,ContactNumber,StaffMemberName")] Traveller traveller) { if (ModelState.IsValid) { _context.Add(traveller); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["StaffMemberID"] = new SelectList(_context.StaffMember, "StaffMemberName", "StaffMemberName", traveller.StaffMemberID); return(View(traveller)); }
public async Task <IActionResult> Create([Bind("TicketID,TicketName,Price,AirlineName")] TicketPrice ticketPrice) { if (ModelState.IsValid) { _context.Add(ticketPrice); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AirlineID"] = new SelectList(_context.Airline, "AirlineName", "AirlineName", ticketPrice.AirlineID); return(View(ticketPrice)); }