public IActionResult GetTreeData() { var dtos = _service.GetAllList(); List <TreeModel> treeModels = new List <TreeModel>(); foreach (var dto in dtos) { treeModels.Add(new TreeModel() { Id = dto.Id.ToString(), Text = dto.Name, Parent = dto.ParentId == Guid.Empty ? "#" : dto.ParentId.ToString() }); } return(Json(treeModels)); }
public IActionResult Index() { ViewBag.PageHeader = "用户管理"; ViewBag.OptionalDescription = "列表"; List <DepartmentDto> departments = _departmentAppService.GetAllList(); return(View(departments)); }
/// <summary> /// Get all departments /// </summary> /// <param name=""></param> /// <returns></returns> public IActionResult GetAllDepartmentsList() { List <TreeModel> treeModels = new List <TreeModel>(); var departments = _depAppService.GetAllList(); foreach (var category in departments) { treeModels.Add(new TreeModel() { Id = category.Id.ToString(), Text = category.Name, Parent = category.ParentId == Guid.Empty ? "#" : category.ParentId.ToString() }); } return(Json(treeModels)); }
public IActionResult GetAllData() { var dtos = _service.GetAllList(); return(Json(dtos)); }