public ActionResult DeleteProject(int id) { projectService.Delete(id); projectService.SaveChanges(); taskListService.DeleteMultiByParentID(id); taskListService.SaveChanges(); taskMemberService.DeleteMultiByProjectID(id); taskMemberService.SaveChanges(); projectMemberService.DeleteMultiByProjectID(id); projectMemberService.SaveChanges(); return(AjaxResult(true)); }
public ActionResult DeleteTask(long id) { try { if (id != 0) { taskListService.Delete(id); taskMemberService.DeleteMulti(id); taskMemberService.SaveChanges(); taskListService.SaveChanges(); return(AjaxResult(true, "success")); } else { return(AjaxResult(false, "error")); } } catch (Exception e) { return(AjaxResult(false, "Lỗi hệ thống", null, e.Message)); } }