public IActionResult Delete(Guid id) { try { if (_service.HasChildren(id)) { return(Json(new { Result = "Faild", Message = "Please delete the subordinate departments first!" })); } else { _service.Delete(id); return(Json(new { Result = "Success" })); } } catch (Exception ex) { return(Json(new { Result = "Faild", Message = ex.Message })); } }
public JsonResult Delete(Guid id) { _service.Delete(id); return(new JsonResult(new { code = 20000 })); }
public IActionResult Delete(Guid id) { try { _departmentAppService.Delete(id); return(Json(new { Result = "success" })); } catch (Exception ex) { return(Json(new { result = "faild", Message = ex.Message })); } }
public IActionResult Delete(Guid id) { try { _service.Delete(id); return(Ok(new { Result = "Success" })); } catch (Exception ex) { return(Ok(new { Result = "Faild", Message = ex.Message })); } }
public IActionResult Delete(Guid id) { _departmentAppService.Delete(id); return(RedirectToAction("Index", "Department")); }
public DepartmentDeleteResponse Delete(long id) { return(_departmentAppService.Delete(id)); }
public async Task <IActionResult> Delete(int id) { var result = _service.Delete(id); return(await Response(result, result.Notifications)); }