private void SelectCheckedNodes() { SelectedEntEmployeeInfoList.Clear(); // processmapmodel.EntTeamInfo_ID = EntTeamInfo.Id; teammapmodel.EntTeamInfo = EntTeamInfo; for (int i = 0; i < EntEmployeeInfoListAll.Count; i++) { EntEmployeeInfoListAll[i].IsChecked = false; } GetEntTeamMapInfoByIds(teammapmodel); if (ExistEntTeamMapInfoList.Any()) { foreach (var data in ExistEntTeamMapInfoList) { for (int i = 0; i < EntEmployeeInfoListAll.Count; i++) { if (!Equals(data.EntEmployeeInfo, null)) { if (data.EntEmployeeInfo.Id == EntEmployeeInfoListAll[i].Id) { EntEmployeeInfoListAll[i].IsChecked = true; } } } } } }
private void GetEntTeamMapInfoByIds(EntTeamMapInfoModel model) { #if DEBUG System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); #endif pageRepuestParams.SortField = GlobalData.SortField; pageRepuestParams.SortOrder = GlobalData.SortOrder; pageRepuestParams.PageIndex = 1; pageRepuestParams.PageSize = 200; FilterGroup filterGroup = new FilterGroup(FilterOperate.And); FilterRule filterRule = new FilterRule("EntTeamInfo.Id", model.EntTeamInfo.Id, FilterOperate.Equal); filterGroup.Rules.Add(filterRule); pageRepuestParams.FilterGroup = filterGroup; var result = Utility.Http.HttpClientHelper.PostResponse <OperationResult <PageResult <EntTeamMapInfoModel> > >(GlobalData.ServerRootUri + "EntTeamMapInfo/GetEntTeamMapInfoList", Utility.JsonHelper.ToJson(pageRepuestParams)); #if DEBUG stopwatch.Stop(); Utility.LogHelper.Info("获取已配置人员信息用时(毫秒):" + stopwatch.ElapsedMilliseconds); Utility.LogHelper.Info("已配置人员信息内容:" + Utility.JsonHelper.ToJson(result)); #endif if (!Equals(result, null) && result.Successed) { UiMessage = result?.Message; LogHelper.Info(UiMessage); if (result.Data.Data.Any()) { ExistEntTeamMapInfoList = new ObservableCollection <EntTeamMapInfoModel>(result.Data.Data); } else { ExistEntTeamMapInfoList?.Clear(); UiMessage = "未找到数据"; } } else { //操作失败,显示错误信息 ExistEntTeamMapInfoList = new ObservableCollection <EntTeamMapInfoModel>(); UiMessage = result?.Message ?? "查询信息失败,请联系管理员!"; } }