public IActionResult Delete(string id)
        {
            try
            {
                if (string.IsNullOrEmpty(id))
                {
                    return(RedirectToAction("ViewAllVenues", "AllVenue"));
                }

                int result = _IEquipment.DeleteEquipment(Convert.ToInt32(id));

                if (result > 0)
                {
                    return(Json(data: true));
                }
                else
                {
                    return(Json(data: false));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #2
0
        public async Task <ActionResult> Delete([FromRoute] string request)
        {
            try
            {
                var result = await _service.DeleteEquipment(request);

                return(Ok(result));
            }
            catch (BusinessLogicException ex)
            {
                return(BadRequest(new Response
                {
                    Status = false,
                    Message = "BusinessLogic Error"
                }));
            }
            catch (Exception e)
            {
                return(BadRequest(new Response
                {
                    Status = false,
                    Message = ErrorMessages.UnkownError
                }));
            }
        }
コード例 #3
0
 public IActionResult DeleteEquipment(int id)
 {
     _dal.DeleteEquipment(id);
     return(RedirectToAction(nameof(List)));
 }