Exemple #1
0
        public async Task <IActionResult> AddPlane()
        {
            AddPlaneVM vm = new AddPlaneVM
            {
                FlightSeatTypes = (await _globalRepo.GetAll <FlightSeatType>(FlightSeatType.tableName)).Select(s => new SelectListItem {
                    Value = s.ID.ToString(), Text = "Rows: " + s.NumRows + ", Left: " + s.NumSeatsLeft + ", Center: " + s.NumSeatsCenter + ", Right: " + s.NumSeatsRight
                }).ToList()
            };

            return(View(vm));
        }
Exemple #2
0
        public async Task <IActionResult> AddPlane(AddPlaneVM vm)
        {
            var result = await _flightRepo.AddPlane(vm.Plane);

            return(RedirectToAction(nameof(ViewAllPlanes)));
        }