public IActionResult Edit(int cinemaId) { var cinema = _cinemaService.GetByIdAsync(cinemaId).Result; if (cinema == null) { return(BadRequest()); } return(View(cinema)); }
public async Task <IActionResult> Edit(int cinemaId) { var cinema = await _cinemaService.GetByIdAsync(cinemaId); if (cinema == null) { return(NotFound()); } ViewBag.Title = $"编辑电影院 - {cinema.Name}"; return(View(cinema)); }
public async Task <IActionResult> Index(int cinemaId) { var cinema = await _cinemaService.GetByIdAsync(cinemaId); ViewBag.Title = $"{cinema.Name}今天上映的电影有:"; return(View(await _movieService.GetByCinemaAsync(cinemaId))); }
public async Task <ActionResult <CinemaDto> > GetCinema(int id) { var cinema = await _cinemaService.GetByIdAsync(id); var cinemaModel = _mapper.Map <CinemaDto>(cinema); return(cinemaModel); }
public async Task <IActionResult> Index(int cinemaId) { var cinema = await cinemaServices.GetByIdAsync(cinemaId); ViewBag.Title = $"{cinema.Name}这个电影院上映的电影有:"; ViewBag.CinemaId = cinemaId; return(View(await movieServices.GetByCinemaAsync(cinemaId))); }
public async Task <IActionResult> Details(Guid id) { try { var cinema = await cinemaService.GetByIdAsync(id); if (cinema is null) { return(NotFound()); } var result = mapper.Map <CinemaDetailsViewModel>(cinema); return(View(result)); } catch { return(RedirectToAction("Index", "Home")); } }
public async Task <IActionResult> Edit(int id, Cinema model) { if (ModelState.IsValid) { var exist = await _cinemaService.GetByIdAsync(id); if (exist == null) { return(NotFound()); } exist.Name = model.Name; exist.Location = model.Location; exist.Capacity = model.Capacity; } return(RedirectToAction("Index")); }
public async Task <IActionResult> Edit(int cinemaId) { var cinema = await _cinemaService.GetByIdAsync(cinemaId); return(View(cinema)); }
public async Task <IActionResult> Edit(int cinemaId) { return(View(await cinemaServices.GetByIdAsync(cinemaId))); }
public async Task <IActionResult> Edit(int cinemaId) { ViewBag.Title = "修改电影院"; return(View(await _cinemaService.GetByIdAsync(cinemaId))); }
public async Task GetCinema(int id) { var cinema = await _cinemaService.GetByIdAsync(id); }