예제 #1
0
        public IActionResult Edit(FlightModel model)
        {
            var flightUpModel = new FlightUpdateModel();

            flightUpModel.UpdateFlight(model);
            return(RedirectToAction(nameof(FlightController.Index)));
        }
예제 #2
0
        public IActionResult Delete(IEnumerable <int> flightIds)
        {
            var model = new FlightUpdateModel();

            model.DeleteFlights(flightIds);
            return(Json(flightIds.Count()));
        }
예제 #3
0
 public IActionResult Add(FlightModel flight)
 {
     if (ModelState.IsValid)
     {
         var model = new FlightUpdateModel();
         model.AddNewFlight(flight);
         return(RedirectToAction(nameof(FlightController.Index)));
     }
     // If we got this far, something failed, redisplay form
     return(View(flight));
 }