public async Task <IActionResult> Edit(int id, [Bind("StaffMemberID,StaffMemberName,ContactNumber,EmailId,AirlineName")] StaffMember staffMember)
        {
            if (id != staffMember.StaffMemberID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(staffMember);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StaffMemberExists(staffMember.StaffMemberID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AirlineID"] = new SelectList(_context.Airline, "AirlineName", "AirlineName", staffMember.AirlineID);
            return(View(staffMember));
        }
        public async Task <IActionResult> Edit(int id, [Bind("AirlineID,AirlineName,DepatureDate")] Airline airline)
        {
            if (id != airline.AirlineID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(airline);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AirlineExists(airline.AirlineID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(airline));
        }
Example #3
0
        public async Task <IActionResult> Edit(int id, [Bind("TravellerID,TravellerName,ContactNumber,StaffMemberName")] Traveller traveller)
        {
            if (id != traveller.TravellerID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(traveller);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TravellerExists(traveller.TravellerID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StaffMemberID"] = new SelectList(_context.StaffMember, "StaffMemberName", "StaffMemberName", traveller.StaffMemberID);
            return(View(traveller));
        }
Example #4
0
        public async Task <IActionResult> Edit(int id, [Bind("TicketID,TicketName,Price,AirlineName")] TicketPrice ticketPrice)
        {
            if (id != ticketPrice.TicketID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ticketPrice);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TicketPriceExists(ticketPrice.TicketID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AirlineID"] = new SelectList(_context.Airline, "AirlineName", "AirlineName", ticketPrice.AirlineID);
            return(View(ticketPrice));
        }