public async Task <IActionResult> Delete(int id) { try { if (id > 0) { _result = await _iAddressTypeManager.DeleteAddressTypeAsync(id); } else { _result = Result.Fail(MessageHelper.DeleteFail); } if (_result.Success) { this.FlashSuccess(MessageHelper.Delete, "AddressTypeMessage"); } else { this.FlashError(_result.Error, "AddressTypeMessage"); } return(JsonResult(_result)); } catch (Exception ex) { _log.Error(LogMessageHelper.FormateMessageForException(ex, "Delete[POST]")); _result = Result.Fail(MessageHelper.UnhandelledError); return(JsonResult(_result)); } }
public async Task <IActionResult> Delete(int id) { try { if (id > 0) { _result = await _iAddressTypeManager.DeleteAddressTypeAsync(id); } else { _result = Result.Fail(MessageHelper.DeleteFail); } return(JsonResult(_result)); } catch (Exception ex) { return(JsonResult(ex)); } }