public IActionResult Update(Hall hall) { var result = _hallService.Update(hall); if (result.Success) { return(Ok(result.Message)); } return(BadRequest(result.Message)); }
public ActionResult Edit([Bind(Include = "Id,Name,RowAmount,ColumnAmoun,CinemaId")] HallViewModel hallViewModel) { if (!ModelState.IsValid) { return(View(hallViewModel)); } HallDomainModel hallDomainModel = Mapper.Map <HallViewModel, HallDomainModel>(hallViewModel); _hallService.Update(hallDomainModel); return(RedirectToAction("Index")); }
public IActionResult Put([FromBody] HallModel model) { try { if (ModelState.IsValid) { _hallService.Update(model); return(Ok()); } else { return(BadRequest(ModelState)); } } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); return(BadRequest(ModelState)); } }