Exemplo n.º 1
0
        public IActionResult Update(Hall hall)
        {
            var result = _hallService.Update(hall);

            if (result.Success)
            {
                return(Ok(result.Message));
            }

            return(BadRequest(result.Message));
        }
Exemplo n.º 2
0
        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"));
        }
Exemplo n.º 3
0
 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));
     }
 }