public async Task <IActionResult> CheckSend(string deviceCode) { var result = new ResultEntity(); var departments = new List <DepartmentEditDto>(); var department = await _departmentAppService.GetForEditByIdAsync(CurrentUser.DepartmentId); departments.Add(department); var client = await _clientAppService.GetClient(deviceCode); if (client == null) { result.Message = "未注册的客户端无法使用此功能"; } else { if (client.ClientType == EnumClientType.个人终端) { result.Message = "请在自助终端使用打印功能"; } else { var isPlaceWarden = await _placeAppService.IsPlaceWarden(CurrentUser.UserId, client.PlaceId); if (isPlaceWarden) { var place = await _placeAppService.GetForEditByIdAsync(client.PlaceId); var placeDepartment = await _departmentAppService.GetForEditByIdAsync(place.DepartmentId); departments.Add(placeDepartment); } result.Success = true; result.Data = departments.Distinct().Select(a => new SelectViewModel { Id = a.Id, Text = a.Name }); } } return(Json(result)); }
public async Task <IActionResult> EditDepartmentModal(int id) { var model = await _departmentAppService.GetForEditByIdAsync(id); return(PartialView("_EditDepartmentModal", model)); }