示例#1
0
        public IActionResult Delete(Hall hall)
        {
            var result = _hallService.Delete(hall);

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

            return(BadRequest(result.Message));
        }
示例#2
0
        public ActionResult DeleteConfirmed(long id)
        {
            HallDomainModel hallDomainModel = _hallService.ReadById(id);

            if (hallDomainModel == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }
            _hallService.Delete(hallDomainModel);
            return(RedirectToAction("Index"));
        }
示例#3
0
 public IActionResult Delete(Guid id)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _hallService.Delete(id);
             return(Ok());
         }
         else
         {
             return(BadRequest(ModelState));
         }
     }
     catch (Exception ex)
     {
         ModelState.AddModelError(string.Empty, ex.Message);
         return(BadRequest(ModelState));
     }
 }